Skip to main content
Explorer
October 7, 2024
Solved

About STM32U535CEU6 Bootloader

  • October 7, 2024
  • 1 reply
  • 685 views

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?

 

    This topic has been closed for replies.
    Best answer by TDK

    > __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

    1 reply

    TDKAnswer
    Super User
    October 7, 2024

    > __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