cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F04 bootloader in TSSOP20 package

DiamondPaws
Associate

I'm working on a design that involves using an STM32F04 acting as a USB-CDC to RS232 bridge to communicate with the main logic of the system, in preference to dedicated RS232 USB chips that require dedicated drivers. In addition to this, the STM32 is also driving an I2C device and bridging it over SPI to the main logic. All of this works well. The I2C is also connected both to the CPU and the main logic, though the main logic does nothing with this interface normally, but allows me to test the issue below.

When I came to investigate having the main logic update the firmware of the STM32, I identified an issue - though I was able to boot the STM32 into its ROM bootloader, I can't actually access it - it doesn't respond on the I2C or the UART.

Having consulted AN2606, it lists the following ports as used by the bootloader in the STM32F04:

- PA11 (USB-)
- PA12 (USB+)
- PA9 (USART1 TX)
- PA10 (USART1 RX)
- PA14 (USART2 TX)
- PA15 (USART2 RX)
- PB7 (I2C1_SD)
- PB6 (I2C1_SCL)
However, the TSSOP20 package for the STM32F04 doesn't expose PB6, PB7 or PA15, and though it does expose PA10 and PA9 (for USART1), these pins are replaced by PA11 and PA12 when USB is enabled, so they're effectively unavailable too. I can confirm USB DFU works fine.

The chip does also offer USART2 on PA2/PA3 and I2C1 on PF0/PF1, but these are the ports I'm trying unsuccessfully. Does this mean that as per AN2606, these pins are not enabled by the bootloader for those functions? And as such, the only interface on the TSSOP20 package available for the ROM bootloader is the USB port?

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @DiamondPaws and welcome to the ST Community .

The USART1, USART2,I2C1 and USB DFU are available for Bootloader only throw the Pins mentioned on the Table 19 of the AN2606:

STTwo32_0-1725605841429.png

You can't use the same interface for bootloader but with other Pins. So, if the pins mentioned on the Application note are not available on the package you are using, then you can't use this IP. In your Case, the Open Bootloader may be a good solution. take a look here for more details.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
STTwo-32
ST Employee

Hello @DiamondPaws and welcome to the ST Community .

The USART1, USART2,I2C1 and USB DFU are available for Bootloader only throw the Pins mentioned on the Table 19 of the AN2606:

STTwo32_0-1725605841429.png

You can't use the same interface for bootloader but with other Pins. So, if the pins mentioned on the Application note are not available on the package you are using, then you can't use this IP. In your Case, the Open Bootloader may be a good solution. take a look here for more details.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Perfect, thank you for confirming! Yes, I'll now investigate if there's a drop-in solution or even just roll my own RAM-based update mechanism to work around this issue