Junbo-Zheng opened a new pull request, #21541:
URL: https://github.com/apache/nuttx/pull/21541

   
   
   ## Summary
   
   This PR adds support for the [M5StickC 
Plus](https://docs.m5stack.switch-science.com/en/core/StickC-Plus),
   an ESP32-PICO-D4 based development kit with a 1.14 inch 135x240 ST7789V2
   LCD, an AXP192 PMIC, a BM8563 RTC, an MPU6886 IMU, a passive buzzer, a
   red LED and two user buttons.
   
   It is composed of five commits:
   
   - `drivers/timers: Write pcf8563 registers as a single I2C message` --
     the pcf8563 driver issued each register write as two I2C messages with
     the second flagged `I2C_M_NOSTART`; the ESP32 I2C controller
     terminates every message with a STOP and cannot continue a transfer
     that way, so no register write could succeed on ESP32. The write is
     now a single regaddr+data message, which every I2C controller accepts.
   - `sensors/mpu6050: Support the register-compatible MPU6886` -- the TDK
     MPU6886 shares the MPU6050 register layout and only differs in its
     WHO_AM_I value (0x19) and its temperature transfer function; the
     driver now accepts it and uses per-part temperature parameters.
     Existing MPU6050 behaviour is unchanged.
   - `boards/xtensa/esp32: Guard the ST7789 backlight GPIO with
     DISPLAY_BCKL` -- boards whose LCD backlight is powered from a PMIC
     rail instead of a GPIO do not define `DISPLAY_BCKL`, which made the
     common esp32_st7789 glue fail to compile for them.
   - `boards/xtensa/esp32: Add support for M5StickC Plus` -- the board
     itself. The nsh configuration enables the ST7789 LCD through the
     lcd_framebuffer layer (/dev/fb0), brings up the AXP192 LCD rails,
     binds the BM8563 as the system RTC through the register-compatible
     PCF8563 driver, serves the MPU6886 through the MPU6050 uORB driver,
     and mounts littlefs on the SPI flash (2.5 MB) at /data.
   - `xtensa:esp32: Add docs for the M5StickC Plus board` -- the board
     documentation page under Documentation/.
   
   ## Impact
   
   - **Users**: none -- additive; no existing board, driver or API changes
     behaviour.
   - **Build**: none -- the pcf8563 and mpu6050 changes are
     self-contained; the st7789 change is compile-time only and boards
     that define DISPLAY_BCKL build exactly as before.
   - **Hardware**: new board `esp32-m5-stickc-plus` (ESP32-PICO-D4);
     touches drivers/timers/pcf8563.c, drivers/sensors/mpu6050_uorb.c and
     boards/xtensa/esp32/common/src/esp32_st7789.c as described above.
   - **Documentation**: adds the board page
     Documentation/platforms/xtensa/esp32/boards/esp32-m5-stickc-plus/.
   - **Security & Compatibility**: none.
   
   ## Testing
   
   Built and verified on hardware (M5StickC Plus, serial console on
   UART0 via the on-board FT232 bridge at 115200 8N1, Ubuntu 24.04 host):
   
       $ cmake -B build -DBOARD_CONFIG=esp32-m5-stickc-plus:nsh -G Ninja
       $ cmake --build build -j
       $ python3 -m esptool --chip esp32 --port /dev/ttyUSB0 --baud 115200 \
           --after hard-reset write-flash 0x1000 build/nuttx.bin
   
   (the nsh configuration uses simple boot: no second stage bootloader,
   no partition table, single image at 0x1000)
   
   The legacy flow was also verified:
   `./tools/configure.sh esp32-m5-stickc-plus:nsh && make -j` and
   `make flash ESPTOOL_PORT=/dev/ttyUSB0 ESPTOOL_BAUD=115200 ESPTOOL_BINDIR=./`.
   `tools/checkpatch.sh` passes on all touched C files.
   
   NSH session on the board:
   
       nsh> uname -a
       NuttX 12.13.0 91aa59c9b68 Nov  7 2026 21:42:32 xtensa 
esp32-m5-stickc-plus
   
       nsh> date
       Sat, Nov 07 21:43:03 2026
   
       nsh> ps
         TID   PID  PPID PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK    
        STACK COMMAND
           0     0     0   0 FIFO     Kthread   - Ready              
0000000000000000 0003040 Idle_Task
           2     2     0 100 RR       Task      - Running            
0000000000000000 0003000 nsh_main
   
       nsh> df
         Block    Number
         Size     Blocks       Used   Available Mounted on
         4096        640          2         638 /data
            0          0          0           0 /proc
   
       nsh> mount
         /data type littlefs
         /proc type procfs
   
       nsh> free
             total       used       free      maxused    maxfree  nused  nfree 
name
            319716      74804     244912       75616     182352     70      4 
Umem
   
       nsh> hello
       Hello, World!!
   
       nsh> sensortest -n 2 accel0
       SensorTest: Test /dev/uorb/sensor_accel0 with interval(1000000us), 
latency(0us)
       accel0: timestamp:24250000 x:-0.23 y:0.13 z:10.79, temperature:51.14
       accel0: timestamp:25260000 x:-0.32 y:0.13 z:10.81, temperature:50.77
       SensorTest: Received message: accel0, number:2/2
   
   Additional checks:
   
   - RTC: `date` returns the correct BM8563 time, and the time survives a
     power cycle (the RTC is battery backed and the system time is
     synchronized to it at boot).
   - Storage: a file written to /data survives a hard reset
     (`echo hi > /data/a.txt`, reset, `cat /data/a.txt` returns `hi`).
   - Display: the `fb` example draws on the panel; VideoInfo reports
     240x135 RGB565 as expected for the rotated orientation.
   - LED: the `leds` example toggles the red LED on GPIO10.
   - `sensortest -n 2 gyro0` reports plausible stationary gyroscope
     values.
   
   Signed-off-by: Junbo Zheng <[email protected]>
   


-- 
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