Hi
We'll be adding to a design that uses libuarte/UART0. I've tested/run the example code and it's fine. Changing/swapping
index from UARTE0 or 1 works fine as does reassigning TxD/RxD pins from 8 & 6 to others.
So I just made some minor changes and first decided to instantiate both UARTEs, and just to see a test string on both UARTE
outputs. sdk_config.h turned on UARTE1 . Complies w GCC /burns fine. Runs up to "Here #1" and stops.
[I do not have a debugger setup yet just JLinkRTTView for logging debug printfs for "Hello #n" progress stamps.]
Are there some configuration options I'm missing/need correction, esp in NRF_LIBUARTE_ASYNC_DEFINE(...) ??
Anything else I can check?
Shouldn't be any resource constraints otherwise. I'd like to see both UARTEx's emit something .... and yes, HWFC
is of course disabled. Both ports used/configured singly (i.e, commenting out init/usage of the other port) work 100%.
Thanks
Bill
San Jose
--------------------------------------------------------------------------------------------------
Key excerpts:
#include xxxxx ec.
....
.....
NRF_LIBUARTE_ASYNC_DEFINE(libuarte1, 0, 0, 0, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 128, 3);
NRF_LIBUARTE_ASYNC_DEFINE(libuarte2, 1, 0, 0, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 128, 3);
.....
/// two separate copies uart_handler1(), uart_handler2() - noninterfering w each other, etc
main()
/// same intro setup (clockcs, etc) as orig code....
nrf_libuarte_async_config_t nrf_libuarte_async_config[] = {
// UARTE0
{ .tx_pin = TX_PIN_NUMBER, // == 0,6
.rx_pin = RX_PIN_NUMBER, // == 0,8
.baudrate = NRF_UARTE_BAUDRATE_115200,
.parity = NRF_UARTE_PARITY_EXCLUDED,
.hwfc = NRF_UARTE_HWFC_DISABLED,
.timeout_us = 100,
.int_prio = APP_IRQ_PRIORITY_LOW
},
// UARTE1
{ .tx_pin = SER_CON_TX_PIN, // == 1,13
.rx_pin = SER_CON_RX_PIN, // == 1,14
.baudrate = NRF_UARTE_BAUDRATE_115200,
.parity = NRF_UARTE_PARITY_EXCLUDED,
.hwfc = NRF_UARTE_HWFC_DISABLED,
.timeout_us = 100,
.int_prio = APP_IRQ_PRIORITY_LOW
}
};
dprintf(0,"Here 0\n");
err_code = nrf_libuarte_async_init(&libuarte1, &nrf_libuarte_async_config[0], uart_event_handler1, (void *)&libuarte1);
APP_ERROR_CHECK(err_code);
nrf_delay_ms(25);
dprintf(0,"Here 1\n");
err_code = nrf_libuarte_async_init(&libuarte2, &nrf_libuarte_async_config[1], uart_event_handler2, (void *)&libuarte2);
APP_ERROR_CHECK(err_code);
nrf_delay_ms(25);
dprintf(0,"Here 2\n");
nrf_libuarte_async_enable(&libuarte1);
nrf_delay_ms(25);
dprintf(0,"Here 3\n");
nrf_libuarte_async_enable(&libuarte2);
nrf_delay_ms(25);
dprintf(0,"Here 4\n");
err_code = nrf_libuarte_async_tx(&libuarte1, text, text_size);
APP_ERROR_CHECK(err_code);
nrf_delay_ms(500);
err_code = nrf_libuarte_async_tx(&libuarte2, text, text_size);
APP_ERROR_CHECK(err_code);
nrf_delay_ms(500);
dprintf(0,"Here 5\n");
.
.
.
.