QN9080 issue with strange restarts

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QN9080 issue with strange restarts

971 Views
skv
Contributor II

Hi.

I'm working on implementing a device that collect some sensors data and cache it. It also uses the peripheral BLE role to send collected data to the phone when it's available. As starting point I used heart_rate baremetal sample (without OS ). I use QN9080SIP-DK as hardware platform and MCUXpresso 10.3.0 and SDK_2.x_QN908XCDK (SDK version 2.2.0).

I've found that on phone connection event my firmware falls to SystemInit() and main(), as I think through ResetHandler (Reset_Handler address from the MAP file is 0x00000374, but firmware falls at 0x21000374, which is aliased to flash memory). Then it leads to Hard Fault, but I don't catch whats going on.
This issue repeats if I don't use cPWR_UsePowerDownMode, in case of definition cPWR_UsePowerDownMode, connection with phone finish successfully.

To found whats happens I've activated gUsePanic_c/MEM_STATISTICS/MEM_TRACKING/MEM_DEBUG/MEM_DEBUG_OUT_OF_MEMORY capabilities and found that sometimes
connection event leads to error in BleApp_AdvertisingCallback() with pAdvertisingEvent->eventType = gAdvertisingCommandFailed_c and
pAdvertisingEvent->eventData.failReason = gHciCommandDisallowed_c. In case of gUsePanic_c is equal to 1, this leads to hang in Panic(),
but issue with strange reset to SystemInit() occurs whatever. I've increase pool size in MemManager, but this doesn't help solving my problem.

I have some questions to investigate the reason of issue:
1) Is QN908x supports Instruction Trace? MCUXpresso doesn't allow me use it with message "Unsupported target detected". I've found that QN908x include ETM, but didn't found any information about instruction trace support in the documenatation. I try to use SWO trace ability to track issue, but it didn't help me.
2) Could someone advise me how to use MEM_STATISTICS/MEM_TRACKING/MEM_DEBUG/MEM_DEBUG_OUT_OF_MEMORY capabilities to found where overflow of heap can take place if it is a reason of my issue?
3) Is there some suggestion how to found place of restart in other way?

Thank you!

0 Kudos
3 Replies

650 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello,

Still, are you considering the stack footprint ? If you are enabling the memory debug definitions and it is entering to those ones you might have memory issues.

Also, if you are reading and collecting data from the sensors, besides it does not use FreeRTOS, there is a task based implementation for the Bluetooth LE stack. So if you are interfering with one of your sensor functions one of the Bluetooth LE routines it is most likely that there is an issue within the stack and hence you will have those issues as well.

The Bluetooth Low Energy Application Developer's Guide might guide you a little more on what does your application's implementation should take into account. 

Regards

Estephania

0 Kudos

650 Views
skv
Contributor II

Hi,

thank you for your answer.

I'm following the "BLE Application Developer's Guide" when expand SDK example 'heart_rate_sensor_bm' to my needs. I've added several custom profiles for transfer sensors data, and sensors data collection is done by the timers callback (not in separate task), like in original 'heart_rate_sensor_bm' example.

Please note that when defining constant cPWR_UsePowerDownMode to enable low power mode, the application does not crash.

What's about my question concerning instruction trace support in qn908x?

0 Kudos

650 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello,

According to the MCUXpresso Instruction Trace Guide the QN908x it's not on the supported devices list.

Still, if you added several profiles , are you sure that you followed the different guides and recommendations to do so as it is mentioned in this guides ?

How to create a Custom Profile-Server 

How to create a Custom Profile - Client 

Also, if you are reading several sensors in the same task, are you sure that you are not blocking any of the functionalities of the Bluetooth LE stack ?

The baremetal scheduler is non-preemptive,  if you are implementing some long loops in a single task to read everything as it seem that you are doing it, all the other essential tasks from the Bluetooth LE stack will not be executed during this time, that it's one of the reasons why we also provide a freertos version for all projects.

If you start by the examples, and start adding your different sensors , one by one instead of adding them all at the same time, do you have the same behavior ?

How are you confirming that it does not happen when enabling the low power? if you enable it the debugger should disconnect form the IDE debug so how do you know it does not crash ?

If you enable it do you get all the information correct?

Regards,
Estephania

0 Kudos