AnsweredAssumed Answered

STM32F407 startup/boot problem

Question asked by Sitnikov.Vjacheslav on Sep 7, 2016
Latest reply on Sep 7, 2016 by Clive One
My software project has 2 parts:
- bootloader located at 0x08000000;
- application located at 0x08008000.
After reset bootloader is started and check CAN network - if there is activity it can reload application. Also I use NVIC_SystemReset() function to switch from bootloader to applicatyion, and from application to bootloder.
In Application, if I want to load new program used function:

void EnterProgramMode( void )
{
  __disable_irq();
  *(uint32_t*)CheckAddress = 0xAAAAAAAA;
  __asm volatile ("nop");
  NVIC_SystemReset();
}


In bootloder, if I want start application:

void StartApplication(void)
{
  __disable_irq();
  *(unsigned long*)CheckAddress = 0;
  __asm volatile ("nop");
  NVIC_SystemReset();
}

So after system reset bootloder can check CheckAddress value and decide what it need to do: run application (if it has 0xAAAAAAAA) or load program (if 0).
But I have a problem in bootloder.
While debugging if I set breakpoint at any line of StartApplication-function - all fine. After  CPU resets and stopes at breakpoint in Reset_Handler function. But if I remove (or diable) breakpoint in StartApplication-function - reset occured but program goes to 0x1FFF0000 area. It seems like after startup "Boot from system memory" mode were selected.
But Boot1-pin connected to GND, Boot0-pin pulled-down over 10k resistor, XP6 jumper removed (see attached picture). I tried to check Boot0-pin with oscilloscope and it is 0 every time.
pic.png
If I stop programm execution while in system memory and check SYSCFG_MEMRMP it contains 0, i.e. 00: Main Flash memory mapped at 0x0000 0000.
I don't understand why this is happening. 
Can anybody help me?  Perhaps someone faced with such behavior.

Attachments

Outcomes