CC2340R2: AssertHandler cases not result in calling HAL_ASSERT_SPINLOCK

Expert 3120 points
Part Number: CC2340R2

Tool/software:

Hi team,

My customer started from the demo code for the basic BLE profiles project. (SDK version 8.40)

We are wondering if when an Assert occurs and the stack or some library routine calls AssertHandler, is it expected that the assert handler would return? It seems to me that all the reasons for an Assert to be called are serious and that you'd want to enter into a while(1) loop...

Is there a reason why an assert could occur where everything is okay still? 

The AssertHandler we have been looking at is in the main_freertos.c file and we found that most cases do not call HAL_ASSERT_SPINLOCK.

Best,

Luke

  • Hi Luke,

    Thanks for reaching out! I believe some asserts may be recoverable which is why not all of them spin lock the device. You are correct that if an assert is serious enough it should lock the device for further analysis, but which asserts should lock the device, which should be allowed to attempt a recovery and which should just initiate a reset will depend on the customer's needs. For instance, during development, it may make sense to spin lock all asserts, but during production it may be better to cause a reset on most asserts to allow the device to quickly recover with minimal user impact.

    Best Regards,

    Jan