Skip to main content
Visitor II
November 18, 2021
Solved

STM32F746VGT6 bootloader jump fail to auto detect USART baudrate

  • November 18, 2021
  • 4 replies
  • 2010 views

Hi,

I'm having some strange issues trying to update F7 MCU via USART with stm32loader.

The MCU jumps to bootloader from software and enter DFU mode, the USART is detected, however, the auto baudrate detects 1200 bps instead of 115200.

I've made some tests, and if I reset the system before USB init (in order to jump to bootloader) it detects the baudrate most of the times (not all of the times).

Following AN2606 document, STM32F74xxx known limitations, I've tried to decrease the baudrate to 9600, but it still detects 1200.

Manually setting BOOT0 to high (using a button) works perfectly, but I need it to work using software.

Regards,

Nitzan

    This topic has been closed for replies.
    Best answer by Nchen.1

    Thanks for the help, problem solved

    Bootloader jump was called from a function which was after the beginning of the code instead of the beginning of SystemInit().

    This made the undefined behavior on bootloader.

    4 replies

    Super User
    November 18, 2021

    Are you sure the line isn't being toggled during reset? Put a logic analyzer on it and verify.

    Nchen.1Author
    Visitor II
    November 18, 2021

    Which line are you referring to? The USART line or the BOOT0 line?

    Super User
    November 18, 2021

    USART_RX

    Edit:

    If you verify the signal is correct, then there must be something different about your configuration at the time you jump to the bootloader compared to the as-reset state. Setting a magic value in SRAM, resetting the chip, and jumping to the bootloader immediately if you detect that value (before any initialization) can avoid this issue.

    Graduate II
    November 18, 2021

    Best to construct a method which resets and then immediately enters the system boot loader, from your own Reset_Handler, and before you've reconfigured, pins, clocks, PLL, peripherals, interrupts, etc.

    Nchen.1Author
    Visitor II
    November 18, 2021

    I’m using this method and yet, the bootloader usart configuration for auto baud rate detection seems to be the issue. I see an ACK transmitted in 1200 baud rate instead of 9600

    is there any register that could affect the baud rate detection for the boot loader?

    Super User
    November 18, 2021

    It doesn't check out that jumping to the bootloader directly after reset causes it to behave differently that jumping to it via BOOT0 pin. The chip is in the same state, and the processor behaves deterministically. Recheck your assumptions.

    > is there any register that could affect the baud rate detection for the boot loader?

    Even if there was, registers are reset upon reset.

    Visitor II
    November 19, 2021

    Is there any reset function than calling NVIC_Reset? Perhaps the reset process itself isn’t accurate and not everything is reset?

    Nchen.1AuthorAnswer
    Visitor II
    November 21, 2021

    Thanks for the help, problem solved

    Bootloader jump was called from a function which was after the beginning of the code instead of the beginning of SystemInit().

    This made the undefined behavior on bootloader.