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.

TMS570LS1227: Prefetch Error with FEE Driver and Bootloader

Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN

Tool/software:

Hi,

I am working on an application with a bootloader. Without using the FEE Driver, the bootloader and application code work fine without any errors. When I add the FEE Driver and use it without the application code, it also works without issues. There is no problem up to this point. However, when I use the bootloader and my application with the FEE Driver, it causes a prefetch error.

When I debugged the code, after some trials, I realized that the TI_Fee_WriteAsync function causes the prefetch error. When I comment out this function in the application code, everything works fine. I am sharing the .cmd files for the bootloader and application code. Are there any suggestions to solve this problem? Thanks.

Bootloader .cmd file:

/*                                                                            */
/*----------------------------------------------------------------------------*/
/* USER CODE BEGIN (0) */
/* USER CODE END */


/*----------------------------------------------------------------------------*/
/* Linker Settings                                                            */

--retain="*(.intvecs)"

/* USER CODE BEGIN (1) */
/* USER CODE END */

/*----------------------------------------------------------------------------*/
/* Memory Map                                                                 */

MEMORY
{

    VECTORS (X)  : origin=0x00010000 length=0x00000020
    FLASH0  (RX) : origin=0x00010020 length=0x0012FFE0
    STACKS  (RW) : origin=0x08000000 length=0x00001500
    RAM     (RW) : origin=0x08001500 length=0x0002EB00

/* USER CODE BEGIN (2) */
/* USER CODE END */
}

/* USER CODE BEGIN (3) */
/* USER CODE END */

/*----------------------------------------------------------------------------*/
/* Section Configuration                                                      */

SECTIONS
{
    .intvecs : {} > VECTORS

       flashAPI:
    {
    	.\source\bl_flash.obj(.text)
    	--library=F021_API_CortexR4_BE.lib(.text)
    }palign=8 load=FLASH0, run=RAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize)

    .text    : {} > FLASH0
    .const   : {} > FLASH0
    .cinit   : {} > FLASH0
    .pinit   : {} > FLASH0
    .bss     : {} > RAM
    .data    : {} > RAM
    .sysmem  : {} > RAM

    FEE_TEXT_SECTION : {} > FLASH0
    FEE_CONST_SECTION : {} > FLASH0
    FEE_DATA_SECTION : {} > RAM

/* USER CODE BEGIN (4) */
/* USER CODE END */
}

/* USER CODE BEGIN (5) */
/* USER CODE END */


/*----------------------------------------------------------------------------*/
/* Misc                                                                       */

/* USER CODE BEGIN (6) */
/* USER CODE END */
/*----------------------------------------------------------------------------*/

Application cmd file:

/*                                                                            */
/*----------------------------------------------------------------------------*/
/* USER CODE BEGIN (0) */
/* USER CODE END */


/*----------------------------------------------------------------------------*/
/* Linker Settings                                                            */

--retain="*(.intvecs)"

/* USER CODE BEGIN (1) */
/* USER CODE END */

/*----------------------------------------------------------------------------*/
/* Memory Map                                                                 */

MEMORY
{
    VECTORS (X)  : origin=0x00000000 length=0x00000020
    FLASH0  (RX) : origin=0x00000020 length=0x0013FFE0  // OD length=0x0013FFE0 -->> length=0x0000FFFF
    STACKS  (RW) : origin=0x08000000 length=0x00001500
    RAM     (RW) : origin=0x08001500 length=0x0002EB00

/* USER CODE BEGIN (2) */
/* USER CODE END */
}

/* USER CODE BEGIN (3) */
/* USER CODE END */


/*----------------------------------------------------------------------------*/
/* Section Configuration                                                      */

SECTIONS
{
    .intvecs : {} > VECTORS

       flashAPI:
    {
    	.\fapi\\source\Fapi_UserDefinedFunctions.obj(.text)
    	.\source\bl_flash.obj(.text)
    	--library=F021_API_CortexR4_BE.lib(.text)
    }palign=8 load=FLASH0, run=RAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize)

    .text    : {} > FLASH0 
    .const   : {} > FLASH0 
    .cinit   : {} > FLASH0 
    .pinit   : {} > FLASH0 
    .bss     : {} > RAM
    .data    : {} > RAM
    .sysmem  : {} > RAM
    

/* USER CODE BEGIN (4) */
/* USER CODE END */
}

/* USER CODE BEGIN (5) */
/* USER CODE END */


/*----------------------------------------------------------------------------*/
/* Misc                                                                       */

/* USER CODE BEGIN (6) */
/* USER CODE END */
/*----------------------------------------------------------------------------*/

  • Hi Alper,

    wever, when I use the bootloader and my application with the FEE Driver, it causes a prefetch error.

    Give me some more details about FEE driver:

    1. Where are you enabling FEE driver? Is it in bootloader?

    2. Using this FEE driver where you are writing the data in memory? Is it in flash bank-7?

    3. When are you trying to write data using FEE? After POR the core will execute bootloader first and then it should jump to the application and when this FEE writing will take place?

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thanks for reply. You can reach more details in below. If there is more information, i can try to reply as much as i can do.

    1. FEE driver is enabling in the application code. Enabling code is below:

    Fapi_setActiveFlashBank(Fapi_FlashBank7);
        TI_Fee_Init();
        do
        {
            TI_Fee_MainFunction();
            delay();
            Status = TI_Fee_GetStatus(0);
        }
        while (Status != IDLE);
    

    2. Yes, I am writing data to flash bank-7 with FEE driver. For the configuration, Halcogen is used. Only 8 byte data is written to flash bank-7 and only first block is used.

    3. FEE is using in the application code. Its usage is independent from the bootloader. In the below, you can see the function that i used to write memory with FEE. Interested thing is eventhough not calling this function in my application code (but it is in the build), it causes a prefetch error after the bootloader complete the writing application code to flash and jump to application code. Prefetch error occurs in the application code's _c_int00's  __TI_auto_init() . But when i comment out the WritingEEPROM function's content, it does not give prefetch error and application code starts.

    void WriteEEPROM(uint8 *SpecialRamBlock)
    {
        uint16 u16JobResult, Status;
        unsigned int BlockNumber;
    
        /* Write the block into EEP Asynchronously. Block size is configured in ti_fee_cfg.c file. Default Block size is
         8 bytes */
        BlockNumber = 0x1;
        TI_Fee_WriteAsync(BlockNumber, &SpecialRamBlock[0]);
        do
        {
            TI_Fee_MainFunction();
            delay();
            Status = TI_Fee_GetStatus(0);
        }
        while (Status != IDLE);
    }
    

    --

    Thanks & regards,
    Alper.