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

Sometimes only first char sent over UART using app_uart_fifo, then dead silent

I control a module over UART using app_uart_fifo. This module is controlled from nRF host by commands to perform things. This generally works fine but however, sometimes when trying to send command it only writes out first character and then everything is quiet. This is the longest command we ever use so I suspect it has something to do with buffers since only the longest cmd has this behaviour. The others always works, this one will fail about once every 50th time. All of my buffers should be big enough to handle the message (and obviously they do that ~49/50 times). My way of sending message using app_uart_fifo is standard:

void wifi_app_uart_putstring(char * s) { uint32_t err_code;

uint8_t len = strlen((char *) s);
for (uint8_t i = 0; i < len; i++)
{
    err_code = app_uart_put(s[i]);
    APP_ERROR_CHECK(err_code);
}

}

When doing so the chip should do a reboot if it encounters issues on putting the char's on UART. And in fact, the chip does this sometimes. Sometimes it prints out the "A" and then instantly reboots, which in my implementation is far more advantageous than the behaviour when it just goes silent.

Any ideas or suggestions?

Regards, Pontus

Parents
  • Thanks for reply. I assume that the reboot is due to APP_ERROR_CHECK. I develop in Kiel but do however compile with own gcc compiler. Therefor, presumable cannot debug with breakpoints. But are there any scenario where APP_ERROR_CHECK will behave the way I explained? The only logical error code is NRF_ERROR_NO_MEM.

    Sorry for not doing more research. I have not investigated the APP_ERROR_CHECK that much but I can see now that it makes it stop advertising and NVIC_SystemReset(), no matter what the ERROR_CODE is. So the chip should therefor reboot every time i get NRF_ERROR_NO_MEM from uart. However, does not seem to do so.

Reply
  • Thanks for reply. I assume that the reboot is due to APP_ERROR_CHECK. I develop in Kiel but do however compile with own gcc compiler. Therefor, presumable cannot debug with breakpoints. But are there any scenario where APP_ERROR_CHECK will behave the way I explained? The only logical error code is NRF_ERROR_NO_MEM.

    Sorry for not doing more research. I have not investigated the APP_ERROR_CHECK that much but I can see now that it makes it stop advertising and NVIC_SystemReset(), no matter what the ERROR_CODE is. So the chip should therefor reboot every time i get NRF_ERROR_NO_MEM from uart. However, does not seem to do so.

Children
No Data
Related