Skip to main content
RKuma.7.302
Associate II
October 15, 2019
Question

Bootloader not jumping to the application address

  • October 15, 2019
  • 4 replies
  • 1847 views

I am trying to read bin file from SD card and writing into flash memory . and trying to jump the application location.

My observation :

It is successfully writing into Flash memory.

May be it is stuck with SDIO irq.

Please can you suggest me, what could be the issue. I attached my code.

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
October 15, 2019

Turn OFF the SDIO, UART, SysTick interrupts at their source rather than disable all interrupts.

Make sure the application code relocates the Vector Table address properly, that code in SystemInit() points to the right location.

Use a debugger, review code execution, and processor/peripheral register settings.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
RKuma.7.302
Associate II
October 16, 2019

Thank you for good suggestion. I was doing the mistake on Application code , system init is setting back vector table to 0x08000000UL, Now i changed to 0x0800C000UL (my application address).

I added these two line in my main code.

HAL_UART_Abort(&huart6);  

hsd.Instance->POWER = 0x00000000U;

Bootloader_JumpToApplication();

But still have some issue. it is not jumping to the location.

RKuma.7.302
Associate II
October 16, 2019

In Debug, When tried it is stack in SDMMC_GetCmdResp2(SDIO_TypeDef *SDIOx) function.

RKuma.7.302
Associate II
October 17, 2019

uint32_t JumpAddress = *(__IO uint32_t*)(APP_ADDRESS + 4);

  pFunction Jump = (pFunction)JumpAddress;

  HAL_RCC_DeInit();

  HAL_DeInit();

  SysTick->CTRL = 0;

  SysTick->LOAD = 0;

  SysTick->VAL = 0;

#if (SET_VECTOR_TABLE)

  SCB->VTOR = APP_ADDRESS;

#endif

  __set_MSP(*(__IO uint32_t*)APP_ADDRESS);

  Jump();

It is jumping to some other location0690X00000AqURfQAN.png.