NXP QN9021 freezes

cancel
Showing results for 
Search instead for 
Did you mean: 

NXP QN9021 freezes

129 Views
Contributor I

I am developing application using on QN9021. I am reading data from another mcu and putting it on chs using qpps profile. But after some time it freezes however i have handled hard fault handler to reset the module. Generally it reset by generating hard fault but after some hours it get freezes and give no response. Can you please give some documents where detailed description and implementation of RTOS is given so that i can rectify the error. I have tried it using RTOS timer interrupt as well as independent timer interrupt.

Also please mention if i can monitor ticks of mcu run from ARM systick timer or another timer which is already utilized by RTOS because i am using a separate timer to m onitor the ticks. This also increasing CPU overhead.

Thank You

Labels (2)
0 Kudos
5 Replies

4 Views
Contributor I

Sir,

I have activated two repeated timer one every 250ms to monitor ticks and another every 1s to read data through uart from another MCU. I have setup the timer separate from RTOS scheduler. I am using qpps profile to read some data from another MCU and notify on characteristics of qpps. I have tried to achieve the same with rtos timers but it generate hardfault after few seconds. The tick timer generating interrupt every 250ms is also increasing CPU overhead. So, please mention if i can access systick timer value through RTOS. I will try to minimize the size of buffer and global variables if it is a problem of memory. Please suggest me to minimize the memory usage and capabilities of the Module.

I have added this code in system.c

//NVIC_SetPriority(UART1_RX_IRQn, 4);
        uart_init(QN_UART1, USARTx_CLK(0), UART_57600, 0);
    uart_tx_enable(QN_UART1, MASK_ENABLE);
    uart_rx_enable(QN_UART1, MASK_ENABLE);
        
        
        NVIC_SetPriority(TIMER0_IRQn, 2);
        timer_init(QN_TIMER0, invoke_rtos_timer);
    timer_config(QN_TIMER0, TIMER_PSCAL_DIV, TIMER_COUNT_MS(1500, TIMER_PSCAL_DIV));
    timer_enable(QN_TIMER0, MASK_ENABLE);
        
        
         //ke_timer_set(APP_BMS_DATA_CALLBACK, TASK_APP, 100);
         //ke_timer_set(APP_SYS_BUTTON_1_TIMER, TASK_APP, 2);
        
        timer_init(QN_TIMER2, app_tick_callback_handler);
    timer_config(QN_TIMER2, 10, TIMER_COUNT_MS(100, 10));
    timer_enable(QN_TIMER2, MASK_ENABLE);
       

and Corresponding handler in user_design.c

TIMER2   increments  a 32bit global unsigned int

TIMER0  is reading data from MCU and notifying on Chs

This is all i have added

Thank You 

0 Kudos

4 Views
NXP TechSupport
NXP TechSupport

Hi Sunil,

The issue that you are having is because you have set up the timer separate from the RTOS scheduler. So, the Bluetooth LE process requires specific times previously set. 

Could you please look at the usr_led1_process? The function is using a timer for setting the callback, the scheduler will manage the resources.

Regards,

Mario

0 Kudos

4 Views
Contributor I

Hi Mario,

I have already disabled the led timers and removed the callback from the struct and added my timer handler but MCU generate hard fault every 2s if i do so. As you can seen i have commented the ke_timer_set in system.c. What can be the reason? Is it possible i am taking more processing time in handler so it is generating hard fault if i using timer through scheduler.

Thank You

Sunil Kumar

0 Kudos

4 Views
NXP TechSupport
NXP TechSupport

Hi Sunil,

Yes, it could be a problem. 

We recommend letting the scheduler manage the timer for your LEDs.

Regards,

Mario

0 Kudos

4 Views
NXP TechSupport
NXP TechSupport

Hi Sunil,

Could you please provide more details about your final application?

What is the SDK version that you are working on?

I am not sure, but it seems that you are running out of memory.Is it possible that you could provide more details about the code that you modify?

Regards,

Mario

0 Kudos