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.

AM2432: erase or program nand chip failed through GPMC

Part Number: AM2432

Tool/software:

SDK: mcu_plus_sdk_am243x_09_02_01_05
CCS: 12.7.0.00007 

chip: am2432ALV

example: C:\ti\mcu_plus_sdk_am243x_09_02_01_05\examples\drivers\gpmc\gpmc_flash_io

nand: MT29F4G08ABBFAH4-AATF

We used the gpmc_io demo to test our nand chip. This same nand chip(MT29F4G08ABBFAH4-AATF) tested well in our another project with gpmc_flash_io in mcu_plus_sdk_am64x_09_00_00_35

While we run on AM2432 with mcu_plus_sdk_am243x_09_02_01_05\examples\drivers\gpmc\gpmc_flash_io, it failed.

Debugging with TDMSEMU110-U, Flash_open() executed correctly, we can get devID(0000AC80) and manID(0000002C). I adapted test code according to them.

But, it executed failed at Flash_eraseBlk()

Debugging with TDMSEMU110-U, it executed at Flash_nandGpmcErase->GPMC_writeNandCommand, the exact points are below, status is SystemP_FAILURE

status += GPMC_waitPinInteruptStatusReadyWaitTimeout(handle,cmdParams->waitTimeout);
status += GPMC_waitPinStatusReadyWaitTimeout(handle, GPMC_WAIT_PIN_STATUS_WAIT_TIME_MIN);

The API Flash_open()  also called GPMC_writeNandCommand() and executed well, so in my opinion, the hardware is ok.

There are some difference between am243x_sdk and am64x_adk, are there any parameters need to be changed?? 

Waiting for your reply, thanks.

Codes of demo are below:

/* FLASH Attrs */
Flash_Attrs gFlashAttrs_MT29F8G08ADAFAH4 =
{
.flashName = "MT29F8G08ADAFAH4",
// .deviceId = 0xD3D0,
.deviceId = 0xAC80, // test with MT29F4G08ABBFAH4 on mockup board
.manufacturerId = 0x2C,
// .flashSize = 1073741824, // 1GB/8Gb
.flashSize =536870912, // 512MB/4Gb
.blockCount = 4096, // two plane
// .blockSize = 262144, // 256K(two plane)
.blockSize = 131072, // 128K
.pageCount = 64,
// .pageSize = 4096,
.pageSize = 2048, // for MT29F4G08ABBFAH4
// .spareAreaSize = 256,
.spareAreaSize = 512,
};

void gpmc_flash_io_main(void *args)
{
int32_t status = SystemP_SUCCESS;
uint32_t offset;
uint32_t blk, page;
Flash_Attrs *flashAttrs;
uint32_t i;

/* Open GPMC Driver, among others */
Drivers_open();
/* Open Flash drivers with GPMC instance as input */
status = Board_driversOpen();
DebugP_assert(status==SystemP_SUCCESS);

status = Board_flashOpen();
DebugP_assert(status==SystemP_SUCCESS);

flashAttrs = Flash_getAttrs(CONFIG_FLASH0);

/* Fill buffers with known data,
* find block number from offset,
* erase block, write the data, read back from a specific offset
* and finally compare the results.
*/
offset = APP_GPMC_FLASH_OFFSET_BASE;
gpmc_flash_io_fill_buffers();
Flash_offsetToBlkPage(gFlashHandle[CONFIG_FLASH0], offset, &blk, &page);

status = Flash_eraseBlk(gFlashHandle[CONFIG_FLASH0], blk);
DebugP_assert(status==SystemP_SUCCESS);

status = Flash_write(gFlashHandle[CONFIG_FLASH0], offset, gGpmcTxBuf, APP_GPMC_DATA_SIZE);
DebugP_assert(status==SystemP_SUCCESS);

for(i=0;i<128;i++)
{
DebugP_log(" %X ",gGpmcTxBuf[i]);
}
DebugP_log("\r\n");

status = Flash_read(gFlashHandle[CONFIG_FLASH0], offset, gGpmcRxBuf, APP_GPMC_DATA_SIZE);
DebugP_assert(status==SystemP_SUCCESS);

for(i=0;i<128;i++)
{
DebugP_log(" %X ",gGpmcRxBuf[i]);
}
status |= gpmc_flash_io_compare_buffers();
DebugP_assert(status==SystemP_SUCCESS);

offset = APP_GPMC_FLASH_OFFSET_BASE + (flashAttrs->blockSize*2048);
gpmc_flash_io_fill_buffers();
Flash_offsetToBlkPage(gFlashHandle[CONFIG_FLASH0], offset, &blk, &page);
Flash_eraseBlk(gFlashHandle[CONFIG_FLASH0], blk);
Flash_write(gFlashHandle[CONFIG_FLASH0], offset, gGpmcTxBuf, APP_GPMC_DATA_SIZE);
Flash_read(gFlashHandle[CONFIG_FLASH0], offset, gGpmcRxBuf, APP_GPMC_DATA_SIZE);
status |= gpmc_flash_io_compare_buffers();

if(SystemP_SUCCESS == status)
{
DebugP_log("All tests have passed!!\r\n");
}
else
{
DebugP_log("Some tests have failed!!\r\n");
}

Board_flashClose();
Board_driversClose();
Drivers_close();
}

BRs

Ronny