tmedicci opened a new pull request, #17211:
URL: https://github.com/apache/nuttx/pull/17211

   ## Summary
   
   * arch/risc-v/espressif/i2s: Fix common driver issues
   
   Refactor of the I2S common driver for Espressif's RISC-V SoCs. Previously, 
the peripheral was not working as expected, reported 
[here](https://github.com/apache/nuttx/pull/16914#issuecomment-3234652770).
   
   Along with the new I2S character driver interfaces 
([here](https://github.com/apache/nuttx/pull/16914)), this new I2S lower-half 
driver can be easily tested using internal loopback between the transmitter and 
receiver channels.
   
   ## Impact
   
   Impact on user: It fixes a known bug of the I2S peripheral for Espressif's 
SoCs (RISC-V only, for now).
   
   Impact on build: No.
   
   Impact on hardware: Impacts Espressif's RISC-V-based devices (ESP32-C3, 
ESP32-C6 and ESP32-H2).
   
   Impact on documentation: No.
   
   Impact on security: No.
   
   Impact on compatibility: No.
   
   ## Testing
   
   This can be tested by attaching the I2S transmitter and receiver pins 
internally, using the loopback mode of the `i2schar` testing application.
   
   ### Building
   
   #### ESP32-C3
   
   ```
   make -j distclean && ./tools/configure.sh esp32c3-generic:i2schar && 
kconfig-tweak --set-val ESPRESSIF_I2S0_DINPIN 8 && kconfig-tweak --set-val 
ESPRESSIF_I2S0_DOUTPIN 8 && kconfig-tweak --set-val EXAMPLES_I2SCHAR_BUFSIZE 
6144 && make olddefconfig && make flash ESPTOOL_PORT=/dev/ttyUSB0 && picocom -b 
115200 /dev/ttyUSB0
   ```
   
   #### ESP32-C6
   
   ```
   make -j distclean && ./tools/configure.sh esp32c6-devkitc:i2schar && 
kconfig-tweak --set-val ESPRESSIF_I2S0_DINPIN 8 && kconfig-tweak --set-val 
ESPRESSIF_I2S0_DOUTPIN 8 && kconfig-tweak --set-val EXAMPLES_I2SCHAR_BUFSIZE 
6144 && make olddefconfig && make flash ESPTOOL_PORT=/dev/ttyUSB0 && picocom -b 
115200 /dev/ttyUSB0
   ```
   
   #### ESP32-H2
   
   ```
   make -j distclean && ./tools/configure.sh esp32h2-devkit:i2schar && 
kconfig-tweak --set-val ESPRESSIF_I2S0_DINPIN 8 && kconfig-tweak --set-val 
ESPRESSIF_I2S0_DOUTPIN 8 && kconfig-tweak --set-val EXAMPLES_I2SCHAR_BUFSIZE 
6144 && make olddefconfig && make flash ESPTOOL_PORT=/dev/ttyUSB0 && picocom -b 
115200 /dev/ttyUSB
   ```
   
   ### Running
   
   Please run `i2schar -l`, which sends a known buffer through the I2S 
transmitter, captures the same buffer on the receiver, and finally compares 
them.
   
   ### Results
   
   ```
   nsh> i2schar -l
   i2schar_main: TX data width: 16 bits
   i2schar_prepare_tx_buffer: Prepared transmitter buffer with 16-bit data
   i2schar_main: Loopback mode enabled
   i2schar_main: Start receiver thread
   i2schar_main: Start transmitter thread
   i2schar_receiver: Using allocated buffer for loopback verification
   i2schar_main: Waiting for the transmitter thread
   i2schar_receiver: Received buffer 1
   i2schar_receiver: Received data (first 16 bytes): 0x00 0x00 0x01 0x00 0x02 
0x00 0x03 0x00 0x04 0x00 0x05 0x00 0x06 0x00 0x07 0x00 
   i2schar_receiver: Loopback verification PASSED - data matches expected
   i2schar_transmitter: Send buffer 1
   i2schar_main: Waiting for the receiver thread
   nsh> 
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to