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.

Trying to erase bank1 flash - Fapi_Error_InvalidBank

Other Parts Discussed in Thread: CONTROLSUITE

Using LaunchPadXL F28377S and CCS 6.1.2

I am trying to load data into flash bank1.  I get the common Fapi_Error_InvalidBank.  This was supposedly solved in a workaround several months ago(see https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/464632/1667660 ) This was for v160 I am using v180.  Is there an example for v180 using its current libs and includes?

I used this code for flash bank 0.  It worked fine. I commented out the flash 0 references and replaced with flash 1 references and get the error.

// Call Flash Initialization to setup flash waitstates
// This function must reside in RAM
InitFlash_Bank0();
InitFlash_Bank1()

EALLOW;
// Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;
Flash1EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;
EDIS;

EALLOW;

// This function is required to initialize the Flash API based on System
// frequency before any other Flash API operation can be performed

oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 200);//for now keeping it out

if(oReturnCheck != Fapi_Status_Success)
{
// Check Flash API documentation for possible errors
Example_Error(oReturnCheck);
}

// Fapi_setActiveFlashBank function sets the Flash bank and FMC for further
// Flash operations to be performed on the bank
// oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank1);
if(oReturnCheck != Fapi_Status_Success)
{
// Check Flash API documentation for possible errors
Example_Error1(oReturnCheck);
}

  • Hi,

    Please update your controlsuite and checkout the example at C:\ti\controlSUITE\device_support\F2837xS\v190\F2837xS_examples_Cpu1\flash_programming.  

    Above example uses F021_API_F2837xS_FPU32.lib available at C:\ti\controlSUITE\device_support\F2837xS\v190\F2837xS_common\lib.

    Thanks and regards,

    Vamsi

  • Hi,

    Are you able to program Bank1 now?

    Thanks and regards,

    Vamsi

  • Vamsi,

    Thank you. I am finally to program flash bank1. However, there are minor modifications necessary to your instructions.

    1. I had to completely reinstall with the new versions of both ControlSuite and CCS; updating the versions I got in February did not provide the updated APIs.

    2. The APIs and the examples are only in ....\v191\.... path and not ...\v190\....

    3. The R4 preprocessor #define in the values.h, as a sin() coefficient, conflicts with the R4 defined in the Fapi_CpuType enum in types.h causing a compile error if both are included.

    There also appears to be a flash problem with large arrays. My data array was 5k words. When using Fapi_issueProgammingCommand() with the Fapi_DataOnly directive, there are random data words missing (at a rate of approximately 1 out of 20). These are apparently getting flashed to other locations because the program will show the data with the holes and will not restart on power off/on. When the data is written using the Fapi_AutoEccGeneration directive, the data is displayed without any holes and the program will restart correctly on power up.
    This occurs with the data flashed to several of the flash bank1 sectors, S, T, U, V, or W.
  • Hi,

    Good to hear that you are able to program Bank1 now.

    1) I will forward this feedback to our Controlsuite installer developer.

    2) You are correct - it is V191.

    3) I can append a postfix "_CPU" to the CPU types.  However, there is always a chance that it can again collide with some other one.

    Regarding your large array programming problem:  

    1) Can you share your code?

    2) Do you program eight 16-bit words at a time (meaning always provide a 128-bit aligned address to the program function)? OR do you program less than eight 16-bit words at a time and make sure to provide the correct address accordingly?

    3) Did you get any error from API when you find that some of the words did not get programmed?

    4) Regarding the power cycling, if you don't program ECC, ECC errors will occur and this will cause continuous resets and your application will not be up and running.  Hence, you must program ECC using AutoEccGeneration mode if you think that your application will execute/read from locations for which ECC is not programmed.  

    Thanks and regards,

    Vamsi

  • Hi,

    Are you able to program correctly?

    Thanks and regards,
    Vamsi