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.

AM4377: Saving data in NOR flash in XIP mode

Part Number: AM4377

Tool/software: TI-RTOS

Hi,

I made a custom board works with SYS/BIOS on XIP(but exactly same as IDK, except part suffix..(I'm using MX66L51235F'Z2I'.)

Because I use XIP, I can't use Board_readFlashStorage(), Board_writeFlashStorage() and the fuctions in qspi_lib.c.

I need to save some data in the board, so I tested this code.

main()

...
        *(volatile int*)(0x3001F000) += 1;

...

BIOS_start();

...

Task()

{

while(1)
        CONSOLEUtilsPrintf("%4u\t", *(volatile int*)(0x3001F000));

}

...

I expected count value increase when re-powering, but it has the value 0.

Should I do something before flash writing? If so, how could I do that without library functions?

I read about 3/4-byte address mode setting things, but it is so confusing me..(destination address is lower than 0xFFFFFF..)

(How could I send a command to flash? I'm using flash memory all time, and the code is in flash memory, isn't there something to be wrong?)

I used memcpy() function like this, but the data isn't saved(but it seems to succeeded before power-off, the data goes away after power-on.)

memcpy((volatile int*)destination, (char*)data, datasize);

I couldn't use L3 build because application size exceed the RAM size..

Thank you,

YK.

  • The RTOS team have been notified. They will respond here.
  • Hi,
    Could you figure out how I can use QSPI Flash in XIP application?
    If I can use it in XIP application, how could I erase the block?
    And how could I write data in Flash to use it permanently?
    Or please give me something you figured out until now..
    Thank you.
  • Hi,

    The IDK AM437x EVM uses MX66L51235FMI-10G for QSPI. There is QSPI driver example project QSPI_FlashReadWrite Example application. The test calls SPI_init_v1, SPI_Params_init (with default), SF25FL_open in sequence.

    Then, it is followed by S25FLFlash_BlockErase, SF25FL_bufferWrite, SF25FL_bufferRead API calls to write a pattern into QSPI and read back. Those functions are implmented in packages\ti\drv\spi\example\qspi_flash\src\Flash_S25FL in source code, not qspi libraray.

    I don't know the difference between MX66L51235FMI and MX66L51235F'Z2I', but it looks the part number are almost the same. So I hope the Flash_S25FL.c code can be used on your board as well.

    I don't know how you know the data was written to your QSPI. Then you power cycle, you found the data is zero. Is the data really written to there but read back problem or the data writing didn't happen at all?

    For the IDK here, I knew the pattern as below. Then I power cycle the board, I run the same program again and after SF25FL_open() I halt the A9 core. Then from CCS window I looked at the address 0x30000000 to make sure the pattern is still there.

    Are you able to do the same to read back?

    Regards, Eric