Other Parts Discussed in Thread: SYSCONFIG, UNIFLASH
Hello,
I have encountered problem when trying to create custom flash driver using this guide:
AM243x MCU+ SDK: Writing flash driver for a custom flash device
STEP 1:
The AM2434 is using the IS25PL080D flash memory. I have run the ospi_flash_diag example and gotten this information:
[OSPI Flash Diagnostic Test] Starting
[OSPI Flash Diagnostic Test] Flash Manufacturer ID : 0x9D
[OSPI Flash Diagnostic Test] Flash Device ID : 0x6014
[OSPI Flash Diagnostic Test] Executing Flash Erase on first block...
[OSPI Flash Diagnostic Test] Done !!!
[OSPI Flash Diagnostic Test] Performing Write-Read Test...
[OSPI Flash Diagnostic Test] Write-Read Test Passed!
[OSPI Flash Diagnostic Test] SFDP Information :
================================================
SFDP
================================================
SFDP Major Revision : 0x1
SFDP Minor Revision : 0x6
Number of Parameter Headers in this Table : 1
Types of Additional Parameter Tables in this flash
---------------------------------------------------
Flash_NorXspiDevDefines gFlashNorXspiDeviceDefines_<part-number> = {
.XSPI_NOR_CMD_RSTEN = 0x66,
.XSPI_NOR_CMD_RSTMEM = 0x99,
.XSPI_NOR_CMD_WREN = 0x06,
.XSPI_NOR_CMD_WRREG = 0x00,
.XSPI_NOR_CMD_BULK_ERASE = 0xC7,
.XSPI_NOR_CMD_SECTOR_ERASE_3B = 0x20,
.XSPI_NOR_CMD_SECTOR_ERASE_4B = 0x20,
.XSPI_NOR_CMD_BLOCK_ERASE_3B = 0xD8,
.XSPI_NOR_CMD_BLOCK_ERASE_4B = 0xD8,
.XSPI_NOR_CMD_PAGE_PROG_3B = 0x02,
.XSPI_NOR_CMD_PAGE_PROG_4B = 0x00,
.XSPI_NOR_CMD_RDSR = 0x05,
.XSPI_NOR_CMD_RDREG = 0x00,
.XSPI_NOR_CMD_RDID = 0x9F,
.XSPI_NOR_CMD_READ = 0x03,
.XSPI_NOR_CMD_888_SDR_READ = 0x00,
.XSPI_NOR_CMD_888_DDR_READ = 0x00,
.XSPI_NOR_CMD_444_SDR_READ = 0xEB,
.XSPI_NOR_CMD_444_DDR_READ = 0x00,
.XSPI_NOR_CMD_114_READ = 0x6B,
.XSPI_NOR_SR_WIP = 0,
.XSPI_NOR_SR_WEL = 0,
.XSPI_NOR_RDID_NUM_BYTES = 5,
.XSPI_NOR_MANF_ID = 0x9D,
.XSPI_NOR_DEVICE_ID = 0x6014,
.XSPI_NOR_114_READ_MODE_CLKS = 0,
.XSPI_NOR_114_READ_DUMMY_CYCLES = 8,
.XSPI_NOR_444_READ_MODE_CLKS = 2,
.XSPI_NOR_444_READ_DUMMY_CYCLES = 4,
.XSPI_NOR_444_READ_DUMMY_CYCLES_LC = 0x00,
.XSPI_NOR_QUAD_CMD_READ_DUMMY_CYCLES = 0x00,
.XSPI_NOR_OCTAL_READ_DUMMY_CYCLE = 0,
.XSPI_NOR_OCTAL_READ_DUMMY_CYCLE_LC = 0x00,
.XSPI_NOR_OCTAL_DDR_RDSR_DUMMY_CYCLE = 0,
.XSPI_NOR_OCTAL_DDR_RDREG_ADDR_BYTES = 0,
.XSPI_NOR_OCTAL_DDR_WRREG_ADDR_BYTES = 0,
.XSPI_NOR_OCTAL_DDR_RDVREG_DUMMY_CYCLE = 0,
.XSPI_NOR_OCTAL_DDR_RDNVREG_DUMMY_CYCLE = 0,
.XSPI_NOR_OCTAL_RDSFDP_DUMMY_CYCLE = 0,
.XSPI_NOR_OCTAL_RDSFDP_ADDR_TYPE = 0,
.XSPI_NOR_WRR_WRITE_TIMEOUT = 2000,
.XSPI_NOR_BULK_ERASE_TIMEOUT = 2048000,
.XSPI_NOR_PAGE_PROG_TIMEOUT = 200,
.XSPI_NOR_VREG_OFFSET = 0x0,
.XSPI_NOR_NVREG_OFFSET = 0x0,
.XSPI_NOR_QUAD_MODE_CFG_ADDR = 0x0,
.XSPI_NOR_QUAD_MODE_CFG_BIT_LOCATION = 0x0,
.XSPI_NOR_DDR_OCTAL_MODE_CFG_ADDR = 0x0,
.XSPI_NOR_DDR_OCTAL_MODE_CFG_BIT_LOCATION = 0x0,
.XSPI_NOR_DUMMY_CYCLE_CFG_ADDR = 0x0,
.XSPI_NOR_FLASH_SIZE = 1048576,
.XSPI_NOR_PAGE_SIZE = 256,
.XSPI_NOR_BLOCK_SIZE = 65536,
.XSPI_NOR_SECTOR_SIZE = 4096,
.addrByteSupport = 0,
.dtrSupport = 0,
.qeType = 2,
.seq444Enable = { 0, 0, 1, 0, 0 },
.seq444Disable = { 0, 1, 0, 1 },
.oeType = 0,
.cmdExtType = 0,
.byteOrder = 0,
};
STEP 2:
Following the guide in step 2. I have copied the flash_nor_ospi_quad_device_S25HL512T.c file modified it and renamed it to flash_nor_ospi_quad_device_IS25PL080D.c and added to flash_nor_ospi_quad.h :
extern Flash_NorQspiDevDefines gFlashNorQspiDeviceDefines_IS25PL080D;
extern Flash_Attrs gFlashNorQspiAttrs_IS25PL080D;
And made changes to makefile and flash JS file to include these changes.
After completing the steps and building the example project ospi_flash_io I have recieved this error:
undefined first referenced
symbol in file
--------- ----------------
gFlashNorQspiAttrs_IS25PL080D ./syscfg/ti_board_open_close.o
gFlashNorQspiDeviceDefines_IS25PL080D ./syscfg/ti_board_open_close.o
So instead I have modified the file flash_nor_ospi_quad_device_S25HL512T.c to match my type of flash. Using this method the project was built completely.
STEP 3:
SFDP table was used to modify the file flash_nor_ospi_quad_device_S25HL512T.c
STEP 4:
When running the example OSPI Flash I/O example the program is stuck in "infinite" loop which it doesnt exit.
Because it fails on this condition
So my questions are:
Is there something I have missed when trying to add custom flash driver? (desc. in Step 2)
Can you edit existing flash driver? (eg. flash_nor_ospi_quad_device_S25HL512T.c)
If yes, why does the flash I/O example get stuck in the while loop?
Thank you very much for your help.
Dominik Ondra