2020-09-07 01:26 AM
Hello, I build program to store data in external QSPI flash memory using STM32Cube programmer and generated .stldr file but as soon as I place same file to bin external loader folder (STM32Cube\STM32CubeProgrammer\bin\ExternalLoader), STM32Cube programmer IDE wouldn't open. I not able to find the reason. Any suggestions?
Attaching my project.
Thanks
2020-09-15 06:23 AM
Hi Cbhat.1675,
I think you mean here you used CubeIDE to build the program and not the STM32Cube programmer?
To explain why STM32Cube programmer IDE wouldn't open after you place .stldr in it is probably because the the generated .stldr has a bug in it's format that wasn't compatible with STM32Cube programmer. This means there could be a problem with the project structure (drivers, framework, includes etc...)
Sorry I couldn't detect the problem with your project as I am more familiar with IAR structure for external loaders, but I advice you to re-create the project and try to follow another example of a project for an external loader created with cubeIDE to make sure you have the correct structure in order for the .stldr to be integrated successfully in CubeProgrammer.
I hope this help!
-Imen
2020-09-15 06:29 AM
Thanks for reply, Actually i tried with 4 different projects but still got same problem. Unable to figure out issue.
Would you mind sharing your IAR project ? I can migrate same code to my IDE and check.
2020-09-15 10:38 PM
HI @Imen Ezzine , I am looking to find solution from kind of long time. Would be great if you can help me out.
2020-09-16 07:25 AM
Sorry for late reply!
I did try to send you some support via inbox so let me know if that helps.
Another advise is you can take a look at the STM32CubeF7 and either use the bsp driver (it contains the needed functions to manipulate external memory) or get inspired by the declared BSP example for stm32F746 (since it is the board you work with).
Good luck!
-Imen
2020-09-16 07:34 AM
I thought I'd looked at this, but it was apparently a different poster.
2020-09-16 07:53 AM
@Community member please check if u can find any issue with my code.
2020-09-16 08:08 AM
Also Post compiling and linking I am changing extension *.elf to *.stldr directly, Is this correct ?
2020-09-16 09:34 AM
Correct, but the .ELF needs to be of a certain form, with specific addresses/attributes.
Understand that I'm not paid by ST, or anyone else's employer, so I can't spend significant time root-causing others issues.
I will observe that static initialization are not handled well in this implementation, and there is unnecessary use of the IRQs and vector table.
I would probably fix the initialization code in startup.s, and call the constructor initialization, to ensure the C runtime environment is a expected.
2020-09-16 10:09 AM
Make sure you're using the most current STM32 Cube Programmer.
Do NOT install under normal "Program Files" directory, install under a real directory, for which you have user rights too.
Tried with 2.4.0, the application didn't load, the .STLDR only exported the Init function, it lacks the SectorErase, Write functions.
Looks to do dead-code elimination despite the KeepInCompilation directives.
Suggest adding to main.c
#include "Loader_Src.h"
and within main() add the lines:
SectorErase(0, 0);
Write(0, 0, NULL);
Verify(0, 0, 0, 0);
@Imen Ezzine @Houda GHABRI @Nawres GHARBI Please review how STM32 Cube Programmer scans the *.stldr, and have better error handling when functions like SectorErase and Write are missing from the external loader. Acceptable behaviour would be to IGNORE the loader, not for the application to entirely unload and not start silently.