[fpc-devel] STM32F407 fun

Michael Ring mail at michael-ring.org
Sat Mar 19 14:20:31 CET 2016


OK, seems you are not using trunk or an outdated version of trunk as 
there are quite a number of units for stm32f4 available in current trunk:

stm32f401xx.pp
stm32f407xx.pp
stm32f411xe.pp
stm32f429xx.pp
stm32f446xx.pp

So I'd recomment to either upgrade to current trunk or at least copy the 
unit specially made for your chip to your installation and compile it by 
adding it to the list of controller units in the embedded rtl makefile 
and changing controllerunitstr to match the correct filename.

Good that we agree that 128MB is the right memory size, I first thought 
that you are using trunk and that the 128MB configured in the cpuinfo 
are wrong and instead 112MB is correct.
I haven't compiled for this chip for a while, I am mostly targeting 
f401, f411 and lately the f469 chips (I really like the STM32F469 
Discovery board) these days...

Michael

Am 19.03.16 um 14:03 schrieb Andrew Haines:
> 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
>
>
>
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160319/4ee23a38/attachment.html>


More information about the fpc-devel mailing list