Skip to main content
ranran
Senior
March 7, 2019
Solved

IAR "download and debug" reset registers ?

  • March 7, 2019
  • 1 reply
  • 1025 views

Hello,

I am using a Bootloader which jump to operational application.

the Bootloader configures SRAM, so that operational does not need to do it again.

Bootloader is baremetal , and operational is freeRTOS.

I use IAR.

Everything works well if I reset the board, and "Attach debugger to running application".

But If I try to: reset board and debug&download the operational application it hangs. It seems that the problem is that on debug&downloading the application all FMC register are set to zeros.

But I don't understand who is responsible for setting registers to zero. where in IAR did I configure such reset of registers ?

 I did not find anything in IAR debugger configuration which explains me this reset of registers values (which were set in bootloader).

Thanks for any idea,

ranran

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    The debugger is entirely short circuiting the boot loader operation, and places the start of execution at the front of the app. The debugger likely resets the processor as a means to gain control, it doesn't know you've created external dependencies.

    The app could detect this, and execute some code to bring up the FMC properly, perhaps via a clean entry point function in the loader if you don't want to replicate the code, or you could code a debugger script file to poke the registers

    1 reply

    Tesla DeLorean
    Tesla DeLoreanBest answer
    Guru
    March 7, 2019

    The debugger is entirely short circuiting the boot loader operation, and places the start of execution at the front of the app. The debugger likely resets the processor as a means to gain control, it doesn't know you've created external dependencies.

    The app could detect this, and execute some code to bring up the FMC properly, perhaps via a clean entry point function in the loader if you don't want to replicate the code, or you could code a debugger script file to poke the registers

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