Rikke
01/06/2023, 10:34 AM--baud_rate=2_500_000
from the toit-pixel-strip
package. We get the following error when creating the driver:
******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.47>
******************************************************************************
EXCEPTION error.
UNKNOWN ERROR 0x105(261)
0: uart_create_ <sdk>/uart.toit:310:3
1: Port <sdk>/uart.toit:99:13
2: UartPixelStrip <pkg:toit-pixel-strip>/uart.toit:124:13
3: setLED_.<block> ../src/pinout.toit:254:18
4: catch.<block> <sdk>/core/exceptions.toit:124:10
5: catch <sdk>/core/exceptions.toit:122:1
6: catch <sdk>/core/exceptions.toit:73:10
7: setLED_ ../src/pinout.toit:253:12
8: update_connection_LED_ ../src/pinout.toit:195:5
9: update_AP_status_LED ../src/pinout.toit:191:3
10: main ../src/gateway.toit:35:3
******************************************************************************
followed by ALREADY_IN_USE everytime it is called.
The UNKNOWN ERROR 0x105
has been traced down to a ESP_ERR_NOT_FOUND
error, and located in the file intr_alloc.c
in function `esp_err_t esp_intr_alloc_intrstatus(`:Rikke
01/06/2023, 10:34 AMthird_party/esp-idf/components/esp_hw_support/intr_alloc.c:486: int intr=get_available_int(flags, cpu, force, source);
third_party/esp-idf/components/esp_hw_support/intr_alloc.c-487- if (intr==-1) {
third_party/esp-idf/components/esp_hw_support/intr_alloc.c-488- //None found. Bail out.
third_party/esp-idf/components/esp_hw_support/intr_alloc.c-489- portEXIT_CRITICAL(&spinlock);
third_party/esp-idf/components/esp_hw_support/intr_alloc.c-490- free(ret);
third_party/esp-idf/components/esp_hw_support/intr_alloc.c-491- return ESP_ERR_NOT_FOUND;
third_party/esp-idf/components/esp_hw_support/intr_alloc.c-492- }
This happens when the uart create is called with ESP_INTR_FLAG_LEVEL3
.
The flag is set because of the high baud rate as seen in toit/lib/uart.toit
from line 95
tx_flags := (invert_tx ? 1 : 0) + (invert_rx ? 2 : 0)
if high_priority == null: high_priority = baud_rate >= 460800
if high_priority:
tx_flags |= 8
Rikke
01/06/2023, 10:34 AMtoit/src/resources/uart_esp32.cc
from line 208
int interrupt_flags = ESP_INTR_FLAG_IRAM;
if ((args.options & 8) != 0) {
// High speed setting.
interrupt_flags |= ESP_INTR_FLAG_LEVEL3;
If we comment out the new priority settings, the second UART works like before 🙂 It looks like we don't have the resources for the level 3 priority uart interrupts.
If we set the baud rate lower on toit-pixel-strip
, the uart create works, but that means the LEDs aren't working properly.erikcorry
01/06/2023, 12:39 PMerikcorry
01/06/2023, 12:39 PMRikke
01/06/2023, 12:52 PMerikcorry
01/06/2023, 2:05 PMerikcorry
01/06/2023, 2:05 PMRikke
01/06/2023, 3:10 PM