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.

C6748烧写程序到NANDFlash出错

Other Parts Discussed in Thread: OMAP-L138

加载 OMAP-L138_FlashAndBootUtils_2_40 中的 NANDWriter_DSP.pjt 程序,出现如下显示结果:

[C674X_0] Starting OMAP-L138 NANDWriter.
Do you want to global erase NAND flash?y
Enter the binary AIS file name to flash (enter 'none' to skip) :
C:\Users\Administrator\Desktop\CCS_doc\SKB9000_V1_161201\Debug\SKB9000_V1_161201.ais
Number of blocks needed for data: 0x1
Writing image data to block 0x1, page 0x0
Verify failed. Marking block as bad...
Writing image data to block 0x2, page 0x0
Verify failed. Marking block as bad...
Writing image data to block 0x3, page 0x0
Verify failed. Marking block as bad...
Writing image data to block 0x4, page 0x0
Verify failed. Marking block as bad...
Writing image data to block 0x5, page 0x0

............

device_nand.H如下


#define DEVICE_NAND_DATA_OFFSET (0x00000000u)
#define DEVICE_NAND_ALE_OFFSET (0x00000008u)
#define DEVICE_NAND_CLE_OFFSET (0x00000010u)
#define DEVICE_NAND_TIMEOUT (10240)

#define DEVICE_NAND_MAX_BYTES_PER_OP (512) // Max Bytes per operation (EMIF IP constrained)
#define DEVICE_NAND_MAX_SPAREBYTES_PER_OP (8) // Max Spare Bytes per operation
#define DEVICE_NAND_MIN_SPAREBYTES_PER_OP (8) // Min Spare Bytes per operation (ECC operation constrained)

// Defines which NAND blocks the RBL will search in for a UBL image
#define DEVICE_NAND_RBL_SEARCH_START_BLOCK (1)
#define DEVICE_NAND_RBL_SEARCH_END_BLOCK (5)
#define DEVICE_NAND_DSPUBL_SEARCH_START_BLOCK (1)
#define DEVICE_NAND_DSPUBL_SEARCH_END_BLOCK (24)
#define DEVICE_NAND_ARMUBL_SEARCH_START_BLOCK (2)
#define DEVICE_NAND_ARMUBL_SEARCH_END_BLOCK (24)
#define DEVICE_NAND_UBOOT_SEARCH_START_BLOCK (4)
#define DEVICE_NAND_UBOOT_SEARCH_END_BLOCK (24)

// Defines which NAND blocks are valid for writing the APP data
#define DEVICE_NAND_UBL_SEARCH_START_BLOCK (6)
#define DEVICE_NAND_UBL_SEARCH_END_BLOCK (50)

// Defines EMIF type used
#define EMIF_TYPE_NAND (0)
#define DEVICE_EMIF_CS_REGION (3)
#define NAND_BASE_ADDR 0x62000000u

nand.h如下

#if ( defined(__TMS470__) | defined(__GNUC__) )
#define NAND_NUM_BLOCKS_RESERVED_FOR_BBT (4)
#else
#define NAND_NUM_BLOCKS_RESERVED_FOR_BBT (0)
#endif

// NAND flash addresses
#define NAND_DATA_OFFSET DEVICE_NAND_DATA_OFFSET
#define NAND_ALE_OFFSET DEVICE_NAND_ALE_OFFSET
#define NAND_CLE_OFFSET DEVICE_NAND_CLE_OFFSET

// NAND timeout
#define NAND_TIMEOUT DEVICE_NAND_TIMEOUT

// NAND flash commands
#define NAND_LO_PAGE (0x00)
#define NAND_HI_PAGE (0x01)
#define NAND_EXTRA_PAGE (0x50)

#define NAND_LOCK (0x2A)
#define NAND_UNLOCK_START (0x23)
#define NAND_UNLOCK_END (0x24)

#define NAND_READ_PAGE (0x00)
#define NAND_READ_30H (0x30)
#define NAND_RANDOM_READ_PAGE (0x05)
#define NAND_RANDOM_READ_E0H (0xE0)

#define NAND_RDID (0x90)
#define NAND_RDID2 (0x65)
#define NAND_RDIDADD (0x00)

#define NAND_RESET (0xFF)
#define NAND_STATUS (0x70)
#define NAND_RDY (0x40)

#define NAND_PGRM_START (0x80)
#define NAND_RANDOM_PGRM (0x85)
#define NAND_PGRM_END (0x10)
#define NAND_PGM_FAIL (0x01)

#define NAND_BERASEC1 (0x60)
#define NAND_BERASEC2 (0xD0)


// NAND ONFI commands
#define NAND_ONFIRDIDADD (0x20)
#define NANDONFI_STRING (0x49464E4F)
#define NANDONFI_RDPARAMPAGE (0xEC)
#define NANDONFI_

// Status Output
#define NAND_NANDFSR_READY (0x01)
#define NAND_STATUS_WRITEREADY (0xC0)
#define NAND_STATUS_ERROR (0x01)
#define NAND_STATUS_READY (0x40)
#define NAND_STATUS_PROTECTED (0x80)

#define NAND_MAX_PAGE_SIZE (8192)
#define NAND_MAX_BYTES_PER_OP DEVICE_NAND_MAX_BYTES_PER_OP
#define NAND_MIN_SPAREBYTES_PER_OP DEVICE_NAND_MIN_SPAREBYTES_PER_OP // Min Spare Bytes per operation

// Macro gets the page size in bytes without the spare bytes
#define NANDFLASH_PAGESIZE(x) ( ( x >> 8 ) << 8 )