embeddedbootloadercortex-mfirmwareiar

Cortex M3 jump from application back to bootloader and back to application


I have a bootloader and a firmware where the initial jump from bootloader to firmware works like a charme but when I have the scenario jumping back from application, make some stuff and jump back to my application. There I got some curious problem which ends in a hard fault. This problem comes up if I will activate the interrupts via __enable_interrupts() from IAR.

What are the right register to clear and reset all? I have set the MSP and the PC to the beginning of the application/bootloader.

It is neccessary that I don't use NVIC_Systemreset for that purpose.

Hope anyone can help me with that question?


Solution

  • sorry for late response.

    After some more investigations I have found the problems. For more clarifications about what I have done, here are some points which were also mentioned by your comments.

    What I unfortunately forgot to mention that we use embOS. And this was the problem here. There is the CORE registers http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/CHDBIBGJ.html

    In the CONTROL Register there was a bit set: SPSEL If this bit is set to "1" then embOS got problems with normal operation. The solution for this is simple:

    __set_CONTROL(0x0);

    When this is called the jumping from embOS to Bootloader and back to embOS works perfectly.