Skip to content

Commit 74ee9df

Browse files
SuGliderlucasssvazme-no-devpre-commit-ci-lite[bot]
authored
fix(uart): Fixes UART CI script to work with Arduino Core 3.2.x (espressif#11077)
* fix(uart): ci uart test fail on esp32s2 after uart break * fix(uart): ci error with change pins test on ESP32 * fix(uart): ci test with perimgr using esp32 fails * feat(uart): avoid electrical noise before setting pins * fix(uart_ci): fixes the UART CI sketch due to IDF 5.3 pull up change * fix(uart_ci): keeping previous formatting and applying changes * feat(uart_ci): trick for passing esp32 wokwi ci test Wokwi ESP32 fails with the pinMode() in line 56|58 Real device with Arduino Core 3.1.2 and 3.2 needs it to fix the issue. This patch will skip the pinMode() when compiling with Wokwi and make it pass the CI test case. * feat(uart_ci): reverting the wokwi patch, once it didn't make any difference * fix(wokwi): Change CPU freq to 80 * fix(wokwi): Change CPU freq to 120 * ci(pre-commit): Apply automatic fixes * fix(uart_ci): fixes a couple typos in commentatries --------- Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent ba2ab1e commit 74ee9df

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/validation/uart/diagram.esp32.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"type": "board-esp32-devkit-c-v4",
88
"id": "esp",
9-
"attrs": { "cpuFrequency": "40" }
9+
"attrs": { "cpuFrequency": "120" }
1010
}
1111
],
1212
"connections": [

tests/validation/uart/uart.ino

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public:
5353
: uart_num(num), serial(serial_ref), peeked_char(-1), default_rx_pin(rx_pin), default_tx_pin(tx_pin), recv_msg("") {}
5454

5555
void begin(unsigned long baudrate) {
56+
// pinMode will force enabling the internal pullup resistor (IDF 5.3.2 Change)
57+
pinMode(default_rx_pin, INPUT_PULLUP);
5658
serial.begin(baudrate, SERIAL_8N1, default_rx_pin, default_tx_pin);
5759
while (!serial) {
5860
delay(10);
@@ -365,6 +367,8 @@ void change_pins_test(void) {
365367

366368
if (TEST_UART_NUM == 1) {
367369
UARTTestConfig &config = *uart_test_configs[0];
370+
// pinMode will force enabling the internal pullup resistor (IDF 5.3.2 Change)
371+
pinMode(NEW_RX1, INPUT_PULLUP);
368372
config.serial.setPins(NEW_RX1, NEW_TX1);
369373
TEST_ASSERT_EQUAL(NEW_RX1, uart_get_RxPin(config.uart_num));
370374
TEST_ASSERT_EQUAL(NEW_TX1, uart_get_TxPin(config.uart_num));

0 commit comments

Comments
 (0)