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


Index: compiler/arm/cpuinfo.pas
===================================================================
--- compiler/arm/cpuinfo.pas	(revision 32211)
+++ compiler/arm/cpuinfo.pas	(working copy)
@@ -250,7 +250,9 @@
       ct_stm32f107rc,
       ct_stm32f107vb,
       ct_stm32f107vc,
-      
+
+      ct_stm32f407vg, // 1M flash
+
       ct_stm32f429xe, // 512K flash
       ct_stm32f429xg, // 1M flash
       ct_stm32f429xi, // 2M flash
@@ -644,7 +646,9 @@
       (controllertypestr:'STM32F107RC';     controllerunitstr:'STM32F10X_CL';     cputype:cpu_armv7m; fputype:fpu_soft; flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
       (controllertypestr:'STM32F107VB';     controllerunitstr:'STM32F10X_CL';     cputype:cpu_armv7m; fputype:fpu_soft; flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00010000),
       (controllertypestr:'STM32F107VC';     controllerunitstr:'STM32F10X_CL';     cputype:cpu_armv7m; fputype:fpu_soft; flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
-      
+
+      (controllertypestr:'STM32F407VG';     controllerunitstr:'STM32F429';        cputype:cpu_armv7em; fputype:fpu_soft; flashbase:$08000000; flashsize:$00080000; srambase:$20000000; sramsize:$00020000),
+
       (controllertypestr:'STM32F429XE';     controllerunitstr:'STM32F429';        cputype:cpu_armv7em; fputype:fpu_soft; flashbase:$08000000; flashsize:$00080000; srambase:$20000000; sramsize:$00030000),
       (controllertypestr:'STM32F429XG';     controllerunitstr:'STM32F429';        cputype:cpu_armv7em; fputype:fpu_soft; flashbase:$08000000; flashsize:$00100000; srambase:$20000000; sramsize:$00030000),
       (controllertypestr:'STM32F429XI';     controllerunitstr:'STM32F429';        cputype:cpu_armv7em; fputype:fpu_soft; flashbase:$08000000; flashsize:$00200000; srambase:$20000000; sramsize:$00030000),
Index: compiler/systems/t_embed.pas
===================================================================
--- compiler/systems/t_embed.pas	(revision 32211)
+++ compiler/systems/t_embed.pas	(working copy)
@@ -401,7 +401,9 @@
       ct_stm32f107rc,
       ct_stm32f107vb,
       ct_stm32f107vc,
-      
+
+      ct_stm32f407vg,
+
       ct_stm32f429xe,
       ct_stm32f429xg,
       ct_stm32f429xi,

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to