diff --git a/targets/ESP32/_common/WireProtocol_HAL_Interface.c b/targets/ESP32/_common/WireProtocol_HAL_Interface.c index c064c337bb..b206ff0240 100644 --- a/targets/ESP32/_common/WireProtocol_HAL_Interface.c +++ b/targets/ESP32/_common/WireProtocol_HAL_Interface.c @@ -47,18 +47,16 @@ bool WP_Initialise(COM_HANDLE port) ASSERT(WP_Port <= SOC_UART_NUM); - uart_config_t uart_config = { - // baudrate - .baud_rate = TARGET_SERIAL_BAUDRATE, - // baudrate - .data_bits = UART_DATA_8_BITS, - // parity mode - .parity = UART_PARITY_DISABLE, - // stop bit mode - .stop_bits = UART_STOP_BITS_1, - // hardware flow control(cts/rts) - .flow_ctrl = UART_HW_FLOWCTRL_DISABLE - }; + uart_config_t uart_config = {// baudrate + .baud_rate = TARGET_SERIAL_BAUDRATE, + // baudrate + .data_bits = UART_DATA_8_BITS, + // parity mode + .parity = UART_PARITY_DISABLE, + // stop bit mode + .stop_bits = UART_STOP_BITS_1, + // hardware flow control(cts/rts) + .flow_ctrl = UART_HW_FLOWCTRL_DISABLE}; uart_param_config(WP_Port, &uart_config); @@ -70,7 +68,7 @@ bool WP_Initialise(COM_HANDLE port) UART_PIN_NO_CHANGE); // setup UART driver with UART queue - uart_driver_install(WP_Port, 256, 256, 0, NULL, 0); + uart_driver_install(WP_Port, 256, 256, 0, NULL, ESP_INTR_FLAG_IRAM); WP_Port_Intitialised = true; diff --git a/targets/ESP32/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp b/targets/ESP32/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp index 72c5d2111e..312480e929 100644 --- a/targets/ESP32/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp +++ b/targets/ESP32/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp @@ -833,12 +833,14 @@ HRESULT Library_sys_io_ser_native_System_IO_Ports_SerialPort::NativeInit___VOID( // Install driver esp_err = uart_driver_install( uart_num, - UART_BUFER_SIZE, // rx_buffer_size, - 0, // tx_buffer_size, not buffered - 20, // queue_size - &(palUart->UartEventQueue), // QueueHandle_t *uart_queue ( none for now ) - 0 // intr_alloc_flags - ); + // rx_buffer_size + UART_BUFER_SIZE, + // tx_buffer_size, not buffered + 0, + // queue_size + 20, + &(palUart->UartEventQueue), + ESP_INTR_FLAG_IRAM); if (esp_err != ESP_OK) { ESP_LOGE(TAG, "Failed to install uart driver"); diff --git a/targets/ESP32/_nanoCLR/Windows.Devices.SerialCommunication/win_dev_serial_native_Windows_Devices_SerialCommunication_SerialDevice.cpp b/targets/ESP32/_nanoCLR/Windows.Devices.SerialCommunication/win_dev_serial_native_Windows_Devices_SerialCommunication_SerialDevice.cpp index e5a070d857..6dbb89abd7 100644 --- a/targets/ESP32/_nanoCLR/Windows.Devices.SerialCommunication/win_dev_serial_native_Windows_Devices_SerialCommunication_SerialDevice.cpp +++ b/targets/ESP32/_nanoCLR/Windows.Devices.SerialCommunication/win_dev_serial_native_Windows_Devices_SerialCommunication_SerialDevice.cpp @@ -326,12 +326,16 @@ HRESULT Library_win_dev_serial_native_Windows_Devices_SerialCommunication_Serial // Install driver esp_err = uart_driver_install( uart_num, - UART_BUFER_SIZE, // rx_buffer_size, - 0, // tx_buffer_size, not buffered - 20, // queue_size - &(palUart->UartEventQueue), // QueueHandle_t *uart_queue ( none for now ) - 0 // intr_alloc_flags - ); + // rx_buffer_size, + UART_BUFER_SIZE, + // tx_buffer_size, not buffered + 0, + // queue_size + 20, + // QueueHandle_t *uart_queue ( none for now ) + &(palUart->UartEventQueue), + + ESP_INTR_FLAG_IRAM); if (esp_err != ESP_OK) { ESP_LOGE(TAG, "Failed to install uart driver"); diff --git a/targets/ESP32/_nanoCLR/nanoFramework.Devices.OneWire/nf_devices_onewire_native_nanoFramework_Devices_OneWire_OneWireController.cpp b/targets/ESP32/_nanoCLR/nanoFramework.Devices.OneWire/nf_devices_onewire_native_nanoFramework_Devices_OneWire_OneWireController.cpp index f1e2ef267c..b30355b05d 100644 --- a/targets/ESP32/_nanoCLR/nanoFramework.Devices.OneWire/nf_devices_onewire_native_nanoFramework_Devices_OneWire_OneWireController.cpp +++ b/targets/ESP32/_nanoCLR/nanoFramework.Devices.OneWire/nf_devices_onewire_native_nanoFramework_Devices_OneWire_OneWireController.cpp @@ -50,7 +50,7 @@ bool oneWireInit() UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE) != ESP_OK) return false; - if (uart_driver_install(UartDriver, UART_FIFO_LEN * 2, 0, 0, NULL, 0) != ESP_OK) + if (uart_driver_install(UartDriver, UART_FIFO_LEN * 2, 0, 0, NULL, ESP_INTR_FLAG_IRAM) != ESP_OK) return false; #if (ONEWIRE_USE_MUTUAL_EXCLUSION == TRUE)