Hello Dialog_Support Team,
After few minutes of execution of firmware, device goes into wrap_platform_reset handler of arch_system.c.
My device performs role switch operation. It performs Central and peripheral roles on time sharing basis using app_easy_timer. Here I am attaching code snippet of role switch part. Also my application is not establishing any kind of connection. It receives USER_ADVERTISE_DATA and based on received data, it performs further operations. To read advertise data string, i have used user_on_adv_report_ind function. I have also attached code snippet of user_on_adv_report_ind function.
uint8_t advertising = true;
void user_adv_stopped(uint8_t status)
{
arch_set_pxact_gpio();
// Change the GAP role to central
advertising = false;
user_app_configuration_func(GAP_CENTRAL_MST);
}
void user_scan_complete(uint8_t status)
{
advertising = true;
user_app_configuration_func(GAP_PERIPHERAL_SLV);
}
void user_app_on_set_dev_config_complete()
{
arch_set_pxact_gpio();
if(advertising)
{
app_easy_gap_non_connectable_advertise_start();
}
else // Ready to scan
{
// start a scan and a timer to stop it after some time
user_scan_start();
app_easy_timer(200, user_stop_scan);
}
}
void user_on_adv_report_ind (struct gapm_adv_report_ind const * param)
{
volatile static uint8_t param_data[ADV_DATA_LEN];
param_data[23] = param->report.data[23];
param_data[24] = param->report.data[24];
param_data[25] = param->report.data[25];
param_data[26] = param->report.data[26];
}
Depending on what values i have received in param_data, i am taking further action. I have used pwm of timer0 and timer2 for further processing of data received in advertising string. Except this I am not performing any extra functionality.
Now If I run the firmware on discovery kit, after few minutes(approximately 5-7) execution stops and go to wrap_platform_reset handler. This happens only if i receive any data in user_on_adv_report_ind function and perform further operation. If i do not perform further action on received data then firmware does not go to wrap_platform_reset handler. Can you let me know the reason why it is happening and what is the solution for that?
Thanks and Regards,
Ruchi Patel