2023-04-24 10:44 PM - edited 2023-11-20 07:14 AM
Recently I'm using STM32G051 and try to write flash via i2c bootloader.
Below are my steps:
I've checked all read/write protection are disabled via STM32Programmer, and I can access read flash and erase flash successfully, only write process fail. Is any one have encounter similar issue and tell me if my procedure is not correct?
Many thanks.
2023-04-25 01:07 AM - edited 2023-11-20 07:14 AM
Hi,
flash memory start form address 0x0800 0000 not 0x0008 0000. You passed addres that is marked as reserved.
2023-04-25 01:20 AM
Hi Kamil,
Sorry for my typo, I've written the start address with 0x08000000 and the XOR checksum (0x08)
And still have the issue.
Thanks.
YenLu
2023-04-25 02:24 AM - edited 2023-11-20 07:14 AM
Ok :) Next question, were you send bootloader address ? in application note i see other adressess than yours. What is this sequention 0x32 0xcd?
2023-04-25 05:51 AM - edited 2023-11-20 07:14 AM
Hi Kamil,
I omitted the i2c address byte when I described the step above. I've read/write the address 0x62 and everything is fine until waiting the ack response for data written. The sequence (0x32, 0xcd) is No-Stretch Write Memory command which is described in AN4221:
2023-04-27 01:45 AM
@YLU.2 did you resolve problem?
2023-04-27 08:25 PM
Yes,
for 8 byte write, I should send 0x07, 0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88, 0x8f
after correct the format, I get ack and write the memory successfully.