Other Parts Discussed in Thread: C2000WARE
Hi team,
Here's some questions from the customer may need your help:
The F021 library version is 1.54 and has the capability to erase and reprogram certain sectors in the firmware for parameter saving, firmware upgrades, etc.
The current phenomenon is that using CCS to load the .out file and run it directly, FLASH erase programming is fine.
The same engineering of the same cmd and out files, once loaded using CCS and then powered back on by unplugging the emulator, the FLASH state becomes either unerasable or unprogrammable.
Check the return value of Fapi_getFsmStatus after erase, erase empty Sector returns 0x0810, erase unless empty Sector returns 0x0C10 according to FMSTAT Register Description: Spruhm9f document section 3.15.21.6
Three bits involving FMSTAT:
- bit11 is reserved in documents A
- bit10 EV indicates an error with the erase
- Bit4 CSTAT indicates an error executing the command
The FLASH register in two cases:
```
#The FLASH control register is not erased when the FLASH is not erased by power-up again
0x05F800 0200 0000 0000 0000 0000 0000 0000 0000
0x05F808 0000 0000 0000 0000 0000 0000 0000 0000
0x05F810 0000 0000 0000 0000 0000 0000 0000 0000
0x05F818 0000 0000 0000 0000 0000 0000 000F 0000
0x05F820 0003 0000 8001 0000 0001 0860 0000 0000
0x05F828 0000 0000 0000 0000 0000 0000 0000 0000
0x05F830 00FC 0000 55AA 0000 0000 0000 0000 0000
0x05F838 0000 0000 0000 0000 0000 0000 0000 0000
0x05F840 000B 0000 0055 00EB 0000 00DB 0000 000F
0x05F848 0716 0000 A000 0000 0004 0000 010A 0700
#Flash control register when CCS loads normal erase
0x05F800 0200 0000 0000 0000 0000 0000 0000 0000
0x05F808 0000 0000 0000 0000 0000 0000 0000 0000
0x05F810 0000 0000 0000 0000 0000 0000 0000 0000
0x05F818 0000 0000 0000 0000 0000 0000 000F 0000
0x05F820 0003 0000 8001 0000 0001 0860 0000 0000
0x05F828 0000 0000 0000 0000 0000 0000 0000 0000
0x05F830 00FC 0000 0000 0000 0000 0000 0000 0000
0x05F838 0000 0000 0000 0000 0000 0000 0000 0000
0x05F840 000B 0000 008C 01E9 0000 01BE 0000 0000
0x05F848 071B 0000 9000 0000 0004 0000 010A 0700
```
The registers listed in the document do not have any obvious errors, but there are some different addresses that are not described in the document. The customer would like to know how to further diagnose this problem?
FlashAPI and other FLASH-related code are in SRAM, only FLASH does not erase programming properly after power-up, and other firmware functions are fine, including FLASH reads. Before using F28075, the same code was used on the F280049 without any problems. This time just replaced the FlashAPI, which is very similar but not exactly the same.
Could you help check this case? Thanks.
Best Regards,
Cherry
