2024-06-25 10:24 AM
I want to use the uart interface from system bootloader to update the application in stm32u575.
For that I am trying to jump to the bootloader from the application. I have checked the bootloader address from an2606 document. Below is the code I am using.
#define BOOT_ADDR 0x0BF90000 // my MCU boot code base address
#define MCU_IRQS 125u // no. of NVIC IRQ inputsvoid JumpToBootloader(void)
void jumpToBootloader() {
void (*SysMemBootJump)(void) = (void*)(*((volatile uint32_t*) (BOOT_ADDR + 4U)));
__set_MSP(*(uint32_t *)BOOT_ADDR);
/* Disable all interrupts */
__disable_irq();
/* Set the clock to the default state */
HAL_UART_DeInit(&huart1);
HAL_RCC_DeInit();
HAL_DeInit();
/* Clear Interrupt Enable Register & Interrupt Pending Register */
for (uint8_t i = 0; i < (MCU_IRQS + 31u) / 32; i++)
{
NVIC->ICER[i]=0xFFFFFFFF;
NVIC->ICPR[i]=0xFFFFFFFF;
}
/* Disable Systick timer */
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
/* Re-enable all interrupts */
__enable_irq();
SysMemBootJump();
}
After this to verify I am checking in STM32CubeProgrammer, if device is detected in dfu under usb mode.
But it always shows "No DFU detected".
Can anyone help what I am doing wrong or missing?
2024-07-04 08:17 AM
2024-09-09 03:58 AM
Hi,
Any solution to this I'm currently stuck with the same issue?
Thanks.
R.C