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

ble_debug_assert_handler on advertising restart

Hi everyone. I have a strange problem. As we all know, there's a bug in SDK8.0.0 that dont allows to infinite advertising. To work this around i set advertising interval to maximum value and tried to restart advertising when handling advertising timeout event. Unfortunately, everytime this event occurs, function sd_ble_gap_adv_start is called and return success, but after a moment my program gets stuck in ble_debug_assert_handler. I got annoyed by this and I commented out infinite loop in assert handler and everything appears to be working. What may be the reason of calling assert handler? I dont event know what code should I show you, as there was no difference when I was using ble_advertising_start from BLE Advertising library and when I called sd_ble_gap_adv_start with params filled by hand.

Parents
  • Well the ble_debug_assert_handler(), the default one at least, has an error code, file name and line number info, so you could use those to figure out what the assert is.

    Once the assert handler has been called then you probably don't want to return from where you came and continue, it indicates an error, so getting annoyed and commenting out the loop isn't the best idea.

    Surely the simplest solution would be to make the one line change in the advertising manager to allow infinite advertising, no restarting, no assert handling, just works.

Reply
  • Well the ble_debug_assert_handler(), the default one at least, has an error code, file name and line number info, so you could use those to figure out what the assert is.

    Once the assert handler has been called then you probably don't want to return from where you came and continue, it indicates an error, so getting annoyed and commenting out the loop isn't the best idea.

    Surely the simplest solution would be to make the one line change in the advertising manager to allow infinite advertising, no restarting, no assert handling, just works.

Children
No Data
Related