I need to flash code into an external HyperFlash (via OctoSPI on STM32H7A3), and I wrote a new flash algorithm. Now this is not working and I need to debug it to fix the problem.
How can this be done???
Thank you for any help!
GS@S said:- When trying to adapt the template for my STM32H7A3: In the target dialog I can not select this controller.
You are right, you cannot select your device easily. Just for completeness. I can explain to you how to modify such a project. This Flash Programming test project is based on our old device database and the Cortex-M7 devices are not in there. You need to first convert the project to a uVision5 project and then you can select your device from the Device Family Packs.
GS@S said:- I have created the flash algorithm according tothe recommendation for STM32 Devices: https://www.keil.com/appnotes/files/apnt_333.pdf
- I have created the flash algorithm according tothe recommendation for STM32 Devices:
https://www.keil.com/appnotes/files/apnt_333.pdf
Glad that you found this application note. I should have recommended it to you in my first reply. It already comes close to what you need.
GS@S said:Now I found the section, which explains how to debug the algorithm, however: When entering debug mode, I can not step to main and not a single breakpoint will be reached.
Now I found the section, which explains how to debug the algorithm, however:
When entering debug mode, I can not step to main and not a single breakpoint will be reached.
I don't know what you see in your project. Did you follow the instructions at the top of page 10, especially did you use and adapt the DBG_RAM.ini file? Your Flash test application is linked to the RAM of your microcontroller. The CPU will not start from there unless you set the program counter to the start address of this application. After starting a debug session. the program counter should be set to the beginning of the startup code of this application. From there you can single step through the startup code or run to main().If you can't make it work, please open a support case and attach your project. Since you have a valid license, I will try to help you.
Yes, there is a mistake in the Dbg_RAM.ini file on page 10 of Application Note 333. Since the test application is linked to the RAM address 0x20000000 (see scatter file on page 9), the addresses in Dbg_RAM.ini should read 0x20000000 and 0x20000004 rather than 0x20020000.
Here is the correct content of this initialization file:
/*------------------------------------------------------------ Setup() configure PC & SP for RAM Debug *----------------------------------------------------------*/ FUNC void Setup (void) { SP = _RDWORD(0x20000000); // Setup Stack Pointer PC = _RDWORD(0x20000004); // Setup Program Counter _WDWORD(0xE000ED08, 0x20000000); // Setup Vector Table Offset Register } /*----------------------------------------------------------- OnResetExec() configure PC & SP after reset for RAM Debug *----------------------------------------------------------*/ FUNC void OnResetExec (void) { Setup(); } LOAD %L INCREMENTAL // load the application Setup(); // Setup for Running //g, main // uncomment to run through the startup code and stop at main()