Issue: Receiving NACK During STM32G0B1KEU6 Page Erase over I²C in Bootloader Mode
Context:
I am working with an STM32G0B1KEU6 microcontroller in bootloader mode over I²C and attempting to perform a flash page erase. The erase command is consistently receiving a NACK (negative acknowledgment) from the bootloader.
Page Erase Command:
- Sent the page erase command (0x45), followed by the number of pages to erase (N - 1) and the page numbers.
Observed Behavior:
- I receive an ACK after page erase command and number of pages command, but when I send the erase command the bootloader responds with a NACK.
- The flash is not busy but the erase still fails to proceed.
Example 1: Erase Pages 1 and 2
Page Erase Command (0x45):
- Command sent: 0x45 0xBA (0x45 is the erase command, and 0xBA is the checksum)
- Result: ACK received
Number of Pages (N - 1):
- Sent: 0x00 0x01 0x01 (Erase 1 + 1 pages, followed by the checksum 0x01)
- Result: ACK received
Page Numbers:
- Sent: 0x00 0x01 0x00 0x02 0x03 (Erase page 1 and page 2, followed by checksum 0x03)
- Result: NACK received after sending the page numbers
Observed Behavior: Although the erase command and number of pages command are acknowledged, the bootloader responds with a NACK when the page numbers are sent.
Example 2: Erase Pages 3 and 4
Page Erase Command (0x45):
- Command sent: 0x45 0xBA (0x45 is the erase command, and 0xBA is the checksum)
- Result: ACK received
Number of Pages (N - 1):
- Sent: 0x00 0x01 0x01 (Erase 1 + 1 pages, followed by the checksum 0x01)
- Result: ACK received
Page Numbers:
- Sent: 0x00 0x03 0x00 0x04 0x07 (Erase page 3 and page 4, followed by checksum 0x07)
- Result: NACK received after sending the page numbers
Observed Behavior: Similar to the first example, the page erase command and number of pages are acknowledged, but a NACK is received when the actual page numbers are transmitted.