Using UART1 or UART2 on nRF9160DK asset tracker v2

Hi All,

I'm trying to get an additional UART functioning on the Asset Tracker v2 sample project, built for the nRF9160DK. 

I've successfully implemented UART0 (console off) and UART1 on the nRF9160DK; successfully changed the analog switch from VCOM to physical pins on the nRF52840; and successfully rerouted RX and TX pins to spare pins on the DK.  These are implemented in an example project attached (uart_basics.zip) and have been physically validated.1325.uart_basics.zip

However when I try the same implementation in the Asset Tracker v2 sample project on my nRF9160DK, my nRF9160 resets as soon as the uart_tx function is called.

#include <zephyr/device.h>
#include <zephyr/drivers/uart.h>
const struct device *uart= DEVICE_DT_GET(DT_NODELABEL(uart1));

I embedded this function in one of the modules in the init state. 

	if (!device_is_ready(uart)){
		LOG_DBG("UART device not ready\r\n");
	}
	
	uint32_t err_code;
	err_code = uart_tx(uart, tx_start_msg, sizeof(tx_start_msg), SYS_FOREVER_MS);

I've read about users struggling to implement UART on the asset tracker project in this post and this post, but those seem to have been resolved at some point.   I tried following the suggestions for proj.conf, but get a build error when using CONFIG_UART_1_NRF_UARTE=y. 

Error: UART_1_NRF_UARTE (defined at drivers/serial/Kconfig.nrfx:119) is assigned in a configuration file, but is not directly user-configurable (has no prompt). It gets its value indirectly from other symbols. 

If I use the latter 2 configurations (the first commented out), my program runs without resetting, but I get error code -134 on the uart_tx function.  I haven't been able to figure out what this error means.

#CONFIG_UART_1_NRF_UARTE=y
CONFIG_UART_1_ASYNC=y
CONFIG_UART_1_INTERRUPT_DRIVEN=n

I'd really appreciate any assistance or advice on this issue!

My questions are:

  1. Am I using the correct UART function calls for the project which uses the Application Event Manager (AEM)?
  2. Am I using the correct proj_conf configurations?
  3. I understand that AEM is time sensitive on task handling - should I be implementing a different timeout other than SYS_FOREVER_MS as seen in the above code, or implementing it in the module thread? 
  4. Can anyone post a link to the nRF Connect SDK Error code descriptions? 

Thanks in advance!

Parents Reply Children
No Data
Related