cancel
Showing results for 
Search instead for 
Did you mean: 

[Error] Building a custom external loader for a custom board based on a STM32F7 MCU

boomerblur
Associate II
Posted on March 15, 2018 at 04:20

Hi !!!

I am new member of STM32 MCU. I'm working 

 on a custom board based on a STM32F7 MCU for a GUI projects. In my projects, I store a lot of data for GUI such as: Imgae data, Fonts, Audio data in QSPI Flash. My MCU is STM32F769NI and my QSP Flash is MX25L512, that is same of STM32F769I - Discovery. When I use STM32CubeProgramer  to program the demo file supply by CubeMX Driver to my board then every thing is OK. But When I build my external loader then change file

extension

  from *.out to *.stldr (I am using IAR ) this error is appear. My external loader is follow example in ''C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\ExternalLoader\N25Q256A_STM32L476G-EVAL_Cube''. In my program I use BSP funtion supply by CUBE MX, and I check funtion by funtion same work. I'm stuck in this problem

.  Where is my error.  I attack my project in this post.  Can every one help me ? Thank you !!!

0690X0000060A5LQAU.png

#stm32cubeprogramer #external-flash-loader #stm32f7
23 REPLIES 23
Buelent Cakir
Associate II
Posted on March 15, 2018 at 04:45

Your ICF File doesn't look ok. You need to consider that the external loader will be moved to the ram and executed from there.

I use this in the ICF:

define symbol __ICFEDIT_region_RAM_start__   = 0x20000004;

define symbol __ICFEDIT_region_RAM_end__     = 0x21000000;

define memory mem with size = 4G;

define region RAM_region   = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];

define block RAM_BLOCK with fixed order {readonly code, readonly data, readwrite };

define block Info_BLOCK with fixed order { readonly data object Dev_Inf.o};

place at start of RAM_region    { block RAM_BLOCK };

place in RAM_region   { block Info_BLOCK };

do not initialize  { section .info, readwrite };

Posted on March 15, 2018 at 05:34

Hi Thanks for your quickly reply. In properties of project I select tab Linker - > I chose override default linker to select my External-Flash-Linker.icf file then I copy all your comment code of linker at this file. But after build project I see in the map file ''P2'':  place in [from 0x00000000 to 0x00000400] { block Info_BLOCK } is not correct. What is wrong ?0690X0000060A7kQAE.png.

0690X0000060A5SQAU.png
Posted on March 16, 2018 at 17:49

Not using IAR, created project and rebuilt in Keil

________________

Attachments :

MX25L512-STM32F769-CUSTOMBOARD.stldr.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxsv&d=%2Fa%2F0X0000000b1n%2FKzdZm_88L0F2CqOYMVgFqUzCJR6Gf.EELTr9bFDZ2fc&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 17, 2018 at 00:09

Not sure that has enough code in it to initialize the pins

Would need to know the pins in use, the external crystal speed, if present, and perhaps available USART or LEDs for debugging.

In the mean time I DID recreate the N25Q128A loader for the STM32F746G-DISCO using HAL, ST doesn't provide the example source for that because they use an SPL based library they tell everyone doesn't exist. I did some initial testing on my version and it did seem to function, but would take input from others. The Keil template from ST also didn't seem to work on uV5.23

________________

Attachments :

N25Q128A_STM32F746G_DISCO_TEST001.stldr.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxqC&d=%2Fa%2F0X0000000b1o%2Fce3lm.ema1jWLRZNEOI.vs1nLR7oQ3EVvrOedLK3yFU&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 17, 2018 at 00:35

Tested with St-Link 4.0

Error at programing:

00:32:38 : The elf loader Sector Erase function fails.

00:32:38 : Memory-Loader error

Error at Sector Erase:

00:34:06 : External memory sector 0x90000000 is not erased. Verify the memory protection.

00:34:06 : External memory sector 0x90010000 is not erased. Verify the memory protection.

The Reading is working fine

Posted on March 17, 2018 at 01:32

Interesting, I'm using ST-Link Utilities v4.2.0

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 17, 2018 at 01:45

Very very interesting. With v4.2 is it working. In the meanwhile I detected that the reading is not working for your external loader correct in 4.0 and the delivered one from ST as well not correctly!

What are the differences between v4.0 and V4.2 in Terms of external loaders?

Posted on March 17, 2018 at 02:53

So normally you use the standard MX25L512 loader for the STM32F769I-DISCO as they share a common memory and you use the same pins, and 25 MHz HSE?

The default pins get set via stm32f769i_discovery_qspi.c rather than stm32f7xx_hal_msp.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 18, 2018 at 04:41

Custom implementation using DUAL rather than QUAD mode

________________

Attachments :

N25Q128A-STM32F446-CUSTOMBOARD.stldr.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxsl&d=%2Fa%2F0X0000000b1l%2F0Mf0_umAi6to2d9.0wLqcEW.ZXTAzTa8UY9Ef0XFghE&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..