feat(idf-v6, board, lua): IDF v6.0.1 compat + WT32-SC01 Plus board + CAN bus Lua driver#86
feat(idf-v6, board, lua): IDF v6.0.1 compat + WT32-SC01 Plus board + CAN bus Lua driver#86ayyaris wants to merge 1 commit into
Conversation
…s driver IDF v6 compatibility - Replace monolithic `driver` component with `esp_driver_gpio`, `esp_driver_spi`, `esp_driver_i2c`, etc. in 22 CMakeLists.txt files - Add `#ifndef SOC_PCNT_CHANNELS_PER_UNIT` fallback (macro removed in IDF v6) - Guard `MALLOC_CAP_EXEC` with `#ifdef` (not available in all IDF v6 heap configs) - Fix IDF v6 compat in cap_im_wechat.c New board: Wireless Tag WT32-SC01 Plus (ESP32-S3, ST7796 I80, FT6336U, 16 MB flash) - boards/Wireless-Tag/esp32s3_wt32_sc01_plus/ with full board_peripherals/devices YAML, setup_device.c (ST7796 via native I80 bus), sdkconfig.defaults.board - Migrate lcd_touch from deprecated lcd_touch_i2c to lcd_touch + sub_type:i2c with correct 8-bit I2C address [0x70] to fix address-0x00 probe bug / reboot loop - Disable SPIRAM_XIP_FROM_PSRAM (2 MB Quad PSRAM too small for instruction cache) - Add SPIRAM_MALLOC_ALWAYSINTERNAL=65536 + FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=n to keep task stacks in internal DRAM when XIP-from-PSRAM is off (prevents "esp_task_stack_is_sane_cache_disabled" panic on flash reads) New Lua module: lua_driver_canbus (TWAI / CAN bus) - Wraps ESP-IDF v6 esp_driver_twai node API with ISR-driven RX queue (depth 32) - Exposes canbus.new(), enable/disable/send/receive/status/recover/close to Lua - Registered via Kconfig APP_CLAW_LUA_DRIVER_CANBUS (default y when SOC_TWAI_SUPPORTED) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Alessio Ayyari seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Thanks for the PR and for the contribution! This PR currently contains several independent changes, including the ESP-IDF v6.0 upgrade, new development board support, and TWAI support. To make the review process easier, could you please split them into separate PRs? For the ESP-IDF v6.0 upgrade, we are also working on this internally. We may refer to your changes to speed up the process, but we probably will not merge this part of the PR directly. The new development board support looks suitable to be reviewed and merged separately, so please split that part into an individual PR. For the TWAI support, please rename the related code from CAN/CAN bus to TWAI module, so that it is consistent with the terminology used in the ESP-IDF Programming Guide. Also, please sign the CLA before we can proceed with the review/merge process. Thanks again for your work! |
|
Closing in favour of two focused PRs as requested:
The IDF v6 compatibility changes are omitted per the maintainer's note that Espressif is handling them internally. The relevant root-cause issues have been filed separately (#89–#94) for tracking. |
Summary
Three independent contributions bundled in one branch:
1. ESP-IDF v6.0.1 compatibility
drivercomponent split — replaceREQUIRES driverwith the specificesp_driver_*sub-component in 22CMakeLists.txtfiles acrossclaw_capabilities/,claw_modules/, andlua_modules/. IDF v6 removed the monolithicdriverumbrella; builds fail withfatal error: driver/gpio.h: No such file or directory.SOC_PCNT_CHANNELS_PER_UNITremoved — add#ifndeffallback inlua_driver_pcnt/src/lua_driver_pcnt.c(value is 2 for all supported chips).MALLOC_CAP_EXECgated — wrap with#ifdef MALLOC_CAP_EXECinlua_module_system/src/lua_module_system.c; the macro is only defined whenCONFIG_HEAP_HAS_EXEC_HEAP=yin IDF v6.cap_im_wechat.c— minor IDF v6 API compat fix.2. New board: Wireless Tag WT32-SC01 Plus
application/edge_agent/boards/Wireless-Tag/esp32s3_wt32_sc01_plus/board_peripherals.yamlboard_devices.yamlsetup_device.clcd_touch_factory_entry_tcallingesp_lcd_touch_new_i2c_ft5x06sdkconfig.defaults.boardSPIRAM_MALLOC_ALWAYSINTERNAL=65536+FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=nto prevent PSRAM-stack panics on flash readsTouch fix: migrated from deprecated
lcd_touch_i2ctolcd_touch + sub_type: i2c. The deprecated type has a YAML-mapping bug wherei2c_addr[]probe array is never populated, leavingdev_addr=0x00and causingESP_ERR_INVALID_RESPONSE→ reboot loop. The new type reads the address fromperipherals[0].i2c_addr: [0x70](8-bit format) correctly.PSRAM stack panic fix: global
sdkconfig.defaultssetsSPIRAM_MALLOC_ALWAYSINTERNAL=0+FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=ywhich is correct whenSPIRAM_XIP_FROM_PSRAM=y. On a 2 MB PSRAM board where XIP must be disabled, task stacks land in PSRAM (0x3c2xxxxx) and any flash read triggersassert failed: esp_task_stack_is_sane_cache_disabled. Board defaults override both settings.3. New Lua module:
lua_driver_canbuscomponents/lua_modules/lua_driver_canbus/Wraps the IDF v6
esp_driver_twainode API:canbus.new(tx, rx, bitrate [, {listen_only, loopback}])— creates a TWAI nodenode:enable()/node:disable()node:send(id, data [, extended [, rtr]])node:receive([timeout_ms])→{id, data, extended, rtr}ornilnode:status()→{state, tx_errors, rx_errors, tx_queue_remaining, bus_errors}node:recover()— bus-off recoverynode:close()+__gcRX is ISR-driven via
twai_node_receive_from_isr()into a FreeRTOS queue (depth 32). Registered viaAPP_CLAW_LUA_DRIVER_CANBUSKconfig (defaultywhenSOC_TWAI_SUPPORTED).Test plan
edge_agentforesp32s3_wt32_sc01_pluswith IDF v6.0.1 — no errorscanbus.new(10,11,500000):enable()on a WT32-SC01 Plus with a CAN transceiver attached🤖 Generated with Claude Code