This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf52840 interactive command uart flushing

sdk17.0.2

so i am trying to flush rx/tx while the command execute

cannot find 

app_fifo_flush()

or

app_uart_flush()

anyone know how to do it?
 
Parents
  • Hi 

    Are you using one of the standard SDK examples?

    There is an app_uart_flush() function for flushing the buffers when using the app_uart driver, but it will not do anything unless you make sure to use the app_uart_fifo.c implementation. 

    When you say you cannot find this function, do you mean that the build fails if you try to call it?

    The function is declared on line 244 of app_uart.h, and implemented on line 186 of app_uart_fifo.c

    Best regards
    Torbjørn

Reply
  • Hi 

    Are you using one of the standard SDK examples?

    There is an app_uart_flush() function for flushing the buffers when using the app_uart driver, but it will not do anything unless you make sure to use the app_uart_fifo.c implementation. 

    When you say you cannot find this function, do you mean that the build fails if you try to call it?

    The function is declared on line 244 of app_uart.h, and implemented on line 186 of app_uart_fifo.c

    Best regards
    Torbjørn

Children
  • hello  I am using standard sdk but still cannot find both of those 

    app_uart.h,  app_uart_fifo.c in interactice command  

    sdk17.0.2

  • Hi 

    Which example are you using?

    If you open the ble_app_uart example for instance both app_uart.h and app_uart_fifo.c should already be added to the project. 

    Best regards
    Torbjørn

  • nrf52840 interactive command

    I am using 

    ble_app_interactive

  • Hi

    I don't think there is any way to flush the UART buffers when using CLI. 

    Is there a particular reason you need to do this?
    Do you just need to know when the command is finished?

    Best regards
    Torbjørn

  • you  mean I cannot clear the  uart_rx tx

    I mean I found a bug happened it randomly

    for example sometimes when I type on the keyboard "connect AF:BF:CF:DF:EF:FF" but when I type to con or connect when I press the next character it with output random character on the uart so I wonder why is this happening(Seldom happen)

    another thing is if I just copy-paste "connect AF:BF:CF:DF:EF:FF"     

    sometimes  the output show up on uart wrong 

    it shows "connect??? AF:???BF:C???F:DF:EF:FF"

    I am 100% sure I copy the correct string 

    for example

    [15:06:31.505]OUT↙⊙connect 5C:F3:70:38:AE:36 
    
    ↓
    [15:06:31.508]IN↘↑connect 5C:F3:70connect 5C:F3:70:38:Act 5CE6 
    wrong parameter count 
    

    you can see the uart shows wrong what I copy on the uart

    I copy it correctly but the Uart shows wrong

    so I think if I can clean up the rx-tx in uart

    or you know if there is any other problem

Related