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.

TMS570LC4357: F021 Flash Bootloader Proper Usage

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

TI Hercules Friends & Family,

Our customer would appreciate some input regarding F021 Flash usage.

They are having some difficulty getting the F021 library to work from RAM.

 The HL_sys_link.cmd file seems to be configuring memory correctly;

                In addition they tried setting RAM permissions to RWX (and MPU region in HALCoGen to allow execution); it did not help.

                They also tried the compiler option --ramfunc and using the .TI.ramfunc align(32) to automatically copy the library during initialization; see commented out line in the USER CODE section.

 

When the code is running as soon as the following line is reached a prefetchEntry interrupt fires;

                fapi_status = Fapi_initializeFlashBanks( SYS_CLK_FREQ );

 

                I have included a screenshot from them below. Unless we are understanding the LR register wrong, it seems the fault originates at an address outside of the defined memory region (0x08080004)?

                Another thing noticed is the RAM ECC region doesn’t seem to be initialized?  This obviously doesn't seem normal.

 Suggestions welcomed.

TY,
CY

 

 

/*----------------------------------------------------------------------------*/

/* Memory Map                                                                 */

 

MEMORY

{

/* USER CODE BEGIN (2) */

/* USER CODE END */

    VECTORS (X)  : origin=0x00000000 length=0x00000020

    FLASH0  (RX) : origin=0x00000020 length=0x001FFFE0

    FLASH1  (RX) : origin=0x00200000 length=0x00200000

    STACKS  (RW) : origin=0x08000000 length=0x00001500

    RAM     (RW) : origin=0x08001500 length=0x0007eb00

 

/* USER CODE BEGIN (3) */

    //RAMFUNC (RWX): origin=0x08070000 length=0x00010000

/* USER CODE END */

}

 

/* USER CODE BEGIN (4) */

/* USER CODE END */

 

 

/*----------------------------------------------------------------------------*/

/* Section Configuration                                                      */

 

SECTIONS

{

/* USER CODE BEGIN (5) */

/* USER CODE END */

    .intvecs : {} > VECTORS

    .text   align(32) : {} > FLASH0 | FLASH1

    .const  align(32) : {} > FLASH0 | FLASH1

    .cinit  align(32) : {} > FLASH0 | FLASH1

    .pinit  align(32) : {} > FLASH0 | FLASH1

    .bss     : {} > RAM

    .data    : {} > RAM

    .sysmem  : {} > RAM

               

    FEE_TEXT_SECTION  : {} > FLASH0 | FLASH1

    FEE_CONST_SECTION : {} > FLASH0 | FLASH1

    FEE_DATA_SECTION  : {} > RAM

 

/* USER CODE BEGIN (6) */

    .flashapi : load = FLASH0, run = RAM, LOAD_START(FlashApi_LoadStart), LOAD_END(FlashApi_LoadEnd), LOAD_SIZE(FlashApi_LoadSize), RUN_START(FlashApi_RunStart), RUN_END(FlashApi_RunEnd), RUN_SIZE(FlashApi_RunSize),

        {

                --library= "C:\ti\Hercules\F021 Flash API\02.01.01\F021_API_CortexR4_BE_L2FMC_V3D16.lib" (.text)

                "C:\ti_workspace\iVM_Bootloader\Debug\source\Fapi_UserDefinedFunctions.obj" (.text)

        }

 

//           .TI.ramfunc align(32) : { "C:\ti\Hercules\F021 Flash API\02.01.01\F021_API_CortexR4_BE_L2FMC_V3D16.lib" (.text) } load=FLASH0, run=RAMFUNC, table(BINIT)

/* USER CODE END */

}