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
Posted on March 28, 2018 at 05:54

HAL Build for the STM32F769I-DISCO checked with the STM32 Cube Programmer

________________

Attachments :

CLIVEONE-MX25L512_STM32F769I-DISCO.stldr.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxrJ&d=%2Fa%2F0X0000000b1T%2FbkRO5hd_KC9aGsKKHR41yr1RNsgoMTKzTLOg6eRzWfw&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 April 02, 2018 at 18:25

Hi, I am joining your thread. 

I am working on the loader for the custom chip. I do not have an example to follow. I just took one and cleared all code making loader functions 'empty ones'. I tried it with SL-link and it seemed to be calling functions ok. Than I added code for pins, QSPi, etc. The validation works, functions identified, but the real code fails with the messages like this:

07:09:32 : Can not read external memory!

07:13:22 : Erasing external memory Failed.

I have to note that if I created a harness with startup file, main  and a new linker file - then all callbacks are OK. I call them from main.

I am wondering if I miss some of the requirements. I am new to ST but in the past created a few flash loaders for IAR, Keil, Segger. Some of the basic questions:

1. Can interupts be used in the callbacks? From the examples I see that QSPI interrupts are enabled when the Hal is initialized.

2. How exception vectors are setup? 

3. How VTOR is defined? I see that SystemInit is called in the examples. It can relocate VTOR...

4. Can systick be used? Some of the examples use systick for timeouts.

5. From point of view of the linker file - rw is not initialized. So I do it myself with initvars in Init(). Will the value sustain when the other function called?

Thanks in the advance for help.

The map file of the working stldr would be useful. I was not able to build one.

Imen.D
ST Employee

Hello,

This issue is faced by developing your own loader with IAR version 8, apparently. This is a known issue came up with the update of IAR.

To fix the issue, you should update the Target.icf file as follow:

define symbol __ICFEDIT_region_RAM_start__ = 0x20000004;

define symbol __ICFEDIT_region_RAM_end__ = 0x21000000;

/*-Sizes-*/

define symbol __ICFEDIT_size_cstack__ = 0x400;

define memory mem with size = 4G;

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

define region Dummy_region = mem:[from 0 to 0x100];

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 in RAM_region { block RAM_BLOCK };

place in Dummy_region { block Info_BLOCK };

do not initialize { section .info, readwrite };

Kind Regards,

Imen.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

To answer some of the specific questions

1 - No, interrupts and callbacks are not supported. To get callbacks to work you'd need to pump the HAL interfaces as if you had interrupts.

2 - They are not, will typically be whatever you have in ROM/FLASH, I've hard faulted into my own existing routines and dumped telemetry/diagnostic info from there.

3 - Points at whatever, not really usable in this context and probably best left alone

4 - No, you have to make other arrangements to make this work

5 - Yeah, in Keil I use the scatter loader, ST's approach is a hack. I've also built tools to clean ELF files to meet requirements. I created an annealing tool for IAR ELF files, the .ICF above might achieve the desired effect.

I've built a number of working STLDR, such custom work will be expensive, figure minimum several man-days

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..