When I operate RESET PIN in main function like this:NRF_POWER->RESET = 1,Then cause a HardFault_Handler,(/attachment/fabd1141d36157d32f8c0353e4880b3e),What's this?
When I operate RESET PIN in main function like this:NRF_POWER->RESET = 1,Then cause a HardFault_Handler,(/attachment/fabd1141d36157d32f8c0353e4880b3e),What's this?
You did not answer my question: Did using sd_nvic_SystemReset() solve the problem?
this is soft reset , When the program runs to this,it will restart
Oh, then I misunderstood, I thought you wanted to perform a system reset. You want to enable the pin reset in debug interface mode. My suggestion would be to call NRF_POWER->RESET = 1; before you initialize the SoftDevice, e.g. you could do this right after entering main().
I tried it according to you said : for (;;) { if(opt_icm30631_get_flag() == 1) { opt_sensor_data_handler(); } if(enable_reset==0) { enable_reset=1; opt_reset_func(); } mkfriend_handler(); app_sched_execute(); power_manage(); } still the same mistake
If you're doing it in the for(;;) loop at the bottom of main, then you're still calling opt_reset_func(); after you have enabled the SoftDevice.
I meant calling opt_reset_func() as the first function in main.