From 5d67c7c76f2e22063eb930bec65a2c63f4189197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20C=2E=20Fran=C3=A7a?= Date: Mon, 4 Nov 2024 11:05:37 -0300 Subject: [PATCH] CI: add esp32p4-function-ev board in wokwi --- .github/workflows/wokwi/diagram-esp32p4.json | 31 ++++++++++++-------- build.zig | 1 + cmake/zig-build.cmake | 3 +- wokwi.toml | 2 +- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/wokwi/diagram-esp32p4.json b/.github/workflows/wokwi/diagram-esp32p4.json index ca37fe5..fd73f28 100644 --- a/.github/workflows/wokwi/diagram-esp32p4.json +++ b/.github/workflows/wokwi/diagram-esp32p4.json @@ -1,14 +1,19 @@ { - "version": 1, - "author": "Uri Shaked", - "editor": "wokwi", - "parts": [ - { "type": "board-esp32-p4-preview", "id": "esp", "top": -17.23, "left": -16.04, "attrs": {} } - ], - "connections": [ - ["esp:TX", "$serialMonitor:RX", "", []], - ["esp:RX", "$serialMonitor:TX", "", []] - ], - "serialMonitor": { "display": "terminal" }, - "dependencies": {} -} \ No newline at end of file + "version": 1, + "author": "Uri Shaked", + "editor": "wokwi", + "parts": [ + { "type": "board-esp32-p4-function-ev", "id": "esp", "top": 0, "left": 0, + "attrs": { + "flashSize": "16", + "psramSize": "32" + } + } + ], + "connections": [ + ["esp:37", "$serialMonitor:RX", "", []], + ["esp:38", "$serialMonitor:TX", "", []] + ], + "serialMonitor": { "display": "terminal" }, + "dependencies": {} +} diff --git a/build.zig b/build.zig index a21a0d4..8a24a1e 100644 --- a/build.zig +++ b/build.zig @@ -603,6 +603,7 @@ const riscv_targets = &[_]std.Target.Query{ .cpu_model = .{ .explicit = &std.Target.riscv.cpu.esp32p4 }, .os_tag = .freestanding, .abi = .eabihf, + .cpu_features_sub = std.Target.riscv.featureSet(&.{ .zca, .zcb, .zcmt, .zcmp }), }, }; const xtensa_targets = &[_]std.Target.Query{ diff --git a/cmake/zig-build.cmake b/cmake/zig-build.cmake index 48a7117..46305d7 100644 --- a/cmake/zig-build.cmake +++ b/cmake/zig-build.cmake @@ -62,7 +62,8 @@ if(CONFIG_IDF_TARGET_ARCH_RISCV) set(TARGET_CPU_MODEL "generic_rv32+m+a+c+zicsr+zifencei") elseif(CONFIG_IDF_TARGET_ESP32P4) string(REGEX REPLACE "-none" "-eabihf" ZIG_TARGET ${ZIG_TARGET}) - set(TARGET_CPU_MODEL "esp32p4") + # (zca, zcb, zcmt, zcmp) are not supported on ESP32-P4-Function-EV-Board (crash application) + set(TARGET_CPU_MODEL "esp32p4-zca-zcb-zcmt-zcmp") else() set(TARGET_CPU_MODEL "generic_rv32+m+c+zicsr+zifencei") endif() diff --git a/wokwi.toml b/wokwi.toml index c9515c6..fc75eda 100644 --- a/wokwi.toml +++ b/wokwi.toml @@ -1,4 +1,4 @@ [wokwi] version = 1 +firmware = "build/flasher_args.json" elf = "build/zig-sample-idf.elf" -firmware = "build/zig-sample-idf.bin"