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.

Only one NAND read possible?

Hello,

I have loaded a small data file to the NAND flash of my C6678 EVM. In my application, I want to read out this content page by page. The first read works fine, but all following reads fail. When I reload the programm, even the first read fails, so I have to switch the EVM off and on again and restart the session. Then the first read will work, but all others still fail. This is the function to access the NAND device:

Platform_STATUS read_nand(uint8_t *buf, uint32_t block, uint32_t page) {
    PLATFORM_DEVICE_info *p_device;
    uint32_t offset;

    p_device = platform_device_open(PLATFORM_DEVID_NAND512R3A2D, 0);
    if (p_device == NULL) {
        platform_device_close(p_device->handle);
        return Platform_EFAIL;
    }
       platform_blocknpage_to_offset(p_device->handle, &offset, block, page);

       if (platform_device_read(p_device->handle, offset, buf, 1) != Platform_EOK) {
           platform_device_close(p_device->handle);
           return Platform_EFAIL;
       }
       else {
           platform_device_close(p_device->handle);
       }
       return Platform_EOK;
}

I have tried different things, but they all didn't work: not calling platform_device_close() at the end of the function, different buffers for every read. In every case only the first read is successful.

I am using CCS 5.2.1.00018, SYS/BIOS 6.33.5.46, MCSDK PDK 1.1.0.3 and compiler 7.4.1.

Thanks for your help!

Best regards,
Erik

  • Erik,

    Have you analyzed the exact reason behind this? Is it able to read the page data and failing because of ECC mismatch? I could have solved this, but I don't a board with me. 

    Can you let me know the NAND part used?

  • Hi Renjith,

    I was writing data to NAND blocks 1000 to 1002 using the High Performance DSP Utility Application (HUA) that was shipped with the device. This utility also makes it possible to read from NAND to see if everything was stored correctly.

    Now in my application, platform_device_read() doesn't return Platform_EOK for the second read, so it fails. But platform_errno doesn't get set to PLATFORM_ERRNO_ECC_FAIL. It remains 0.

    So could this be a ECC mismatch nevertheless?

    Best regards,
    Erik

  • Erik,

    If its not returning PLATFORM_ERRNO_ECC_FAIL, I guess you can assume that ECC mismatch may not be the issue. But can you try to write just one page/block at a time and read back and verify? 

    Which is the NAND part that you are using?