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-EP: F021 flash api read issue

Part Number: TMS570LC4357-EP
Other Parts Discussed in Thread: TMS570LC4357

Tool/software:

Dear TI Team

I downloaded the 5758.FAPI_TEST_LC4357.zip routine, this routine only performs a write operation, which verifies correctly, and then I tried to call the Fapi_doMarginRead function, which reported an error:
error #10234-D: unresolved symbols remain。

I also saw the description of this function in F021 Flash API Version 2.01.01 Reference Guide, but why this function is not implemented, then I want to read operation, what should I do, please help to confirm, thank you!

  • Hi Sam,

    Can you try below API for read once:

    "Fapi_doMarginReadByByte"

    --
    Thanks & regards,
    Jagadish.

  • Hi jagadish

    “Fapi_doMarginReadByByte” function I also tried, same result!

    I checked the other forum (TMS570lsxxx) and it states that this function is deprecated, but it must exist in the TMS570LC4357, right?

  • The F021 library : C:\ti\Hercules\F021 Flash API\02.01.01\F021_API_CortexR4_BE_L2FMC_V3D16_NDS.lib

  • Hi jagadish

    May I ask why it takes so long to reply every time, so that I'm annoyed

  • Hi Sam,

    First of all, my apologies for the delayed response, recently i got so many customer queries on these devices, so it is taking time to respond to all.

    I executed the project with "Fapi_doMarginReadByByte" API, and you can see the receive buffer is updated with same data that we have written into the memory.

    I am attaching my tested project for your reference:

    2112.FAPI_TEST_LC4357.zip

    --
    Thanks & regards,
    Jagadish.

  • Okay, thanks for the reply.

    I will be testing directly with the routines you provided

  • hello gundavarapu

    I have no problem using your routines directly.

    Now I want to operate bank 0.

    Can you teach me how to copy FLASH API related functions to RAM for execution?

    I look forward to your reply, I would appreciate it, thank you!

  • Hello gundavarapu

    After exploring the forum, I managed to copy the F021 FLASH API related functions to RAM for execution.

    But what is strange to me is that the code can be executed normally with single-step debugging, but if it is executed directly, it will trigger a prefetchEntry exception, I will attach my code below, can you help me to check what is the problem?

    8358.TMS_52_FLASH_API_TEST.rar

  • Hello gundavarapu

    Can you get back to me faster?

  • Hi, Gundavarapu.
    This question is also almost a month old, please do bother to reply some when you have time, thanks.

  • Hi Sam,

    Apologies for the delayed response,

    But what is strange to me is that the code can be executed normally with single-step debugging, but if it is executed directly, it will trigger a prefetchEntry exception, I will attach my code below, can you help me to check what is the problem?

    Are you still stuck at same step for the attached project?

    --
    Thanks & regards,
    Jagadish.

  • Yes, it's still the same phenomenon, single step debugging is fine, running it directly gives an error.

  • Hi Sam,

    Finally, i did this after lot of debugging today:

    It is working now, i can be able to write into the bank-0.

    Here is the working project:

    TMS_52_FLASH_API_TEST.zip

    The problem is happening here:

    In these two cases that is flash erasing and programming:

    We are executing Fapi_issueAsyncCommandWithAddress and Fapi_issueProgrammingCommand functions in RAM that is fine however their corresponding status verification is still present in the flash.

    That is:
    while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
    while(FAPI_GET_FSM_STATUS != Fapi_Status_Success); 

    The above two lines are still executing in flash, this is creating issue because after initiating erase or write operation commands to the one of the flash banks then we should not execute any code in the same flash bank until the issue command operation is completed. If we access same flash bank before completion of the operation that will create exception.

    So same thing is happening in your case as well. So, the solution here is that the status checking instructions for operations erase and program should also happen in RAM not in the flash. 

    To perform above solution, i did this:

    I created two api's, for erase and programming including their status verifications like as shown below.

    And i executed those API's in RAM instead of flash:

    After implementing above solution, the issue got solved.

    --
    Thanks & regards,
    Jagadish.

  • Hi Gundavarapu

    First of all, thank you so much for your reply, it was awesome to answer so clearly. But I still have two small questions.

    1. What is the purpose of placing the const variable in RAM in the following steps?

    2. Is there a specific introduction to the syntax in the HL_sys_link.cmd file? I want to learn it.

  • Hi Sam,

    1. What is the purpose of placing the const variable in RAM in the following steps?

    Actually, i saw in one of the TI CAN bootloader example codes. const section also copying into the RAM like as shown below.

    Initially i suspect this could causing the issue, so implemented this change. You can just remove this and try once.

    2. Is there a specific introduction to the syntax in the HL_sys_link.cmd file? I want to learn it.

    TI Linker Command File Primer

    C28x Compiler - Understanding Linking

    Refer the above links, they would be helpful.

    --
    Thanks & regards,
    Jagadish.

  • Ok, that solved my problem, thanks a lot and have a nice life.