cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Bootloader over USART with pin swapping

JMill.1
Associate III

Hello All,

Using STM32H743, I designed a board to use USART1 as the debug interface so that I could also bootload to this port. I am using an FTDI chip to create a virtual COM port. The problem is that I swapped the TX/RX pins in the design and had to enable pin-swapping in the .ioc file to fix the issue. It works as a debug interface, but won't connect via STM32CubeProgrammer. I get the following error:

 11:17:23 : Timeout error occured while waiting for acknowledgement.

 11:17:23 : Timeout error occured while waiting for acknowledgement.

 11:17:23 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...

I am trying to determine if the pin swapping is the problem, or if there are some other options that are messing up the connection. Is it possible to use the bootloader through USART1 if pin swapping is enabled?

4 REPLIES 4

The built-in bootloader is not aware of configuration in your program. The function of pins used by bootloader is fixed and is given in AN2606.

JW

JMill.1
Associate III

Thanks for the quick response. I was afraid this is the case. Per Figure 57 in that app note, it says that if the pattern is received, Disable interrupts and interface clocks, then configure USARTx. I guess this means that the SWAP bit will be cleared and TX/RX pins will resume their normal assignments? Which would mean the USART would stop working due to miswiring to the FTDI chip.

0693W00000HpyhkQAB.png Is there any way to make the SWAP bit sticky? Or am I now forced to either 1) cut and jump the traces, 2) respin the board, or 3) write my own bootloader?

Thanks,

Jamie

TDK
Guru

You can set the SWAP bit, jump to the bootloader, and see if it works. I would be surprised if it does. I believe the initial signal detection is done with the pin in GPIO mode.

But even then, the behavior you want would not be guaranteed by AN2606.

If you feel a post has answered your question, please click "Accept as Solution".

I'd vote for 3).

JW