AnsweredAssumed Answered

How can I use FLASHERDEMO.EXE using INTERNAL SYSTEM BOOTLOADER ?

Question asked by gaurav sharma on Mar 21, 2018

I am using STM32L073RZ . I want to use UART as a bootloader .Please provide me the code which invoke internal bootloader so that I can flash the micro using flasherdemo.exe (a tool provided by ST).Thanks for help.

Here is a sample code that I have writed but not working.

 

#define SYSMEM_ADDRESS  (uint32_t)0x1FFF0000 

void Bootloader_JumpToSysMem(void)
{
   uint32_t JumpAddress = *(__IO uint32_t*)(SYSMEM_ADDRESS + 4);
   pFunction Jump = (pFunction)JumpAddress;
   HAL_NVIC_DisableIRQ(USARTX_IRQn);
   HAL_UART_DeInit(&UartHandle);
   HAL_RCC_DeInit();
   HAL_DeInit();

   SysTick->CTRL = 0;
   SysTick->LOAD = 0;
   SysTick->VAL = 0;

   __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();

   __set_MSP(*(__IO uint32_t*)SYSMEM_ADDRESS);
   Jump();
   // HAL_GPIO_TogglePin(LED2_GPIO_PORT, LED2_PIN);
   while(1);
}

Outcomes