Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CC2564MODN: STM32L4 randomly HardFaults when executing Bluetopia scheduler

$
0
0

Part Number:CC2564MODN

Hi,

We are having a hard time debugging a hardfault error with CC2564MODN and a STM32L476RG that runs BTPS 4.0.2.2. The CC2564MODN and STM32L476RG communicate via UART.

Details:

  • Device Chipset: 4.1
  • BTPS Version : 4.0.2.2
  • Project Type : 6
  • FW Version : 7.35

We have a EMC qualification software that runs on a PC with BLED112 dongle. The dongle connects to the CC2564 via BLE and sends serial commands (based on SPPLE demo) to create traffic and CC2564 sends notifications on another standard service as fast as possible (16ms). After approx. 1h of testing in these conditions, the STM32L476RG falls into hardfault and the call stack indicates it was running in a Bluetopia callback which we don't have the source to. We see the hardfault more frequently with high BT traffic and BT traffic from both sides.

The call stack indicates it happened in HCITR_COMDataCallback_UART and, according to the assembly and the registers' values, it happens just before HCILL_ReceiveBytes is called. STM32's register R6 always contains a RAM address (0x20001800) that is outside values mapped in the map file (outside STM32's stack and heap and outside Bluetopia's heap) while R4 and R5 always points to the same addresses in Bluetopia's heap. It is very difficult to extract any information, since we do not know what HCITR_COMDataCallback_UART and HCILL_ReceiveBytes do and it happens randomly (not with any specific BLE command).

 

As suggested in other posts, we increased the heap size (Bluetopia's heap = BTPS_MEMORY_BUFFER_SIZE) and the bug still happened. I tried to reduce the heap size just to see if it could make it unstable faster, but it did not.

We increased the STM32's stack size to the maximum stack size defined in BTPS kernel (in our case, the stack size is increased from 0x800 to 0x8000 = BTPS_CONFIGURATION_PAN_DISPATCH_THREAD_STACK_SIZE). The hardfault still happened, same place.

How big should the Stack and Heap be? The hardfault seems to be caused by a wrong RAM address during HCITR_COMDataCallback_UART and just before HCILL_ReceiveBytes... What is done in Bluetopia between those two?

Thank you


Viewing all articles
Browse latest Browse all 262198


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>