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.

boot loader flash-2



6305.FaRegister Status.docxWe are developing boot loader for TMS570LS3137 under IAR enviroment. And I went through the TI example code and made some change to incorporate to my project.

The library I am using is \F021_API_CortexR4_BE_V3D16.lib. And add" initialize by copy { readonly, readwrite };" in the flash.icf file so the program can be run in RAM from 0x80000000.

 

Issue:

I developed a flash test program (  F021_InitializeBanks( );    F021_ActiveBank_EnableSectors (  );    sector_erase ();. and program).

However in sector erase, after Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, eraseStartAddr); I always get FMSTAT=818.

which is related with this?

and if I am only working on one bank, I think  I only need to F021_InitializeBanks( );    F021_ActiveBank_EnableSectors (  ); one time, not necessary multi times  for each erase and program functions, right?

Other questions:

1 in TI example

uint32_t Fapi_BlockProgram( uint32_t Bank, uint32_t Flash_Start_Address, uint32_t Data_Start_Address, uint32_t Size_In_Bytes)

it shows if Size_In_Bytes> 16, the program is based on 16 bytes untill it gets to total Size_In_Bytes .

it shows if Size_In_Bytes< 16, the program is just for Size_In_Bytes. Can it be 1, 2, 3, 4? The reason I am asking is the data width of flash is 64 bits, so is there s requirement of alighnment of 64 bits(8 bytes)?

 

2 in TI exmaple BL_flash.c

in Fapi_BlockErase(), Fapi_enableMainBankSectors(0xFFFE);

in Fapi_BlockProgram, Fapi_enableMainBankSectors(0xFF);

Is there any reason the enabled sectors are different?

 

 

  • for FMSTAT=818, VOLTSTAT=1,

    core Voltage Status

    When set, this bit indicates that the core voltage generator of the pump power supply dipped below

    the lower limit.

    Does it mean the VCCP input has dip or something internal the pump? or any others suspected?

  • huichun xing said:

    6305.FaRegister Status.docxWe are developing boot loader for TMS570LS3137 under IAR enviroment. And I went through the TI example code and made some change to incorporate to my project.

    The library I am using is \F021_API_CortexR4_BE_V3D16.lib. And add" initialize by copy { readonly, readwrite };" in the flash.icf file so the program can be run in RAM from 0x80000000.

     

    Issue:

    I developed a flash test program (  F021_InitializeBanks( );    F021_ActiveBank_EnableSectors (  );    sector_erase ();. and program).

    However in sector erase, after Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, eraseStartAddr); I always get FMSTAT=818.

    which is related with this?

    and if I am only working on one bank, I think  I only need to F021_InitializeBanks( );    F021_ActiveBank_EnableSectors (  ); one time, not necessary multi times  for each erase and program functions, right?

    Other questions:

    1 in TI example

    uint32_t Fapi_BlockProgram( uint32_t Bank, uint32_t Flash_Start_Address, uint32_t Data_Start_Address, uint32_t Size_In_Bytes)

    it shows if Size_In_Bytes> 16, the program is based on 16 bytes untill it gets to total Size_In_Bytes .

    it shows if Size_In_Bytes< 16, the program is just for Size_In_Bytes. Can it be 1, 2, 3, 4? The reason I am asking is the data width of flash is 64 bits, so is there s requirement of alighnment of 64 bits(8 bytes)?

     

    2 in TI exmaple BL_flash.c

    in Fapi_BlockErase(), Fapi_enableMainBankSectors(0xFFFE);

    in Fapi_BlockProgram, Fapi_enableMainBankSectors(0xFF);

    Is there any reason the enabled sectors are different?

     

     Hi,

    We are looking into this and will get back to you as soon as possible

     

    Hercules forum support

  • Hello Huichun Xing,

    If the core voltage is not within the appropriate range, the error flag VOLTSTAT is set.

    Can you check the return value of F021_InitializeBanks() ?

     Fapi_initializeFlashBanks( ) should be called only once during initialization. If the system frequency is changed after initial call, this function must be called again. 

    Fapi_setActiveFlashBank and Fapi_enableMainBankSectors should be called only once depending on the bank and sectors you are working on.

     1. It can program from 1 byte up to the bank width (8,16,32) bytes based on the bank architecture. The supplied starting address to program  plus the data buffer length cannot exceed the bank data width.

    2. You can enable the sector which you are working on.  In the example, all sectors are erased whereas programming is done only on Bank 1 sectors 0-7.

    Thanks,

    Siddharth

     

  • Siddharth,

    I changed the wait state and also the frequency for F021_InitializeBanks(). Now, no isse for sector erase.

     

    However, when we call F021_Erase_Check, it flys away to 0x824 :Abort_Handler. My test code including F021 functions are actually run from RAM starting from 0x8000000.

     

    Any idea about this.

  • Hello Huichun Xing,

    Can you debug further and determine which instruction caused the abort exception?

    The Link Register (LR or R14) captures the location of the program counter when the exception was raised.

    If you have a JTAG debugger, you can put a breakpoint on the exception vectors and then examine LR .This will indicate the location of the instruction which caused this exception.

    Best Regards,

    Siddharth

     

  • when this happened, R14 =08000A3c which is error =2 in F021_Erase_Check(uint32_t Start_Address, uint32_t Bytes) function.

     

    if I change error=2 to

    bytes = 0;

    or

    FLASH_CONTROL_REGISTER->FsmWrEna.FSM_WR_ENA_BITS.WR_ENA    = 0x5U;

     

    it happens the same thing, with R14 pointing to the same location even they are different sentences.

    If I delete this sentence, the abort will not happen.

     

    If I useg IAR memory window, it does not show ffffffff at the esased sector. But the status from the

         status = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, eraseStartAddr);
            while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
            while(FAPI_GET_FSM_STATUS != Fapi_Status_Success);

     

    are correct.  Any clue?

  • 4520.assembly 0x8000aec fail for Flash access.docxA little further update

    If I go step by step in assembly, it failed in Erase_check at assembly instruction LDR R5, [R5] when R5 is 0x00060000, the starting sector address. See attachment for the screen shot. What kind of setting and configuration can affect the flash access?

    BTW the status from the previous instructions

    status = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, eraseStartAddr);
    while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
    while(FAPI_GET_FSM_STATUS != Fapi_Status_Success);

    are correct.