This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

app_timer_irq_priority interfering with UARTE0 & UARTE1

I am currently making a program that will interpret serial commands from UARTE1 and then send + read something from the other (UARTE0). Previously, when I have been using a single UARTE I have had no problem setting up an app_timer and waiting for it to expire while waiting for a full "message" from the UARTE (indicated by a newline).

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static ret_code_t myTimerTimeoutSetup(uint32_t timeout_ms, my_timer_timeout_t* p_tout_ctx)
{
uint32_t ticks = APP_TIMER_TICKS(timeout_ms);
if (ticks < APP_TIMER_MIN_TIMEOUT_TICKS)
{
p_tout_ctx->expired = true;
return NRF_SUCCESS;
}
ret_code_t ret = app_timer_create(&my_timer_id,
APP_TIMER_MODE_SINGLE_SHOT,
fc_adafruitFonaTimeoutHandler);
APP_ERROR_CHECK(ret);
// If the timer is failed to be created, return the error code
if (ret != NRF_SUCCESS)
{
return ret;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

much like is done in nrf_serial, I then have a statement such as: if (tout_ctx.expired) break; in my while loop to break when time is up.

Now that I am using both UARTEs, both of them freeze (when they should transmitting data) until the timer has expired, on which they will finish transmitting (nrf_serial_write). I have also had trouble with the timer never expiring if the interrupt priority is set to the default 6.

Is this an IRQ priority issue?

Thanks very much