Skip to content

arch/risc-v/espressif: Add TWAI2 support for esp32p4#19176

Open
eren-terzioglu wants to merge 4 commits into
apache:masterfrom
eren-terzioglu:feature/p4_enable_twai2
Open

arch/risc-v/espressif: Add TWAI2 support for esp32p4#19176
eren-terzioglu wants to merge 4 commits into
apache:masterfrom
eren-terzioglu:feature/p4_enable_twai2

Conversation

@eren-terzioglu

@eren-terzioglu eren-terzioglu commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Unnecessary select lines and free to choose ESPRESSIF_TWAI option (which should not be) handled to have clearer Kconfig option system

  • Docs/platforms/risc-v: Add TWAI2 docs for esp32p4

Add TWAI2 docs for esp32p4

  • boards/risc-v/esp32p4: Add TWAI2 support for esp32p4

Add TWAI2 support for esp32p4

  • arch/risc-v/espressif: Add TWAI2 support for esp32p4

Enable TWAI2 support for esp32p4

Impact

Impact on user: Yes, twai2 can be used with ESP32-P4

Impact on build: No

Impact on hardware: Yes, twai2 peripheral supported for ESP32-P4

Impact on documentation: Yes, related docs added

Impact on security: No

Impact on compatibility: No

Testing

esp32p4-function-ev-board:twai config used with CAN_LOOPBACK and ESPRESSIF_TWAI2 options enabled

Building

Command to build:

make distclean && ./tools/configure.sh esp32p4-function-ev-board:twai && kconfig-tweak -e CAN_LOOPBACK && kconfig-tweak -e  ESPRESSIF_TWAI2 && make olddefconfig && make -j && make download ESPTOOL_PORT=/dev/ttyUSB0

Running

can -n 5 command used to test with connecting PIN 6-7 with a cable

Results

nsh> can -n 5
nmsgs: 5
min ID: 1 max ID: 2047
Bit timing:
   Baud: 909090
  TSEG1: 16
  TSEG2: 5
    SJW: 4
  ID:    1 DLC: 1
  ID:    1 DLC: 1
  ID:    1 DLC: 1 -- OK
  ID:    2 DLC: 2
  ID:    2 DLC: 2
  ID:    2 DLC: 2 -- OK
  ID:    3 DLC: 3
  ID:    3 DLC: 3
  ID:    3 DLC: 3 -- OK
  ID:    4 DLC: 4
  ID:    4 DLC: 4
  ID:    4 DLC: 4 -- OK
  ID:    5 DLC: 5
  ID:    5 DLC: 5
  ID:    5 DLC: 5 -- OK
Terminating!
nsh> 

@github-actions github-actions Bot added Area: Documentation Improvements or additions to documentation Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: M The size of the change in this PR is medium Board: risc-v labels Jun 19, 2026
Enable TWAI2 support for esp32p4

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
Add TWAI2 support for esp32p4

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
Add TWAI2 docs for esp32p4

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

Comment thread boards/risc-v/esp32c6/common/src/esp_board_twai.c Outdated
Comment thread boards/risc-v/esp32p4/common/src/esp_board_twai.c Outdated
acassis
acassis previously approved these changes Jun 20, 2026
Fix twai initialization when multiple twai devices enabled for esp32c6 and esp32p4

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
@eren-terzioglu eren-terzioglu dismissed stale reviews from acassis and xiaoxiang781216 via 581ee3f June 22, 2026 07:48
@eren-terzioglu eren-terzioglu force-pushed the feature/p4_enable_twai2 branch from c8fc8ba to 581ee3f Compare June 22, 2026 07:48
@eren-terzioglu

Copy link
Copy Markdown
Contributor Author

Thanks @tmedicci, updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Area: Documentation Improvements or additions to documentation Board: risc-v Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants