This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi team,
Here's an issue from the customer may need your help:
M3 core program prog.bin (C2000 does not start), program function is to erase all flash, re-download prog.bin over the web, and then burn back flash.
Issues:
1. Connect the emulator (xds560v2) to run the program, download, erase, and rewrite are done as normal (as seen by the memory browser), and the data export is checked after completion, no difference from prog.bin. Reset with "reset" and "restart" button in CCS 6.2 DEBUG interface, repeated download re-burn function failed, interrupt point found that Fapi_issueAsyncCommandWithAddress run was successful. But the corresponding region was not erased successfully.
2. After downloading the program, directly power-down the emulator but the chip erase fails either. The customer suspects it's also a Fapi_issueAsyncCommandWithAddress implementation issue.
Could you help check this case? Thanks.
Best Regards,
Cherry
Hi Cherry,
Reset with "reset" and "restart" button in CCS 6.2 DEBUG interface, repeated download re-burn function failed, interrupt point found that Fapi_issueAsyncCommandWithAddress run was successful. But the corresponding region was not erased successfully.
What is the download and re-burn process described here? Is the F28M35H52C device running a bootloader or is everything done over the xds560v2 emulator interface?
2. After downloading the program, directly power-down the emulator but the chip erase fails either. The customer suspects it's also a Fapi_issueAsyncCommandWithAddress implementation issue.
Can you further explain this process as well? What is meant by powering down the emulator?
Best,
Kevin
Hi Kevin,
Thanks for your support.
What is the download and re-burn process described here?
After the first burn, the emulator is not removed, reset directly with the reset and restart buttons on the CCS debug interface, download the firmware again over the web, and burn.
Can you further explain this process as well? What is meant by powering down the emulator?
Run the board off the emulator after it has burned the program with the emulator. Then download the firmware online and burn it.
Also, after running Fapi_issueAsyncCommandWithAddress() failed, checked the FSM_STAT register and found an error "SLOCK error", dose that mean sector lock or OTP lock? Then how to unlock it?
Thanks and regards,
Cherry
Hi Cherry,
This post is now assigned to me. I will review and get back to you in a day or two.
Thanks and regards,
Vamsi
Hi Cherry,
Please take a look at below FAQ and search for "3. What are the common debug tips that we can consider when Flash API fails to erase or program?" It may help.
Can you share the implementation of the erase function call?
Thanks and regards,
Vamsi
Hi Vamsi,
Thanks for your help.
They've referenced to the flash_programming_m3 project and use the Example_CallFlashAPI() process to perform the erase operation. Erase the code, FLASH's lib files are all specified in ram and the map file is checked to ensure there is no missing.The web-downloaded firmware is saved in the shared ram.
The code of erase part is as follows:
for(i=0;i<14;1++) //14 sectors, erase one by one
{
oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,
(uint32 *)&Bzero_SectorL_start_addr[i]);
// Wait until FSM is done with erase sector operation
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}
if(oReturnCheck != Fapi_Status_Success)
{
while(1){}
}
///////////////test
oFlashStatus = Fapi_getFsmStatus();
if(oFlashStatus != 0)
{
while(1){}
}
////////////////test
oReturnCheck = Fapi_doBlankCheck((uint32 *)Bzero_SectorL_start,
Bzero_16KSector_u32length,
&oFlashStatusWord);
if(oReturnCheck != Fapi_Status_Success)
{
whiel(1){} //////////////////////Jump here on erase failure and added test section to check FSMSTAT register, found sector locked, fault code 0x0011(17)
}
}
whiel(1){} //////////////////////jump here when erase success.
And when comparing the routine in FAQ, it's found the routine didn't have the following part:
d. Initialize Flash wait-states, fall back power mode, performance features and ECC
f. EALLOW (C28x) or MWRALLOW (ARM) should be executed before calling Flash API functions to allow writes to protected registers.
Thanks and regards,
Cherry
Hi Cherry,
It is important to include flash initialization routine (for wait-state configuration) and EALLOW (C28x) or MWRALLOW (ARM) before the flash API usage.
Please implement them and let us know how it goes.
Thanks and regards,
Vamsi
Hi Vamsi,
How to initialize the flash? Could you help give an example. MWRALLOW (ARM) not found in Example_CallFlashAPI(), is it encapsulated in Flash API functions? Because their program can also run successfully under certain conditions, do these conditions being not take into account? The customer suspects if the sector's erase is locked under certain conditions, is there a way to unlock it?
Thanks and regards,
Cherry
Hi Cherry,
Regarding the lock: When it fails, what values do they see in that sector in the memory window? Please check and confirm.
Did they program any password?
I will send you the flash init routine path and the snapshot showing the MWRALLOW.
Thanks and regards,
Vamsi
Hi Cherry,
See below MWRALLOW in the code at \controlSUITE\device_support\f28m35x\v220\F28M35x_examples_Dual\flash_prog\m3\flash_programming_m3.c
In the same file, you can see the function call for flash initialization as shown below:
Thanks and regards,
Vamsi
Hi Vamsi,
Did they program any password?
No.
what values do they see in that sector in the memory window? Please check and confirm.
The values in the memory window do not change because the erase has failed and any operation in the routine is retained.
Thanks and regards,
Cherry
Hi Cherry,
For clarity: Did they use MWRALLOW and flash initialization and still see the issue?
Thanks and regards,
Vamsi
Hi Vamsi,
Did they use MWRALLOW and flash initialization and still see the issue?
Yes.
Thanks and regards,
Cherry
Hi Cherry,
Since you confirmed that you already reviewed the debug tips provided in the flash API FAQ, at this point, I may need a project that I can use to reproduce the issue on my side.
Please remove any proprietary code and send me a project with out any compile errors.
Thanks and regards,
Vamsi
Hi Cherry,
I am closing this post since I did not hear back from you for 2.5 weeks.
Please open a new post if you need further help.
Thanks and regards,
Vamsi