Skip to main content
FrankNatoli
Associate III
August 31, 2023
Question

STM32G030K6T6 fails to respond to bootloader I2C, revised

  • August 31, 2023
  • 3 replies
  • 4834 views

Have STM32G030K6T6 system that in bootloader mode fails to respond to I2C.
Am asserting BOOT0 pin 25, negating NRST pin 6, wait 500ms, asserting NRST pin 6, wait three seconds, then attempt to send MCU erase packet to I2C1 device address 0x56 but get NACK
DSLogic Analyzer shows good I2C write to 0x56 but NACK in response, see attached screenshot.
Was originally writing to 0x57, which was correct for earlier implementation for STM32H7B3I, but TDK noted that the correct address for STM32G030K6T6 is 0x56, and that succeeded, i.e., erasing flash and writing flash, exactly once.
Second and all subsequent times attempted, 0x56 is NACK-ed.
Could original "success" have corrupted MCU bootloader code?

This topic has been closed for replies.

3 replies

FrankNatoli
Associate III
August 31, 2023

See attached screenshot.

Tesla DeLorean
Guru
August 31, 2023

Prior thread  https://community.st.com/t5/other-tools-mcu/stm32g030k6t6-fails-to-respond-to-bootloader-i2c/td-p/586647

>>Could original "success" have corrupted MCU bootloader code?

No, but depending on how the device boots and the state of the Flash, it could try to execute your code rather than the loader. Erase the user firmware, and see if the original behaviour returns after a power cycle.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
FrankNatoli
Associate III
August 31, 2023

"Erase the user firmware, and see if the original behaviour returns after a power cycle."
I don't think that's possible.
The board with the STM32G030K6T6 does not have a J-tag or STM programming connectors.
The only way to erase/program the user firmware is via MCU bootloader, which appears non-functional after one time success.
Have revised the master code to repeat attempts to write to 0x56, but every attempt is NACK-ed and throws HAL_I2C_ErrorCallback.

Tesla DeLorean
Guru
August 31, 2023

>>The board with the STM32G030K6T6 does not have a J-tag or STM programming connectors.

That sounds like that will be a joy to work with/on. Could you have not had something out the side of the board or as a break-off piece?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
TDK
Super User
August 31, 2023

Only possibility I can see is if your user code changed option bytes to ignore the BOOT0 pin.

Otherwise, system bootloader is in ROM, can't change that, and the startup sequence is similarly hard coded.

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