I am having trouble getting the data (7 ASCII characters) transmitted via UART using the interrupt driven mode. The uart_fifo_fill function returns a positive number (the exact number of characters I requested to send) but it actually doesn't transmit those characters because it doesn't trigger the oscilloscope I have tied to the tx line nor does it turn off an LED in response to that command.
I am using nRF Connect SDK v2.0.2. Within Visual Studio Code, I have used GUIConfig to uncheck Asynchronous UART API and check UART Interrupt support under Serial Drivers in the Device Drivers section and saved the settings. The .config file in the build's zephyr folder contains the following:
# Capabilities
#
CONFIG_SERIAL_HAS_DRIVER=y
CONFIG_SERIAL_SUPPORT_ASYNC=y
CONFIG_SERIAL_SUPPORT_INTERRUPT=y
# CONFIG_UART_LOG_LEVEL_OFF is not set
# CONFIG_UART_LOG_LEVEL_ERR is not set
# CONFIG_UART_LOG_LEVEL_WRN is not set
CONFIG_UART_LOG_LEVEL_INF=y
# CONFIG_UART_LOG_LEVEL_DBG is not set
CONFIG_UART_LOG_LEVEL=3
CONFIG_UART_USE_RUNTIME_CONFIGURE=y
# CONFIG_UART_ASYNC_API is not set
# CONFIG_UART_LINE_CTRL is not set
# CONFIG_UART_DRV_CMD is not set
# CONFIG_UART_WIDE_DATA is not set
#
# Serial Drivers
#
# CONFIG_UART_ITE_IT8XXX2 is not set
CONFIG_UART_NRFX=y
CONFIG_UART_0_NRF_UARTE=y
CONFIG_UART_0_ENHANCED_POLL_OUT=y
CONFIG_UART_0_INTERRUPT_DRIVEN=y
# CONFIG_UART_0_NRF_PARITY_BIT is not set
CONFIG_UART_0_NRF_TX_BUFFER_SIZE=32
CONFIG_UART_1_NRF_UARTE=y
CONFIG_UART_1_INTERRUPT_DRIVEN=y
CONFIG_UART_1_ENHANCED_POLL_OUT=y
# CONFIG_UART_1_NRF_PARITY_BIT is not set
CONFIG_UART_1_NRF_TX_BUFFER_SIZE=32
CONFIG_UART_ENHANCED_POLL_OUT=y
CONFIG_NRF_UARTE_PERIPHERAL=y
# CONFIG_UART_ALTERA_JTAG is not set
# CONFIG_UART_RTT is not set
# CONFIG_UART_XLNX_UARTLITE is not set
My code looks like this:
static K_SEM_DEFINE(tx_sem, 0, 1); // Semaphore to signal UART data transmitted
}
int uart_irq_tx(const struct device *dev, const uint8_t *buf, size_t len)
{
tx_data = buf;}
Do you have any idea what is going on?