Hello Community,
I am using F28069U device and developing a bootloader via USB. The USB part is working fine.
When I send the command to erase flash sectors (using dfuprog) along with starting address and length,
I get "Error DFU_ERR_DNLOAD_FAIL (-12) erasing flash!".
When I investigated further, I found that the length and the address are received correctly by the controller.
Then I tweaked the Erase part of the bootloader as shown here:
old code:
// Figure out what to erase
ulTemp = FlashAPIIndex((unsigned long)g_sErase.pcStart, g_sErase.ulLength);
//Are we erasing sector A
if(ulTemp & 0x01)
//Erase sector A and reprogram reset vector
ProgramBLNormalVector();
ulTemp &= 0x7E;
Flash2806x_Erase(ulTemp, &g_FlashStatus);
new code:
Flash2806x_Erase(SECTORG, &g_FlashStatus);
Flash2806x_Erase(SECTORF, &g_FlashStatus);
I observed that the changed code works. => the sector to be erased is not correctly returned by FlashAPIIndex.
I could not find any documentation about the usage of this API.
could anyone help me here?
Thank you,
Vishwanatha