2021-12-28 08:19 AM
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?
2021-12-28 08:46 AM
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
2021-12-28 09:15 AM
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.
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
2021-12-28 10:39 AM
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.
2021-12-29 03:50 AM
I'd vote for 3).
JW