AnsweredAssumed Answered

STM32F4xx Rebooting to bootloader when setup to boot to App.

Question asked by smith.garry on Jun 22, 2015
Latest reply on Jun 23, 2015 by smith.garry
I have a F4 chip that calls ,    The function initiates a system reset request to reset the MCU.

__STATIC_INLINE void NVIC_SystemReset(void)
{
  __DSB();                                                     /* Ensure all outstanding memory accesses included
                                                                  buffered write are completed before reset */
  SCB->AIRCR  = ((0x5FA << SCB_AIRCR_VECTKEY_Pos)      |
                 (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
                 SCB_AIRCR_SYSRESETREQ_Msk);                   /* Keep priority group unchanged */
  __DSB();                                                     /* Ensure completion of memory access */
  while(1);                                                    /* wait until reset */
}

with MEMRM = 0. - should map Flash to 0x0000, thus rebooting into my App.
However, the ST bootloader is called at (0 +4) = 0x1fff5163 (stbootloader).
This then trashes the SRAM value that is placed there to provide information to the App for the reason there was a reset. The STbootloader is using the SRAM as scratch pad.

My app is called by the STbloader but the RAM is now full of left overs.

Is my re-maping correct or am I missing something else. (BOOT0 is pulled low).

thanks in advance,
  Garry. 

Outcomes