This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can I debug a new flash algorithm which is not working yet?

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!

Parents
  • - 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.

    • - Project - Manage - Migrate to Version 5 Format
    • - Open the dialog 'Options for Target' and select the tab 'Device'. Now you should be able to select your device because now you see all the devices from the Device Family Packs.

    - 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.

    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.

Reply
  • - 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.

    • - Project - Manage - Migrate to Version 5 Format
    • - Open the dialog 'Options for Target' and select the tab 'Device'. Now you should be able to select your device because now you see all the devices from the Device Family Packs.

    - 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.

    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.

Children