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.
Dear Champs,
My customer is developed their custom board using AM2432ALX(11x11mm) package and trying to build custom flash driver for their flash memory by referring below.
Their flash memory is w25g32jv.
They succeed to get below logs.
[OSPI Flash Diagnostic Test] Starting ... |
But, in stet 4, they failed to build caused below error.
~~~~~~~~~
Building file: "syscfg/ti_board_open_close.c"
Invoking: Arm Compiler
"D:/ti/ccs1100/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang.exe" -c -mcpu=cortex-r5 -mfloat-abi=hard -mfpu=vfpv3-d16 -mlittle-endian -I"D:/ti/ccs1100/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/include/c" -I"D:/ti/mcu_plus_sdk_am243x_08_01_00_36/source" -DSOC_AM243X -D_DEBUG_=1 -gstrict-dwarf -g -Wall -Wno-gnu-variable-sized-type-not-at-end -Wno-unused-function -MMD -MP -MF"syscfg/ti_board_open_close.d_raw" -MT"syscfg/ti_board_open_close.o" -I"D:/workspace_v11/ospi_flash_io_am243x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/syscfg" -o"syscfg/ti_board_open_close.o" "syscfg/ti_board_open_close.c"
subdir_rules.mk:30: recipe for target 'syscfg/ti_board_open_close.o' failed
syscfg/ti_board_open_close.c:68:19: error: use of undeclared identifier 'gFlashNorQspiAttrs_W25Q32JV'; did you mean 'gFlashNorQspiAttrs_S25HL512T'?
.attrs = &gFlashNorQspiAttrs_W25Q32JV,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
gFlashNorQspiAttrs_S25HL512T
~~~~~~~~~~~~
So, they are trying to build flash driver for their custom flash memory by referring below.
But, they could not find which files are related with qspi flash in the make file as below.
~~~~~~~~~~
at \mcu_plus_sdk_am243x_08_01_00_36\source\board\makefile.am243x.r5f.ti-arm-clang
FILES_common := \
eeprom.c \
eeprom_at24c.c \
ethphy.c \
ethphy_dp83869.c \
flash.c \
flash_nor_ospi.c \
flash_nor_ospi_device_MX25LM25645G.c \
flash_nor_xspi.c \
flash_nor_xspi_device_S28HS512T.c \
flash_nor_ospi_quad.c \
flash_nor_ospi_quad_device_S25HL512T.c \
led.c \
led_gpio.c \
led_tpic2810.c \
led_ioexp.c \
ioexp_tca6424.c \
~~~~~~~~
They find flash_nor_qspi.c and flash_nor_qspi_device_MX25V1635F.c files in the '\mcu_plus_sdk_am243x_08_01_00_36\source\board\flash\' folder, and they added these files in to makefile.
When they build it again with this new makefile, they faced below error.
~~~~~
FILES_common := \
.....
flash_nor_qspi.c \
# flash_nor_qspi_device_W25Q32JV.c \
flash_nor_qspi_device_MX25V1635F.c \
.~~~~~~
D:\ti\mcu_plus_sdk_am243x_08_01_00_36>gmake -s libs PROFILE=release
Compiling: board.am243x.r5f.ti-arm-clang.release.lib: eeprom/eeprom.c
Compiling: board.am243x.r5f.ti-arm-clang.release.lib: eeprom/eeprom_at24c.c
Compiling: board.am243x.r5f.ti-arm-clang.release.lib: ethphy/ethphy.c
Compiling: board.am243x.r5f.ti-arm-clang.release.lib: ethphy/ethphy_dp83869.c
Compiling: board.am243x.r5f.ti-arm-clang.release.lib: flash/flash.c
Compiling: board.am243x.r5f.ti-arm-clang.release.lib: flash/flash_nor_ospi.c
Compiling: board.am243x.r5f.ti-arm-clang.release.lib: flash/flash_nor_ospi_device_MX25LM25645G.c
Compiling: board.am243x.r5f.ti-arm-clang.release.lib: flash/flash_nor_qspi.c
flash/flash_nor_qspi.c:58:30: error: unknown type name 'QSPI_Handle'; did you mean 'OSPI_Handle'?
int32_t QSPI_norFlashCmdRead(QSPI_Handle handle, uint8_t cmd, uint32_t cmdAddr, uint8_t *rxBuf, uint32_t rxLen)
^~~~~~~~~~~
OSPI_Handle
D:/ti/mcu_plus_sdk_am243x_08_01_00_36/source\drivers/ospi/v0/ospi.h:73:15: note: 'OSPI_Handle' declared here
typedef void *OSPI_Handle;
~~~~~~~~~~
But, they could not find where 'QSPI_Handle' was defined.
Could you please help them to build flash driver for their custom flash memory?
they found only 4 flash types defined in the "ti\mcu_plus_sdk_am243x_08_01_00_36\source\board\flash" folder as below.
What are XSPI and ospi_quad in below?
- ospi : Octal SPI
- ospi_quad : ?
- qspi : Quad spi
- xspi : ?
Thanks and Best Regards,
SI.
Hi SI,
I can't get to the link you shared for the instructions. Are they same as the instructions here? https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_02_00_31/exports/docs/api_guide_am243x/CUSTOM_FLASH_SUPPORT_GUIDE.html
But, in stet 4, they failed to build caused below error.
Are they failing in Step 4, or Step 2? This is Step 2: https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_02_00_31/exports/docs/api_guide_am243x/CUSTOM_FLASH_SUPPORT_GUIDE.html#autotoc_md259
"Confirm that the files build and the new flash device is selectable in sysconfig. We can now update the files according to the new flash device"
How did they implement file files for the new Winbond device? Did they start by copying an existing set of files in <SDK>\mcu_plus_sdk_am243x_08_02_00_31\source\board\flash? If so, which set of files did they copy?
Regards,
Frank
Hi Frank,
I can't get to the link you shared for the instructions. Are they same as the instructions here? https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_02_00_31/exports/docs/api_guide_am243x/CUSTOM_FLASH_SUPPORT_GUIDE.html
Yes. your link is right.
Are they failing in Step 4, or Step 2? This is Step 2: https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_02_00_31/exports/docs/api_guide_am243x/CUSTOM_FLASH_SUPPORT_GUIDE.html#autotoc_md259
They are failing in Step4.
How did they implement file files for the new Winbond device? Did they start by copying an existing set of files in <SDK>\mcu_plus_sdk_am243x_08_02_00_31\source\board\flash? If so, which set of files did they copy?
This is what I'm asking. which files they should modify for QSPI of AM2432ALX package?
They copied 'flash_nor_qspi.c' and 'flash_nor_qspi_device_MX25V1635F.c', and modify it.
But, they faced an error of 'unknown type name 'QSPI_Handle''.
Thanks and Best Regards,
SI.
Hi SI,
I can clear the confusion here. The terminology we have used here arose from the fact that we had to support Quad flashes and Octal flashes using the OSPI driver in AM243x.
flash_nor_ospi - tailor made flash driver only for the MXxx flash device to support the macronix flash out of box
flash_nor_ospi_quad - flash driver based on OSPI driver but designed to support Quad flashes (From your use case, I think you'll have to make the changes here)
flash_nor_xspi - flash driver designed to support Octal flashes which obey the JEDEC xSPI protocol
I recommend that you can create a file flash_nor_ospi_quad_device_W25Q32JV.c similar to flash_nor_ospi_quad_device_S25HL512T.c file and change the parameters depending on the SFDP output. Any functional changes you can make in the flash_nor_ospi_quad.c file. Do not use the flash_nor_qspi.c files in the AM243x makefile. They're based on a different QSPI driver which is not part of AM243x, that's why it is excluded from the makefile.
Let me know any more help is required.
Regards,
Anand Mahadevan SS
Hi Anand,
Thanks for the clarification.
Their serial qspi flash memory is W25Q32JV and failed to build it with osp_quad file because they can not find some fields like NOR_CMD_WRREG and NOR_CMD_RDREG as below.
When they added these values to '00', they failed to run Flash_Open() and it was hang at this function.
~~~~
.NOR_CMD_SRSTE = 0x66U, // Enable Reset
.NOR_CMD_SFRST = 0x99U, // Reset Device
.NOR_CMD_WREN = 0x06U, // write enable
.NOR_CMD_WRREG = 0x00U, // 0x71 -> 00, not exist
...
.NOR_CMD_RDREG = 0x00U, // 0x65 -> 00, ?
~~~~
Could you please help where these values -NOR_CMD_WRREG, NOR_CMD_RDREG - can be extracted from Winbond serial flash memory datasheet in below?
https://www.winbond.com/resource-files/W25Q32JV%20RevI%2005042021%20Plus.pdf
Thanks and Best Regards,
SI.
Hi SI,
I'm not familiar with the SFDP spec, or the S25HL512T / W25Q32JV flash memories.
In the W25Q32JV datasheet, I notice there are three status/configuration registers, see 6.1 Status Registers.
Each status/config register has a separate read/write command, see:
The NOR_CMD_RDSR command (0x05) output by the Diagostics program seems to map to the Read Status Register-1 (05h) command on the W25Q32JV.
Looking through source/board/flash/flash_nor_ospi_quad.c, I see only a single read register command is used:
<SDK>/source/board/flash/flash_nor_ospi_quad.c:141: cmd = devDefines->NOR_CMD_RDREG;
Similarly, only a single write register command is used:
<SDK>/source/board/flash/flash_nor_ospi_quad.c:165: cmd = devDefines->NOR_CMD_WRREG;
<SDK>/source/board/flash/flash_nor_ospi_quad.c:218: cmd = devDefines->NOR_CMD_WRREG;
<SDK>/source/board/flash/flash_nor_ospi_quad.c:287: cmd = devDefines->NOR_CMD_WRREG;
Thus, I don't know how the driver can read/write all status/config registers.
I assume the hang occurs somewhere in the driver code. Where does the hang occur? Is it on a read register or write register command? Which register is the driver attempting to read or write?
Anand, can you please comment?
Regards,
Frank
Hi SI, Frank,
The confusion is probably because of the fundamental differences in the config register structures between the cypress and winbond flash. Cypress flash has several configuration registers, and are read using specific register read and write commands (0x71, 0x65 etc) and could be changed accordingly. This is not the case with winbond flash. It uses multiple status registers to achieve similar functionality. So in this case some of the helper functions need to be omitted from the flash driver code. I can provide a step by step solution to enable the winbond flash, if you let me know which QSPI mode do you plan to operate:
1-1-4 or 4-4-4
Also, like Frank asked, which exact function did it hang?
Regards,
Anand Mahadevan SS