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

Migrating from SDK8 to SDK12: app_timer_create crashes

What is the difference between SDK 8 and SDK 12 related to app_timer? I have used it like:

APP_TIMER_INIT(
	APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS,
	APP_TIMER_OP_QUEUE_SIZE, false);

err_code = app_timer_create(&m_timer_id, APP_TIMER_MODE_REPEATED, timeoutHandler);

and this used to work. However, with SDK 12 I had to change the APP_TIMER_INIT like:

APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);

And eventually, my code crashes at the app_timer_create() (I think). What could be the reason?

FEEDBACK: Could you please provide legacy support with your new SDKs, i.e. backwards compatibility with old SDKs. This way, you are generating huge amount of extra work for your customers. Like in this case, you could have been provided identical compatibility APP_TIMER_INIT macro and provide a new one with different name, if really needed. I am extremely frustrated updating our code base to match your new ideas. END OF FEEDBACK

Parents
  • This change is not a big deal and gives better memory flexibility than in older SDK. You have to declare timer by macro, not the old way.

    Instead of using

    static app_timer_id_t m_timer_id;
    

    You have to use:

    APP_TIMER_DEF(m_timer_id);
    

    It makes the macro reserve exact amount of memory for all the timers instead of setting the limit by definition.

    about feedback: It could be hard for them to give compatibility with older SDKs, when you are updating from really old SDK 8 to SDK12. I would personally prefer more simple SDK instead of growing overhead (now it is already huge! hard to compile some examples in keil!) - backwards compatibility would complicate it even more... I just keep my old apps based on S110 on the old SDK, and new ones using new SoftDevices on new SDK.

  • For my understanding, when i see ex.:ble_bps_meas_s

    I know that it is:

    • ble
    • blood pressure
    • measurement struct

    Everything is 100% clear.

    But I may not understand Your problem correctly as I am not working on standard services, so I don't use that standard services example API... I think it would be really hard to name the function: sd_ble_gatts_sys_attr_set so one could understand it better, without knowing what is gatt server, and its system attributes. I am not really experienced embedded dev, but I found this API naming quite good.

Reply
  • For my understanding, when i see ex.:ble_bps_meas_s

    I know that it is:

    • ble
    • blood pressure
    • measurement struct

    Everything is 100% clear.

    But I may not understand Your problem correctly as I am not working on standard services, so I don't use that standard services example API... I think it would be really hard to name the function: sd_ble_gatts_sys_attr_set so one could understand it better, without knowing what is gatt server, and its system attributes. I am not really experienced embedded dev, but I found this API naming quite good.

Children
No Data
Related