ncs 1.7.0 peripheral_uart example - fault when data burst received over HW UART

Hi,

I'm working with the ncs 1.7.0 peripheral_uart example and have observed faults when I send more than a few bytes at a time to the HW UART.  (receive by HW UART for transmission over BLE link)

This can be reproduced by connecting the peripheral_uart example to another BLE device, such as the central_uart example, connecting a terminal emulator to the dev kit's UART, and sending a burst of bytes from the terminal emulator to the dev kit's UART.  (e.g. a paragraph of text)

I initially found the issue with ncs 1.6.1, so it's not new.  Another developer at my company has reproduced the issue as well, so I don't believe it's a setup issue.

Log from SEGGER debug terminal:

[01:25:36.951,629] [0m<inf> peripheral_uart: Received data from: C0:EE:40:50:17:6B (public)[0m   (when data flow is slow, pages of these received data messages emit without issues)
[01:25:37.041,687] [0m<inf> peripheral_uart: Received data from: C0:EE:40:50:17:6B (public)[0m
[01:25:37.111,511] [1;33m<wrn> peripheral_uart: Not able to allocate UART receive buffer[0m
[01:25:37.111,541] [1;33m<wrn> peripheral_uart: Not able to allocate UART receive buffer[0m
[01:25:37.115,478] [1;33m<wrn> peripheral_uart: Not able to allocate UART receive buffer[0m
[01:25:37.131,652] [0m<inf> peripheral_uart: Received data from: C0:EE:40:50:17:6B (public)[0m
[01:25:37.131,744] [1;33m<wrn> peripheral_uart: Not able to allocate UART send data buffer[0m
[01:27:26.749,694] [1;31m<err> os: ***** BUS FAULT *****[0m
[01:27:26.749,725] [1;31m<err> os: Precise data bus error[0m
[01:27:26.749,725] [1;31m<err> os: BFAR Address: 0xfb00e5[0m
[01:27:26.749,755] [1;31m<err> os: r0/a1: 0x00fb00e5 r1/a2: 0x200027b4 r2/a3: 0x00000003[0m
[01:27:26.749,755] [1;31m<err> os: r3/a4: 0x00000040 r12/ip: 0x00000000 r14/lr: 0x00020eed[0m
[01:27:26.749,755] [1;31m<err> os: xpsr: 0x21000000[0m
[01:27:26.749,786] [1;31m<err> os: Faulting instruction address (r15/pc): 0x00021408[0m
[01:27:26.749,786] [1;31m<err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0[0m
[01:27:26.749,786] [1;31m<err> os: Current thread: 0x20001540 (unknown)[0m
[01:27:27.895,294] [1;31m<err> fatal_error: Resetting system[0m
*** Booting Zephyr OS build v2.6.99-ncs1 ***

...

Thanks

Parents
  • Hi 

    A couple of things you have not mentioned:

    1) What is your UART baud rate setting ? Zephyr default is 115K2

    2) Have you optimized your BLE link for throughput ( extended data length, MTU, connection interval, etc ...) ?

    Of course the Not able to allocate UART receive buffer problem is due to your sustained UART baud rate being higher than the sustained rate at which it is being relayed out the BLE link.  Increasing CONFIG_HEAP_MEM_POOL_SIZE will help that up to a point.

    If the BLE link is optimized for throughput, its throughput can be up to 1400kbps in a clean RF environment. RF interference can drop that substantially.

    That being said, I would not expect to see the BUS FAULT issue.

    I have recently started to use the peripheral_uart application in NCS 1.8.0

    I have optimized for throughput, and UART baud rate is set to 1000kbps.

    I can transfer a lot of data, but eventually I will get some Not able to allocate UART receive buffer messages.

    I too can re-create the BUS FAULT issue. My CONFIG_HEAP_MEM_POOL_SIZE is only 2048, which is very small.

    But this should not happen, even with a small CONFIG_HEAP_MEM_POOL_SIZE.

      any thoughts on this ?

    One can try this also ...

    Leave your peripheral unconnected, in an advertising state. Then send UART data again. 

    Many Not able to allocate UART receive buffer messages as expected, but no BUS_FAULT in this scenario. 

    I am using a nRF5340-DK.

Reply
  • Hi 

    A couple of things you have not mentioned:

    1) What is your UART baud rate setting ? Zephyr default is 115K2

    2) Have you optimized your BLE link for throughput ( extended data length, MTU, connection interval, etc ...) ?

    Of course the Not able to allocate UART receive buffer problem is due to your sustained UART baud rate being higher than the sustained rate at which it is being relayed out the BLE link.  Increasing CONFIG_HEAP_MEM_POOL_SIZE will help that up to a point.

    If the BLE link is optimized for throughput, its throughput can be up to 1400kbps in a clean RF environment. RF interference can drop that substantially.

    That being said, I would not expect to see the BUS FAULT issue.

    I have recently started to use the peripheral_uart application in NCS 1.8.0

    I have optimized for throughput, and UART baud rate is set to 1000kbps.

    I can transfer a lot of data, but eventually I will get some Not able to allocate UART receive buffer messages.

    I too can re-create the BUS FAULT issue. My CONFIG_HEAP_MEM_POOL_SIZE is only 2048, which is very small.

    But this should not happen, even with a small CONFIG_HEAP_MEM_POOL_SIZE.

      any thoughts on this ?

    One can try this also ...

    Leave your peripheral unconnected, in an advertising state. Then send UART data again. 

    Many Not able to allocate UART receive buffer messages as expected, but no BUS_FAULT in this scenario. 

    I am using a nRF5340-DK.

Children
No Data
Related