cancel
Showing results for 
Search instead for 
Did you mean: 

Facing difficulty to access internal bootloader in STM32H743BIT6

AMull.11
Associate II

Hi Guys,

I working on one project where we need to enter into system bootloader for updating new firmware through the UART from software without using BOOT0 Pin.

But I am facing problem in entering bootloader through software(user application).

I had created function to enter bootloader.

I am successfully entering into system bootloader when I directly call the JumpToSystemBootLoader() ,but when I call through HAL_UART_RxCpltCallback I don't see any response from the bootloader (getting error in STM32CubeProg). 

void JumpToSystemBootLoader (void)

{

   void (*JumpToSysBoot)(void); /* declare a function pointer */

__IO uint32_t sys_boot_address = 0; 

uint8_t indx = 0;

sys_boot_address = 0x1FF09800;/* STM32H7 system BootLoader address */

/* Disable all enabled interrupts in NVIC and Clear all pending interrupt requests in NVIC */

for (indx = 0; indx < 8; indx++)

  {

NVIC->ICER[indx] = 0xFFFFFFFF;

     NVIC->ICPR[indx] = 0xFFFFFFFF;

/* Disable all enabled peripherals, use HSI clock */

  HAL_RCC_DeInit();

/* Disable all interrupts */

  __set_PRIMASK(1); 

/* Disable SysTick */

SysTick->CTRL = 0;

 SysTick->LOAD = 0;

 SysTick->VAL = 0;

/* Enable all interrupts */

__set_PRIMASK(0);

JumpToSysBoot = (void (*)(void)) (*((uint32_t *) (sys_boot_address + 4)));

/* Activate the MSP */

 __set_MSP(*(uint32_t *)sys_boot_address);

__set_CONTROL(0);

/* Jump to the system BootLoader */

 JumpToSysBoot(); 

/* It will not execute if jump is successful*/

  while (1)

{

 __NOP();

}

}

Method 1: In this below method, successfully connecting with UART and updating new firmware

int main(void)

{

 while (1)

  {

HAL_UART_Receive(&huart1, (uint8_t*)RxBuffer, 2, 200);

/*If KEY matches with RXBuffer then enter into System bootloader*/

(strcmp(KEY, RxBuffer) == 0)

{

HAL_UART_Transmit(&huart1, (uint8_t*)TxBuffer, strlen(TxBuffer),200);

  JumpToSystemBootLoader();

}

}

}

Method 2: In this below method, didn't getting any response from System bootloader

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)

{

  if (strcmp(BOOT_MODE, RxBuffer) == 0)

{

__HAL_UART_DISABLE_IT(&huart1, UART_IT_RXNE);

HAL_UART_Transmit(&huart1, (uint8_t*)TxBuffer, strlen(TxBuffer),200);

JumpToSystemBootLoader();

}

}

int main(void)

{

__HAL_UART_ENABLE_IT(&huart1, UART_IT_RXNE);

HAL_UART_Receive_IT(&huart1, (uint8_t*)RxBuffer, 2);

 while (1)

  {

}

}

Thank You

2 REPLIES 2
Uwe Bonnes
Principal II

There have been many discussions and proposals for solution in this forum before. Did you scan those posts?

AMull.11
Associate II

Yeah but I didn't understand properly.

Can you explain me how to solve this issue.

Thank You