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.

Read and write NOR flash on TMCXEVM6657LE evaluation board

Hi, I'm searching some examples or test code of the TMCXEVM6657LV evaluation board where I can  write the data (e.g. a block of 200KByte) to the NOR flash (N25Q032A11ESE40F) and read data from the NOR flash.

Thanks

Tam Tran

  • Hi Tam Tran,

    Please for the NOR flash writer project for C6657 provided in the MCSDK 2.x under the directory path

    $(MCSDK_INSTALL_DIR)/tools/writer/nor.

    The low level driver is also provided in the PDK packages under

    $(MCSDK_INSTALL_DIR)\..\pdk_xx_xx_xx_xx/packages/ti/platform/evmc6657l/platform_lib/src

    Please let us know if you have any follow up questions.

    Regards,

    Rahul

  • Hi Rahul

    I have looked at the NOR flash driver (evmc665x.c and .h). The interface is:

    - nor_init

    - nor_read

    - nor_write

    - nor_earase

    - nor_get_details

     

    I have also looked at the project norwrite_evmc6657l (norwriter.c). My questions are:

    1. Why the norwrite_evmc6657l does not use the the NOR flash driver. I can't see any call to the interface of the NOR flash driver?

    2. In case I want to use the NOR flash driver, how is the sequence of the interface calls if I want to:

    - read a block from NOR flash

    - write a block to the NOR flash

    Thanks

  • hi Rahul,

    if you follow the references from norwriter_evmc6657l (call of platform_device_write) to platform.c, you will find in line 1593:

    that nor_write is called indeed.

    But I have also a question to you or the TI Experts:

    Q1: I want to boot via SPI from NOR Flash on my C6657 EVM. How should arrange the boot image? I have read about boot tables, but did not find any exmaple so far. I do not want to use the IBL (via I²C from EEPROM). I directly want to boot from NOR Flash via SPI.

    Thanks+Regards, Gregor

  • Hi Tam,

    Please refer platform.c file for the sequence of the interface calls.

    Path: MCSDK-2\..\pdk_C6657_1_1_2_6\packages\ti\platform\evmc6657l\platform_lib\src

    This would answer your query 1 & 2. 

  • Any idea to my question Q1?

  • Hi Rajasekaran

    Q1: I'm modifying the Norwrite project for my purpose (read / write to NOR flash) and it's seem like a can go further with the code. There is some comment in the code about writing to NOR flash. You have to take care on the size of data (pages and blocks of a sector). Do you have some specification of the NOR flash (N25Q032A11) or a links where I can find the specification?

     

    Q2: the N25Q032A11 is a 32Mbit flash. Why does the technical reference  manual (SPRUHG7) state that the N25Q032A11 is a 16Mbit flash?

     

    BR

    Tam Tran

  • Hi Tam,

    Regarding your Q2: The part installed on EVM is 32Mb. There is typo in technical reference manual, which we will update soon.

    Thanks for providing this information.

    Thanks & Regards,

    Rakesh Modi

    (www.einfochips.com)

  • Hi Rakesh Modi

    Thanks for your answer. It seems like I can move further with coding of the NOR read/write.

    But I'm still in doubt about using the platform_device_write (from platform.h). Do I have to take care of the bad Blocks or do I have to erase a block for writing new data to NOR flash?

    Or does it handle by the platform when I'll try to write some data the platform will take care of black listed bad sectors and erase block before writing?

    I'm confusing because the norwriter project just calls the platform_device_write to flash the data to NOR flash. But if you read the comment in the platform,h about the platform_device_write(), then you have to take care of bad Blocks, read and erase before writng to a block:

    Do you have some explainationfor this issue?

    BR

    Tam Tran

    _______________________________________

    *  When working the NOR device you may either write a block of data that is larger than

    *  a single page. All writes to the flash must be aligned to start on a page boundary.

    *

    *  When using platform_device_write() if you write a single page (done by

    * setting the length of the write to the page size) then your application will need to

    *  take care of erasing and preserving the block the page is in.

    *

    *  If you write more than a page, the platform_device_write call will handle

    *  erasing the block the page is in and will also preserve the contents of other

    *  pages within the block that are not being written to. The algorithm used is as

    *  follows:

    *

    *    While we have data to write do

    *       skip block if bad (and keep skipping until the next good block is found)

    *       read the block    (page level)

    *       erase the block   (block level)

    *       write the block   (page level)

    *

    *  Reads

    *

    *  When using platform_device_read on a NOR device, you may read as much as you like.

    */

    /**

    ______________________________

    * @brief Device Identifiers. These are used in the Open call to allow access to a specific

    * memory device.

    *

    */