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.

RM48HDK Flash writing demo

Other Parts Discussed in Thread: HALCOGEN

Hi,

 

I'm using RM48HDK.

I try to program the Flash bank 7 as EEPROM.

How can I program it?

If you have sample code, please send me?

Thank you.

 

KOMECO.

senior engieer

seongjin jeong

  •  

    Hi Seongjin,,

    We will look into this with the concerned experts and get back to you asap.

    -Hari

  • Hello Seongjin,

    Here is some example code that will program 16 bytes into bank 7 and automatically calculate and program the ECC.  For EEPROM Emulation, you will either need to write a Flash EEPROM Emulation driver on top of the Flash API or we should be releasing TI Flash EEPROM Emulation driver sometime at the end of the 3rd Quarter/ beginning of the 4th Quarter of this year.

    #include "F021_FMC_LE.h"

    int main (void)
    {
        Fapi_StatusType oReturnCheck = Fapi_Status_Success;
        uint32 u32StartAddress = 0xF0200000U;
        uint8 au8MainDataBuffer[16] = {0x78, 0x17, 0x19, 0x2E, 0x0A, 0xB9, 0x11, 0x70, 0x5F, 0xC1, 0x9C, 0xFD, 0x54, 0x51, 0xED, 0x86};
        uint32 u32Index;
                    
         /*
                                Add device specific initialization here, including, but not limited to:
                                pll initialization, setting up RWAIT/EWAIT value, etc.

                                Assumes, unless otherwise noted, device has 144bit wide Flash Banks.
        */

        oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS,180);  /* Example code is assuming operating frequency of 180 MHz */

        if((oReturnCheck == Fapi_Status_Success) &&;
           (Fapi_checkFsmForReady() != Fapi_Status_FsmBusy))
        {
           oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank7);

          if(oReturnCheck == Fapi_Status_Success)
         {
                oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32StartAddress,au8MainDataBuffer,16,0,0,Fapi_AutoEccGeneration);
         }
          
           /* Wait for FSM to finish */
           while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);

              /* Check the FSM Status to see if there were no errors */
           if (Fapi_getFsmStatus() != 0)
           {
               /* Put Error handling code here */
           }
        }
    }

  • Hi,

    Could you provide an example of reading and writing to flash without using the API?  or Would it be possible to see the source code of the libraries within the API?

    Thank you,

     

  • Hello Scott,

    Reading from the Flash is as simple as doing a memory read:

    uint32 toread = *(uint32 *) 0xF0200000;

    As for programming the Flash without the API, we do not support this.  We require the use of the F021 Flash API for all program and erase operations.  We do, under NDA, release the source code to interested parties in a secured PDF for code review purposes only.  If this is something you desire, please contact your local TI representative to initiate the process.

  • Hi John,

        Thank you for your fast reply. I will enquire about requesting the code for review with management here.

        While I enquire about requesting the code, would it be possible for you to provide a series of steps to write and erase the flash memory?

        We only require the basic code for write and erase.

        I read the flash section of the RM48 16/32-Bit Flash Microcontroller Technical Reference Manual. It only provides the description of the registers but does not explain much about the procedure itself.

        I also tried to refer to the F021 Flash API Version 1.51 Reference Guide but the parts that I need (hardware configuration, instructing the hardware to write or erase a memory location) are obviously encapsulated in the object files.

        Hope you can help me with that.

    Thanks,

     

  • Scott,

    We do not provide descriptions of all the registers required for setting up, programming and erasing the device as we require the use of the F021 Flash API.  I am in the process of writing an advanced F021 Flash Erase/Program Usage Application note, but this will not be released until the end of September and will still require the use of the F021 Flash API.

  • John,

    Just for clarification:

    Does the RM48 16/32-Bit Flash Microcontroller Technical Reference Manual include all the registers to control the flash module? 

    I am just confused because of the last message when you say that you "do not provide descriptions of all the registers required..."

    Thanks,

  • Scott,

    We do not publish all the registers required for programming and erasing Flash on the RM48 devices.

  • I need to modify my statement about releasing the source code for the API under NDA. 

    We will release the source code under NDA and a signed software license for code review only.  The code may not be used to replicate or emulate the compiled F021 Flash API object libraries we release.  We require our object libraries to be used for all program and erase operations.  Any circumvention of this will void Flash data retention specifications as shown in the device's data sheet.

  • Hi John,

    I would like to know if there are still plans for the advanced F021 Flash Erase/Program Usage Application note that was going to be released at the end of September?

     

    Thanks,

  • Scott,

    This document will be included with v2.0.0 of the F021 Flash API as it is based on this version.  The schedule for the API has slipped and is now currently planned to be released by the end of December.

  • Hello John,

    Can you please let me know whether F021 Flash API v 2.0.0 and the App Note release is on schedule or not?

    Thank you.

    Regards

    Pashan

     

  • Pashan,

    It has not released and will be about a month late.

  • I would also like to get the application note to help with implementation of FEE read/writes to bank 7 of the RM48. What is the latest scheduled release date?

    Thanks

    Jamie Wardlaw

  • Jamie,

    The latest version of HALCoGen includes the latest beta of the F021 Flash API which includes the Advance Usage App note.

  • Thanks John.

    Downloaded, noticed that I was a couple of versions behind on my HALcogen output. Also noted that the GUI does not generate the drivers for the RM48x yet. I assume I will need to call the F201 library direct from within my application?

    Jamie

  • Jamie,

    Did you download HALCoGen from the tools page or used check for updates?  v3.5.2 was released this morning and will populate to the tools page tomorrow, but is available through check for HALCoGen updates shortcut now.

    Currently, the F021 API is not integrated into HALCoGen generated code other than in the FEE driver code.  This lack of integration should change in a future release, but I do not have a schedule for that activity.

  • hi John,

    I used check for updates. I am now running 3.05.02 which sounds like the latest.

    From the Release Note it says that FEE-CFG module is not applicable for the RM48x, am I correct in saying that this is because flash block 7 is always used for FEE on the RM48x?

    I don't see an FEE driver enable option in HALcogen for my RM48x FreeRTOS project, am I missing something here? I also see no FEE driver files when I generate the code.

    Thanks

    Jamie

  • Hi Jamie,

    I am not able to answer those questions.  I have forwarded your questions to the HALCoGen team.

  • Hi Jamie,

    As of now, FEE driver is only supported on TMSx devices.

    Regards,

    Vishwanath Reddy.