Just got an STM32F4 discovery board.. Needing a little help :-)
Posted 17 June 2012 - 06:43 AM
I'm new to the world of microcontrollers. After some research, I bought my first ARM based Microcontroller; the STM32F4 Discovery.
Now, I have a few questions for the community, hopefully someone can answer me.
The first question has to do with the memory on the STM32F4. I was wondering if there was a way to expand the memory? Maybe have the memory on CPU, but then secondary dynamic memory (non flash) that could be added to the 192KB as extended memory.
the second question is which compiler should I start with? I normally run Ubuntu Linux 12.04, but I also have Windows on a virtual machine via Virtualbox that I'm able to load up Keil, and some of the other compilers on. I would personally like to have something that I can run on Ubuntu 12.04. Then again, I'd like to start with something that I can focus less on the software and more on the coding. I'm doing this independantly, so I'm on a budget. Which compiler would be best for me?
the third question is where should I start? I was a little confused as to what I should do first or how to set up a project. Where should I start to figure out how to code for this microcontroller? Are there any great books to read on this?
Posted 17 June 2012 - 05:58 PM
First, download the firmware package from ST web site:
http://www.st.com/in...duct/252419.jsp (there is a 32.MB zip file in the Design Support section).
This contains many example in the Project folder. There are examples for:
- Keil Microcontroller Dvelopment Kit
- IAR Embedded Workbench
-Tasking C compiler
You should also download user manual of the board:
and the user manual for this chip (RM0090)
This chip has 1MB flash and 192K SRAM(3 blocks : 112KB + 16KB + 64KB). For begineers it is not that often that you need to expand the memory. Most of the projects only need a small memory size. But in case you need to, there is an FSMC external memory controller on this chip. However, whether all the signals you need are connected to the connector of the board is another question (I don't know the answer on this either).
Regarding toolchains, both Keil MDK, IAR and Atollic Trusestudio has free version with 32KB limited. Keil MDK is windows only, and I think this is the same for IAR and TrueStudio. I don't think TASKING has a free version (you can get the evaluation version which is time limited). There are other tool chains that work in Linux, but the STM32F4 examples package is limited to these 4 toolchains.
Once you decide which toolchain to use, install the software, you can then open the project files from ST web site and start trying out different example projects.
You can download the Cortex-M4 Generic Device user guide from ARM:
Hope this helps.
Posted 18 June 2012 - 12:47 AM
The reason I'm asking about memory is that 192KB will be a bit low for the final end product that I'd like to create. Right now, I'll be OK with it because I'm learning the architecture. When I learn design and how to interact with the chip and other components, I'd like to use the same CPU, but with a bit more memory (2 - 4MB max). Would I be able to do that with this CPU?
I will check out the links you posted and read the documents as well. I installed Keil and TrueStudio. I'm still evaluating which product I'm going to buy.
Posted 18 June 2012 - 07:15 AM
ARM just provides the CPU design, and it is integrated by a manufacturer into each MCU design; they can decide how much RAM, flash, peripherals, clock-speed, external memory and I/O pin-out, etc. There are quite a few companies providing Cortex-M-series MCUs, so there is a lot of variety out there.
2-4MB is quite a lot of RAM for an MCU, so it is unlikely you'll get all of that inside the package (from what I can tell you can get quite a lot of flash, but RAM tends to be under 512KB). Remember that you can execute you code and RO data from flash, so that frees up some space. If you need more RAM than that then I think Joseph is right; you'll need to look at an MCU with an external memory interface.
Posted 18 June 2012 - 11:34 AM
The external memory controller (FSMC) in STM32F4 supports external SRAM, PSRAM.
So, the answer is yes, you can add memory to this chip (64MB maximum).
Please note that access to external SRAM and PSRAM will be slower than on-chip SRAM.
By the way, ST has got their own forum: