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.
Sysconfig only supports 3 Flash model,
Is it possible implementing a new flash driver (S25FL512S) to our custom board? If so, would you please suggest me any source about it?
Thank you.
Hi,
Thanks for your query.
Can you please refer to below developer note and let us know if it helps?
AM243x MCU+ SDK: Writing flash driver for a custom flash device
Regards,
Prasad
Hi Mr. Prasad,
I am trying to run flash diag example, here is console logs. Do you have any suggest?
[OSPI Flash Diagnostic Test] Starting ... [OSPI Flash Diagnostic Test] Flash Manufacturer ID : 0xFF [OSPI Flash Diagnostic Test] Flash Device ID : 0xFFFF [OSPI Flash Diagnostic Test] Executing Flash Erase on first block... [OSPI Flash Diagnostic Test] Done !!! [OSPI Flash Diagnostic Test] Performing Write-Read Test... ERROR: ospi_flash_diag_test_compare_buffers:171: OSPI read data mismatch !!! res_write: -1 res_read: 0 status: -1 Some tests have failed!!
Hi Onur,
Can you share the flash_nor_ospi_quad_device_S25HL512S.c file which you are using for this project ?
Thanks and Regards,
Aakash
Hi Aakash,
I tried three of them. (S28HS512T, S25HL512T, MX25LM25645G)
/* * Copyright (C) 2021 Texas Instruments Incorporated * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, * DATA, OR PROFITS, OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <board/flash.h> Flash_NorXspiDevDefines gFlashNorXspiDeviceDefines_S28HS512T = { .NOR_CMD_SRSTE = 0x66U, .NOR_CMD_SFRST = 0x99U, .NOR_CMD_WREN = 0x06U, .NOR_CMD_WRREG = 0x71U, .NOR_CMD_BULK_ERASE = 0xC7U, .NOR_CMD_BLOCK_ERASE = 0xDCU, .NOR_CMD_RDSR = 0x05U, .NOR_CMD_RDID = 0x9FU, .NOR_CMD_WRITE_VCR = 0x71U, .NOR_CMD_OCTAL_READ = 0xECU, .NOR_CMD_READ = 0x03U, .NOR_CMD_PAGE_PROG = 0x02U, .NOR_CMD_RDREG = 0x65U, .NOR_CMD_OCTAL_PROG = 0x12U, .NOR_CMD_OCTAL_DDR_READ = 0xEEU, .NOR_SR_WIP = (1U << 0U), .NOR_RDID_NUM_BYTES = 0x3U, .NOR_MANF_ID = 0x34U, .NOR_DEVICE_ID = 0x5B1A, .NOR_SINGLE_CMD_READ_DUMMY_CYCLE = 1U, .NOR_OCTAL_READ_DUMMY_CYCLE = 24U, .NOR_OCTAL_READ_DUMMY_CYCLE_LC = 0xBU, .NOR_OCTAL_READ_DUMMY_CYCLE_INDAC = 20U, .NOR_OCTAL_READ_DUMMY_CYCLE_LC_INDAC = 0x8U, .NOR_OCTAL_DDR_CMD_READ_DUMMY_CYCLE = 4U, .NOR_OCTAL_SDR_CMD_READ_DUMMY_CYCLE = 3U, .NOR_WRR_WRITE_TIMEOUT = (600U * 1000U), .NOR_BULK_ERASE_TIMEOUT = (110U * 1000U * 1000U), .NOR_PAGE_PROG_TIMEOUT = 400U, .NOR_VREG_ADDR = 0x800000U, .NOR_CFG2_VREG_ADDR = 0x800003U, .NOR_CFG3_VREG_ADDR = 0x800004U, .NOR_CFG3_NVREG_ADDR = 0x04U, .NOR_PAGE_SIZE = 256U, }; #define FLASH_SIZE (64U * 1024U * 1024U) #define FLASH_BLOCK_SIZE (256U * 1024U) #define FLASH_PAGE_SIZE (256U) #define FLASH_NUM_BLOCKS (FLASH_SIZE / FLASH_BLOCK_SIZE) #define FLASH_NUM_PAGES_PER_BLOCK (FLASH_BLOCK_SIZE / FLASH_PAGE_SIZE) Flash_Attrs gFlashNorXspiAttrs_S28HS512T = { .deviceId = 0, /* filled by Flash_open, after querying the flash */ .manufacturerId = 0, /* filled by Flash_open, after querying the flash */ .driverInstance = 0, /* filled by SysConfig */ .flashSize = FLASH_SIZE, .blockCount = FLASH_NUM_BLOCKS, .blockSize = FLASH_BLOCK_SIZE, .pageCount = FLASH_NUM_PAGES_PER_BLOCK, .pageSize = FLASH_PAGE_SIZE, .sectorSize = 0, /* NOT USED */ .sectorCount = 0, /* NOT USED */ };
Hi Onur,
I see that the data is not correctly read. Can you check some of the settings like pinmux, pull-up settings ?
If all looks good, then I suspect this to be hardware issue. Can you probe them and give us waveform data ?
Best Regards,
Aakash
Hi Onur,
Can you share the data in Tx and data read in Rx ? Is it some cycles delay which is not correctly configured ?
Thanks and Regards,
Aakash
Hi Aakash,
I think, I cannot read anything because as you can see, Manufacturer and Device id are 0xFF
This Flash works as 133MHz, isn't that a problem? Because S25HL512S is 200MHz.
Hi Onur,
Just to confirm that the HW connections are okay, can you probe these lines while running the ospi_flash_diag example and send us the waveform data? You can use the CS as the trigger.
CLK
D0/MISO
D1/MOSI
CS
The ospi_flash_diag exampl doesn't use the flash driver or any of the configurations in flash_nor_ospi_quad*.c file. It uses a minimal standard command set in 1s mode, which works with almost all flashes in reset configuration. If the data being read was random value / byte-shifted correct value I could have suggested some SW changes to try out, but even the JEDEC ID read is all Fs. This could mean mostly two things:
1. There is an issue in the HW connection. Resistor on data line burned out, or soldered not properly that sort of thing. Even the chip select might not be going low. So lines are always pulled high and you're reading FF.
2. Reset configuration of the flash is not 1s-1s-1s. This is easy enough to check in the datasheet of the flash. If this is the case, then we need to see what configuration the flash is in, and manually write a flash open function to configure the driver to communicate to the flash's current state.
Either way, the OSPI lines probe would be helpful, so please let me know when that can be given.
Regards,
Anand M
Hi Anand,
I as said before, we decide to use default FLASH.
Thank you for your help.
Hi Onur,
Can you share the flash_nor_qspi.c, flash_nor_qspi.h, flash_nor_qspi_device_S25FL512S.c.
Also, Can you check on the pinmux settings for QSPI. The am243x-lp has a qspiflash and we have configured for the same. I suggest you to check that syscfg and pin mux settings.
If you could share the schematic of how am243x is interfaced with S25FL512S. That would also be really helpful.
Best Regards,
Aakash