You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "tmedicci (via GitHub)" <gi...@apache.org> on 2026/03/04 14:15:38 UTC

[PR] !arch/risc-v/espressif: Update common-source integration for RISC-V devices [nuttx]

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

   ## Summary
   
   This PR updates the common-source integration for RISC-V-based Espressif devices (ESP32-C3, ESP32-C6, and ESP32-H2). This is part of a
   larger common-source update split by architecture for better maintainability of the already-supported devices and upcoming devices.
   
   Major components updated:
   - IRQ allocator refactoring with intr_alloc integration
   - Common-source drivers (GPIO, RMT, I2C, SPI, UART, etc.)
   - Espressif components upgrade to release/master.b
   - Peripheral drivers (ADC, PWM, LEDC, MCPWM, PCNT, Temperature Sensor, etc.)
   - Wireless adapters (Wi-Fi and BLE)
   - Board defconfigs for all RISC-V Espressif boards
   - Critical section handling improvements
   
   Key architectural changes:
   - IRQ Allocator: The new interrupt allocator enables multiple mapping options from interrupt sources to CPU interrupts, providing flexibility
     required by modern peripherals. Although this introduces breaking changes to the interrupt handling API, the required ARCH_MINIMAL_VECTORTABLE
     Kconfig option is explicitly checked during startup to ensure proper configuration. This validation prevents runtime issues from configuration
     mismatches.
   
   Note: This is a large commit to maintain bisectability. Breaking the changes into smaller commits would result in non-building intermediate
   states across the common-source infrastructure update.
   
   ### Note to the Reviewers:
   
   Although it's a huge PR, reviewing it is not that difficult. Some key points can be summarized here:
   - Peripherals' changes (`nuttx/arch/risc-v/src/common/espressif/`) are mostly related to either path changes and the new IRQ allocator.
   - Exceptions are:
     - The RMT peripheral, which required a refactor to be fully compatible with the new common-source base (deprecated code were removed). Public API's didn't change.
   - `defconfigs` were updated to be compatible with the new IRQ allocator. Although it is a breaking change from user's perspective, the required Kconfig-selectable options are checked at `arch/risc-v/src/common/espressif/esp_irq.c`
   
   ## Impact
   
   Impact on user: Yes, they need to update their defconfig to select the following Kconfig:
   
   ```
   CONFIG_ARCH_IRQ_TO_NDX=y
   CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
   CONFIG_ARCH_NUSER_INTERRUPTS=17
   ``` 
   
   Please note that these options are checked with pre-processor macros, so it can't be "left behind".
   
   Impact on build: Yes. Build will fail if the newer Kconfig aren't selected.
   
   Impact on hardware: Yes. This change is mandatory to support newer Espressif devices on NuttX.
   
   Impact on documentation: No.
   
   Impact on security: No.
   
   Impact on compatibility: Yes, this is a breaking change with minor effects. The missing Kconfig options are checked with pre-processor macros and guides the user to select the required configs.
   
   ## Testing
   
   All Espressif's defconfigs were tested with hardware in the loop. In addition to peripherals' testing, `ostest` is checked too
   
   ### Building
   
   #### Cleaning Existing Builds
   
   ```
   make -j distclean
   ``` 
   
   #### Select either ESP32-C3, ESP32-C6 or ESP32-H2
   
   ##### ESP32-C3
   ```
   ./tools/configure.sh -S esp32c3-devkit:ostest
   ```
   
   ##### ESP32-C6
   ```
   ./tools/configure.sh -S esp32c6-devkitc:ostest
   ```
   
   ##### ESP32-H2
   ```
   ./tools/configure.sh -S esp32h2-devkit:ostest
   ```
   
   #### Building and Flashing
   
   ```
   make flash -s -j$(nproc) && picocom -b 115200 /dev/ttyUSB0
   ```
   
   ### Running
   
   ```
   nsh> ostest
   ```
   
   ### Results
   
   ```
   ostest_main: Exiting with status 0
   ```


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] !arch/risc-v/espressif: Update common-source integration for RISC-V devices [nuttx]

Posted by "simbit18 (via GitHub)" <gi...@apache.org>.
simbit18 commented on PR #18492:
URL: https://github.com/apache/nuttx/pull/18492#issuecomment-3998131679

   @tmedicci 
   
   ===============================================================================```
   =====
   Configuration/Tool: esp32c3-xiao/nimble
   2026-03-04 14:57:07
   ------------------------------------------------------------------------------------
     Cleaning...
     Configuring...
     Building NuttX...
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
   
     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
   
   100 1818k    0 1818k    0     0  2992k      0 --:--:-- --:--:-- --:--:-- 2992k
   In file included from /github/workspace/sources/nuttx/include/arch/irq.h:41,
                    from /github/workspace/sources/nuttx/include/nuttx/irq.h:39,
                    from /github/workspace/sources/nuttx/include/nuttx/fs/fs.h:51,
                    from /github/workspace/sources/nuttx/include/stdio.h:36,
                    from ./hello_main.c:28:
   Error: /github/workspace/sources/nuttx/include/arch/chip/irq.h:226:4: error: #error "CONFIG_ARCH_NUSER_INTERRUPTS is less than ESP_IRQ_DEMUX + 1. Please increase CONFIG_ARCH_NUSER_INTERRUPTS to at least ESP_IRQ_DEMUX + 1."
     226 | #  error "CONFIG_ARCH_NUSER_INTERRUPTS is less than ESP_IRQ_DEMUX + 1. Please increase CONFIG_ARCH_NUSER_INTERRUPTS to at least ESP_IRQ_DEMUX + 1."
         |    ^~~~~
   ```
   
   
   ====================================================================================
   Configuration/Tool: esp32-c3-zero/usbnsh
   2026-03-04 14:57:25
   ------------------------------------------------------------------------------------
     Cleaning...
     Configuring...
     Building NuttX...
   In file included from /github/workspace/sources/nuttx/include/arch/irq.h:41,
                    from /github/workspace/sources/nuttx/include/nuttx/irq.h:39,
                    from /github/workspace/sources/nuttx/include/nuttx/fs/fs.h:51,
                    from /github/workspace/sources/nuttx/include/stdio.h:36,
                    from /github/workspace/sources/apps/include/system/readline.h:31,
                    from ./nsh_init.c:32:
   Error: /github/workspace/sources/nuttx/include/arch/chip/irq.h:226:4: error: #error "CONFIG_ARCH_NUSER_INTERRUPTS is less than ESP_IRQ_DEMUX + 1. Please increase CONFIG_ARCH_NUSER_INTERRUPTS to at least ESP_IRQ_DEMUX + 1."
     226 | #  error "CONFIG_ARCH_NUSER_INTERRUPTS is less than ESP_IRQ_DEMUX + 1. Please increase CONFIG_ARCH_NUSER_INTERRUPTS to at least ESP_IRQ_DEMUX + 1."
         |    ^~~~~
   In file included from /github/workspace/sources/nuttx/include/arch/irq.h:41,
                    from /github/workspace/sources/nuttx/include/nuttx/irq.h:39,
                    from /github/workspace/sources/nuttx/include/nuttx/fs/fs.h:51,
                    from /github/workspace/sources/nuttx/include/stdio.h:36,
                    from ./hello_main.c:28:


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] !arch/risc-v/espressif: Update common-source integration for RISC-V devices [nuttx]

Posted by "simbit18 (via GitHub)" <gi...@apache.org>.
simbit18 commented on PR #18492:
URL: https://github.com/apache/nuttx/pull/18492#issuecomment-3998069790

   Hi @tmedicci , I think you forgot to update all the defconfig for this board esp32-c3-zero
   
   For example
   nsh 
   https://github.com/tmedicci/nuttx/blob/528bdc55b397ee5f68844855ebbe084528688c9d/boards/risc-v/esp32c3/esp32-c3-zero/configs/nsh/defconfig


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] !arch/risc-v/espressif: Update common-source integration for RISC-V devices [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #18492:
URL: https://github.com/apache/nuttx/pull/18492


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] !arch/risc-v/espressif: Update common-source integration for RISC-V devices [nuttx]

Posted by "tmedicci (via GitHub)" <gi...@apache.org>.
tmedicci commented on PR #18492:
URL: https://github.com/apache/nuttx/pull/18492#issuecomment-3998169674

   > @tmedicci
   > 
   > ```
   > ===============================================================================
   > =====
   > Configuration/Tool: esp32c3-xiao/nimble
   > 2026-03-04 14:57:07
   > ------------------------------------------------------------------------------------
   >   Cleaning...
   >   Configuring...
   >   Building NuttX...
   >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
   >                                  Dload  Upload   Total   Spent    Left  Speed
   > 
   >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
   >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
   > 
   > 100 1818k    0 1818k    0     0  2992k      0 --:--:-- --:--:-- --:--:-- 2992k
   > In file included from /github/workspace/sources/nuttx/include/arch/irq.h:41,
   >                  from /github/workspace/sources/nuttx/include/nuttx/irq.h:39,
   >                  from /github/workspace/sources/nuttx/include/nuttx/fs/fs.h:51,
   >                  from /github/workspace/sources/nuttx/include/stdio.h:36,
   >                  from ./hello_main.c:28:
   > Error: /github/workspace/sources/nuttx/include/arch/chip/irq.h:226:4: error: #error "CONFIG_ARCH_NUSER_INTERRUPTS is less than ESP_IRQ_DEMUX + 1. Please increase CONFIG_ARCH_NUSER_INTERRUPTS to at least ESP_IRQ_DEMUX + 1."
   >   226 | #  error "CONFIG_ARCH_NUSER_INTERRUPTS is less than ESP_IRQ_DEMUX + 1. Please increase CONFIG_ARCH_NUSER_INTERRUPTS to at least ESP_IRQ_DEMUX + 1."
   >       |    ^~~~~
   > ```
   > 
   > ```
   > ====================================================================================
   > Configuration/Tool: esp32-c3-zero/usbnsh
   > 2026-03-04 14:57:25
   > ------------------------------------------------------------------------------------
   >   Cleaning...
   >   Configuring...
   >   Building NuttX...
   > In file included from /github/workspace/sources/nuttx/include/arch/irq.h:41,
   >                  from /github/workspace/sources/nuttx/include/nuttx/irq.h:39,
   >                  from /github/workspace/sources/nuttx/include/nuttx/fs/fs.h:51,
   >                  from /github/workspace/sources/nuttx/include/stdio.h:36,
   >                  from /github/workspace/sources/apps/include/system/readline.h:31,
   >                  from ./nsh_init.c:32:
   > Error: /github/workspace/sources/nuttx/include/arch/chip/irq.h:226:4: error: #error "CONFIG_ARCH_NUSER_INTERRUPTS is less than ESP_IRQ_DEMUX + 1. Please increase CONFIG_ARCH_NUSER_INTERRUPTS to at least ESP_IRQ_DEMUX + 1."
   >   226 | #  error "CONFIG_ARCH_NUSER_INTERRUPTS is less than ESP_IRQ_DEMUX + 1. Please increase CONFIG_ARCH_NUSER_INTERRUPTS to at least ESP_IRQ_DEMUX + 1."
   >       |    ^~~~~
   > In file included from /github/workspace/sources/nuttx/include/arch/irq.h:41,
   >                  from /github/workspace/sources/nuttx/include/nuttx/irq.h:39,
   >                  from /github/workspace/sources/nuttx/include/nuttx/fs/fs.h:51,
   >                  from /github/workspace/sources/nuttx/include/stdio.h:36,
   >                  from ./hello_main.c:28:
   > ```
   
   Thanks, @simbit18 . I started this job long ago and, yes, probably more defconfigs were added. I review them all (thanks again).


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org