Read the articles...
To install the SPI Test Driver in your NuttX project...
-
Copy the files...
To the folder
nuttx/drivers/rf -
Update the NuttX Build Config...
## TODO: Change this to the path of our "incubator-nuttx" folder cd nuttx/nuttx ## Preserve the Build Config cp .config ../config ## Erase the Build Config and Kconfig files make distclean ## For BL602: Configure the build for BL602 ./tools/configure.sh bl602evb:nsh ## For ESP32: Configure the build for ESP32. ## TODO: Change "esp32-devkitc" to our ESP32 board. ./tools/configure.sh esp32-devkitc:nsh ## Restore the Build Config cp ../config .config ## Edit the Build Config make menuconfig
-
In menuconfig...
-
Enable the SPI Port (SPI0)
-
Enable the SPI Character Driver
-
Enable the SPI Test Driver
As explained here...
-
-
Edit the function
bl602_bringuporesp32_bringupin this file...## For BL602: nuttx/boards/risc-v/bl602/bl602evb/src/bl602_bringup.c ## For ESP32: Change "esp32-devkitc" to our ESP32 board nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_bringup.cAnd call
spi_test_driver_registerto register our SPI Test Driver. -
The SPI Test Driver is accessible by NuttX Apps as "
/dev/spitest0"