2024-10-06 06:04 PM
Hello,
I am using STM32U535CEU6 for my development.
I would like to transition to the bootloader using USB DFU with Boot0 pin kept Low, and the control performed within the application. I executed the following code right after HAL_Init();, but when I tried to connect STM32CubeProgrammer, it displayed "No DFU detected."
Where could the problem be?
After connecting via J-Link and checking the option bytes, the result was as follows:
nBOOT0: Checked (1)
nSWBOOT0: Checked (1)
NSBOOTADD1: 0x0BF90000
The code I tried is as follows:
{
void (*SysMemBootJump)(void); // Define function pointer
uint32_t BootAddr = 0x0BF90000; // Bootloader address
// Get the address of the bootloader's reset handler
SysMemBootJump = (void (*)(void)) (*((uint32_t *) (BootAddr + 4)));
// Disable interrupts
__disable_irq();
// Reset all peripherals
HAL_RCC_DeInit();
// Set the stack pointer
__set_MSP(*(uint32_t *) BootAddr);
// Jump to the bootloader
SysMemBootJump();
}
Any advice please?
Solved! Go to Solution.
2024-10-06 06:35 PM
> __disable_irq();
This disables all interrupts. The USB bootloader requires interrupts be enabled. If you have other interrupts or peripherals active, they may need to be deactivated first.
See example working jump to bootloader code here:
How to jump to system bootloader from application ... - STMicroelectronics Community
2024-10-06 06:35 PM
> __disable_irq();
This disables all interrupts. The USB bootloader requires interrupts be enabled. If you have other interrupts or peripherals active, they may need to be deactivated first.
See example working jump to bootloader code here:
How to jump to system bootloader from application ... - STMicroelectronics Community