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