2025-01-29 02:02 AM
Dear All,
I am having difficulty with the Bootloader on an STM32469.
It is on a custom PCB (which works fine in all other respects), and I can use the SWD interface via J-Link perfectly OK (with both STM32CubeIDE and STM32CubeProgrammer).
My starting point is a board where the Readout Protection was set to Level 1. Note that this is true for all hardware I have access to, so I cannot try with a board that has never had Readout Protection applied.
I can reset the Readout Protection to Level 0 (0xAA) via J-Link. This erases Flash (expected behaviour).
I can check the FLASH peripheral registers via STM32CubeProg, and they all look OK.
I would now expect to be able to connect via UART with STM32CubeProgrammer.
However, when I reset my board with BOOT0 set high, and attempt to connect via UART, I get this:
I also get four popup error boxes:
1. Initialising the Option Bytes failed
2. Uploading Option Bytes bank 0 failed
3. READ command not acknowledged at address: 0x1fffc000
4. READ command not acknowledged at address: 0x1fffx008
You can see from the above dump that the Bootloader is operational and connected, but is not responding correctly.
I have verified this process on a NUCLEO-F401RE board to check my expectations are correct, and everything works as expected.
Please help.
Thanks,
Chris.
2025-01-31 02:08 AM
2025-02-03 12:38 AM
Hi Imen,
Thank you for your reply.
As far as I know, I have configured boot mode selection correctly:
I have grounded BOOT1:
BOOT0 is connected to an external interface:
And to enter the Bootloader, I simply apply 3.3V to BOOT0 and reset the target.
I know it must be in Bootloader mode because you can see it correctly in the STM32CubeProg trace above as Chip ID: 0x434 which I believe has been read from the target?
My theory is that the Bootloader incorrectly believes the Readout Protection to be active?
What do you think?
Thank you.
Chris.
2025-02-04 07:57 AM
OK, so I just tried it on a brand new PCB, brand new STM32. Never been programmed, so factory fresh:
Exactly the same problem - the bootloader is rejecting the GetID with a NACK...
Chris.
2025-02-04 12:50 PM
Replying to my own topic!
I think I know what is going on here:
I analysed the serial comms, and there was an additional 0x7f at the start. So the sequence was
PC->Target = 0x7f
Target->PC = 0x79 ACK
PC->Target = 0x7f - THIS IS SPURIOUS
Target->PC = 0x1f NACK
After this, it all falls over. There are also some badly framed bytes being sent by the PC.
I checked with an Nucleo-F429 that I had lying around, which worked correctly.
I checked logic levels and signal integrity with the oscilloscope, everything looked perfect.
Eventually I switched the USB-RS232 converter from an MCP2200 (Microchip) to a CP2101 (SiLabs), and everything seems to be working (as far as I have tested it - it's getting late!). I can connect, maintain a connection, perform a mass erase and download an image.
So it seems there's some weird incompatibility between Windows 11, the MCP2200 driver and STM32CubeProg.
Note I have been using the MCP2200 for normal serial comms with no issues at all, so it's probably an STM32CubeProg / Java bug.
I'll test the Readout Protection in due course.
Chris.