Hi Daniel,
Sorry for late reply.
Sorry for making confuse.
if programmer write the 0x7F/0x7D at address 0x40D (flash), the programmer reads the all 0xFF at address 0x400 ~ flash end address after power cycle. if programmer write the 0xFF at address 0x40D (flash), the programmer can read correct content from whole flash.
We use IAP method with SWD during programming, and these is the programming procedure.
Step 1. Power on
Step 2. Read SWD ID
Step 3. Execute erase command via SWD
Step 4. Load IAP code to RAM and booted.
Step 5. Send the data to IAP to write it to chip.
Step 6. Read data from chip to do verify via SWD.
Step 7. Power off
Our engineer even tried to use SWD with no IAP, and the situation is same.
We made the IAP code is refer to IAR sample code.
There is my questions.
1. Do we need to set up the register in the initialize procedure or program procedure?
2. Do we need to set up the register in the IAP code?
3. Or could you help to provide the IAP code and how to communicate it for programming.
Thank you.