2023-07-15 09:34 PM
Hi,
I have a custom board using STM32G431CBU6. I am using `dfu-util` to upload firmware and option bytes. I don't have any problem reading/writing flash area with DFU, and I can read the Option Bytes area with DFU, but when I try to upload a valid option bytes file, I get an error that it can't write the last page. I know the file is valid because it was dumped from another board that had option bytes configured by STM32CubeProg.
The reference for the chip mentions that in order to write Option Bytes that there is a pattern and some registers that have to be addressed. Some questions on that:
The error given by dfu-util:
DfuSe interface name: "Option Bytes "
Downloading element to address = 0x1fff7800, size = 48
dfu-util: Last page at 0x1fff782f is not writeable
Thanks,
Matei
2023-07-15 10:08 PM
Nevermind, it seems that there could be some error in the G431 reference. If I just let `dfu-util` read to end of region at 0x1fff7800, it will only produce 40 kbytes rather than the stated 48kbyte. I can read and write this file just fine, there are no problems.