[fpc-devel] STM32F407 fun
Andrew Haines
andrewd207 at aol.com
Sat Mar 19 14:03:21 CET 2016
On 03/19/2016 07:36 AM, Michael Ring wrote:
> Re-reading your initial mail I am kind of wondering what you actually did ?
>
> When using -WpSTM32F407VG you will automagially use stm32f407xx.pp unit
> which is the correct one for your chip and also stack should be correct
> as ram size is set to 128MB.
>
First off thanks for looking at this. I'm not sure where you are getting 128MB...?
> How/why did you use STM32F429 unit for the chip?
There was no entry in fpc for STM32F407VG. I added
+ (controllertypestr:'STM32F407VG'; controllerunitstr:'STM32F429'; cputype:cpu_armv7em; fputype:fpu_soft; flashbase:$08000000; flashsize:$00080000; srambase:$20000000; sramsize:$00020000),
>
> Michael
>> Am 19.03.16 um 12:36 schrieb Michael Ring:
>>/Are you sure about RAM? I checked in cpuinfo, it is set to 128MB, this />>/matches what is written in the user manual, (Page 70) />>//>>/http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00037051.pdf
/>>//>>
On the first page of that link under memories it says:
Up to 192+4 Kbytes of SRAM including 64-
Kbyte of CCM (core coupled memory) data
RAM.
Looking in the C header file stm32f4xx.h I find:
#define CCMDATARAM_BASE ((uint32_t)0x10000000) /*!< CCM(core coupled memory) data RAM(64 KB) base address in the alias region */
#define SRAM1_BASE ((uint32_t)0x20000000) /*!< SRAM1(112 KB) base address in the alias region */
#define SRAM2_BASE ((uint32_t)0x2001C000) /*!< SRAM2(16 KB) base address in the alias region */
So starting from SRAM1_BASE there is 128kB of contiguous memory.
1024 * 128 = $20000
Looking at http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00071990.pdf for STM32F429VG is says:
Up to 256+4 KB of SRAM including 64-KB
of CCM (core coupled memory) data RAM
I couldn't find a specific header for the *29 chip but I'm assuming the extra 64kB memory it has is in that block so there is 192kB of memory. This matches the define for the *29 chip:
(controllertypestr:'STM32F429XG'; controllerunitstr:'STM32F429'; cputype:cpu_armv7em; fputype:fpu_soft; flashbase:$08000000; flashsize:$00100000; srambase:$20000000; sramsize:$00030000),
1024 * 192 = $30000
//>>/or are the last 16k for some special use? Could not find a hint while />>/quickly searching through the manual. />>//>>/Michael />>
I attached the changes I made to include the stm32f407vg chip in fpc.
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stm32f4.diff
Type: text/x-patch
Size: 2293 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160319/6e3eaba3/attachment.bin>
More information about the fpc-devel
mailing list