This patch replaces SPI flash mount procedure with generic SPI API. This
patch also try to format the external flash on the first mount failure,
in case of empty or invalid flash content is present on the external SPI
flash.
Signed-off-by: Yilin Sun <imi415@imi.moe>
This patch changed SPI initialization API to standard RT-Thread SPI API.
The current code contains a minor bug which does not wait for WiFi
module ready before stack initialization, this is also fixed.
Signed-off-by: Yilin Sun <imi415@imi.moe>
* bsp: nxp/mcx/mcxn: SPI: Added missing bracket and re-format code.
The closing bracket is missing from SPI6 struct.
Introduced since commit fc1cfd6d36 .
Use standard rt_spi_device->cs_pin instead of user_data pointer.
---------
Signed-off-by: Yilin Sun <imi415@imi.moe>
* [bsp][nxp] add missing drv_spi.h
Otherwise when building spi users such as u8g2, gcc will complain can't
find the drv_spi.h.
* [bsp][nxp] enable spi6
* [bsp][nxp] add spi sample code which uses spi6 to loopback
Connect spi6's MISO <--> MSIO, I.E P3_20 and P3_22 with Dupont Line
The sample usage and output would be:
msh >spi_sample
spi rbuf : 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
spi loopback mode test over!
/usr/lib/gcc/arm-none-eabi/13.2.1/../../../arm-none-eabi/bin/ld: rt-thread/bsp/nxp/mcx/mcxn/Libraries/drivers/drv_spi.o: in function `spixfer':
rt-thread/bsp/nxp/mcx/mcxn/Libraries/drivers/drv_spi.c:150:(.text.spixfer+0x102): undefined reference to `LPSPI_MasterTransferEDMA'
/usr/lib/gcc/arm-none-eabi/13.2.1/../../../arm-none-eabi/bin/ld: rt-thread/bsp/nxp/mcx/mcxn/Libraries/drivers/drv_spi.c:160:(.text.spixfer+0x16c): undefined reference to `LPSPI_MasterTransferEDMA'
/usr/lib/gcc/arm-none-eabi/13.2.1/../../../arm-none-eabi/bin/ld: rt-thread/bsp/nxp/mcx/mcxn/Libraries/drivers/drv_spi.o: in function `rt_hw_spi_init':
rt-thread/bsp/nxp/mcx/mcxn/Libraries/drivers/drv_spi.c:211:(.text.rt_hw_spi_init+0x22e): undefined reference to `LPSPI_MasterTransferCreateHandleEDMA'