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.

RM48L952: Stalling Fapi_doMarginReadByByte() in F021 API

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN

Hi, I faced with a problem to read data from EEPROM while I bring up F021 library for my project. I initialize FLASH during to recommended state machine description in "F021 FLASH API Version 2.01.01 (page 41)". Here piece of my code:

/************************************************************************************/

uint8_t *flash_addr = F021_EEPROM_MAP_BEGIN; // 0xF0200000U

Fapi_StatusType status;

status = Fapi_isAddressEEPROM(F021_EEPROMECC_MAP_BEGIN);

status = Fapi_initializeFlashBanks(160);

status = Fapi_setActiveFlashBank(7);
status = Fapi_enableEepromBankSectors(1, 0); // write data to sector #0
status = Fapi_issueProgrammingCommand(flash_addr, (uint8_t*)buff, (uint8_t)(8), F021_EEPROMECC_MAP_BEGIN, (uint8_t)(8), Fapi_DataOnly);

//For this functions calls return value is always "Fapi_Status_Success". After that I want to read written by me data from EEPROM to be sure that write operation is correct.

status = Fapi_initializeFlashBanks(160);
status = Fapi_doMarginReadByByte(flash_addr, (uint8_t*)buff, (uint32_t)(8), Fapi_NormalRead);

/************************************************************************************/

But function Fapi_doMarginReadByByte() stalls execution of my program (Some error inside function calls error handler in RTOS). I'm not deep into assembler, but execution crashes in _Fapi_enterMarginMode function in assembler debug.

Also I watch code example from this issue and write the same sequence of calls: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1036826/rm48l952-f021-flash-api-usage-examples

Please, help me what's going wrong here.

  • Hi,

    I started working on your issue and i will get back to you soon.

    Thanks,

    Jagadish.

  • Hi,

    If you use bank 7 as EEPROM to store block of data, you can use TI FEE driver to write data to and read data from the EEPROM . The FEE driver is generated by HALCoGen if FEE is checked, because it was already tested and it is reliable

    The TI FEE Driver provides the following functional services:

    Initialization:

    • TI_Fee_Init

    Operations:

    • TI_Fee_WriteAsync

    • TI_Fee_WriteSync

    • TI_Fee_Read

    • TI_Fee_ReadSync

    • TI_Fee_EraseImmediateBlock

    • TI_Fee_InvalidateBlock

    • TI_Fee_Shutdown

    • TI_Fee_Cancel

    • TI_Fee_Format

    Information:

    • TI_Fee_GetStatus

    • TI_Fee_GetJobResult

    • TI_Fee_GetVersionInfo

    You can refer below user guide 

    0535.TI FEE User Guide.pdf

    Also HALCoGen providing example project, you can find it in Help window

    --

    Thanks,

    Jagadish.

  • Hi, I generate a source code from HALCoGen and add it in my project. I use code from FEE read/write example project and also I stalled in TI_Fee_Init() function (Fapi_doBlankCheck in ti_fee_uil.c:903). Init function takes no parameters, so I expected that it not depends from me. As error occurred I think some troubles happens in my code in initialization and etc. May be this functions from FEE library mush run from RAM, in critical code section or some other stuff?

  • Hi,

    It might be due to using of wrong version of the F021_API library.

    We should configure "F021_API_CortexR4_LE_L2FMC.lib"

    --

    Thanks,

    Jagadish.