This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Hi, I want to write some data to flash. SDK12.3, use FSTORAGE.The stack failed to generate system events .

I have added 'sys_evt_dispatch' to the stack, but the callback function is still not called

Parents
  • Hi,

    Are you registering the callback through softdevice_sys_evt_handler_set() in ble_stack_init() as the other examples do it? In that case, please try to \ describe how you verify that the callback is not invoked on SD SoC events. 

  • Hello, thank you for your reply. I used J_link online debugging. It's part of my code

  • Hi,

    Looks like you have registered the handler correctly. But the while loop you have at the end of m_flash_write() will become blocking if you're calling it from an interrupt with equal or higher priority than the Softdevice system events. Could that maybe explain the problem, or are you using m_flash_write() only in main context (not in an interrupt)? I suggest testing without the while loop if you're unsure. 

  • Thanks for your reply. I called it in the serial interrupt event, and now I changed it to the main loop. A flag is given in the serial port interrupt. The main loop detects the flag call m_flash_write().However, there is still no callback for the softdevice system events.Do I need to change the priority of the function?

  • If you're using the debugger to debug the application, can you halt the CPU after the flash write to make sure the program is not stuck in a loop somewhere? Also, maybe place a breakpoint in sys_evt_dispatch() to confirm it's not being reached. 

    It should not be necessary to change the interrupt priorities. 

Reply
  • If you're using the debugger to debug the application, can you halt the CPU after the flash write to make sure the program is not stuck in a loop somewhere? Also, maybe place a breakpoint in sys_evt_dispatch() to confirm it's not being reached. 

    It should not be necessary to change the interrupt priorities. 

Children
No Data