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.
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
uart_init(QN_UART1, USARTx_CLK(0), UART_57600, 0);
timer_config(QN_TIMER0, TIMER_PSCAL_DIV, TIMER_COUNT_MS(1500, TIMER_PSCAL_DIV));
//ke_timer_set(APP_BMS_DATA_CALLBACK, TASK_APP, 100);
//ke_timer_set(APP_SYS_BUTTON_1_TIMER, TASK_APP, 2);
timer_config(QN_TIMER2, 10, TIMER_COUNT_MS(100, 10));
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
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.
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.
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?