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

How do I get S210 serial bootloader to work with pstorage?

I think I have followed everything from:

to convert the dual_bank_serial_s110 to an S210 serial bootloader but I can't get pstorage in the bootloader to work. pstorage calls cmd_queue_enqueue() to save the command but cmd_queue_dequeue() never gets called because sys_evt_dispatch() never gets called.

It seems ble_stack_init() might be where the issue is. Given I went from a BLE to an ANT SoftDevuce. I commented out sd_ble_enable() as there is no ble. The method looks like:


static void ble_stack_init(bool init_softdevice)
{
    uint32_t         err_code;
    sd_mbr_command_t com = {SD_MBR_COMMAND_INIT_SD, };

    if (init_softdevice)
    {
        err_code = sd_mbr_command(&com);
        APP_ERROR_CHECK(err_code);
    }
    
    err_code = sd_softdevice_vector_table_base_set(BOOTLOADER_REGION_START);
    APP_ERROR_CHECK(err_code);
   
    SOFTDEVICE_HANDLER_APPSH_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, false);

    // Enable BLE stack
//    ble_enable_params_t ble_enable_params;
//    memset(&ble_enable_params, 0, sizeof(ble_enable_params));
//    ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
//    err_code = sd_ble_enable(&ble_enable_params);
//    APP_ERROR_CHECK(err_code);
    
    err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
    APP_ERROR_CHECK(err_code);
}

Any help you can give me?

Thanks, Gary

Parents
  • Hi Gary,

    Have you made sure you point the Include Path to \components\softdevice\s210\headers instead of \components\softdevice\s110\headers ?

    I tried to port the serial dual bank DFU for S110 in SDK v9.0 to S210 and here is the steps I did:

    • Change API header path to S210 (as above)
    • Change IRAM setting
    • Replace BLE_STACK_SUPPORT_REQD with ANT_STACK_SUPPORT_REQD
    • Comment out include for ble.h and ble_hci.h
    • Remove all files in nRF_BLE group
    • Define BLE_STACK_EVT_MSG_BUF_SIZE = 1 (doesn't matter, the code ignores it anyway)

    I tried it here and it worked. Attached is the project. (Tested with PCA10028 and S210v5.0).

    SDKv9.0_DFU_S210.zip

Reply
  • Hi Gary,

    Have you made sure you point the Include Path to \components\softdevice\s210\headers instead of \components\softdevice\s110\headers ?

    I tried to port the serial dual bank DFU for S110 in SDK v9.0 to S210 and here is the steps I did:

    • Change API header path to S210 (as above)
    • Change IRAM setting
    • Replace BLE_STACK_SUPPORT_REQD with ANT_STACK_SUPPORT_REQD
    • Comment out include for ble.h and ble_hci.h
    • Remove all files in nRF_BLE group
    • Define BLE_STACK_EVT_MSG_BUF_SIZE = 1 (doesn't matter, the code ignores it anyway)

    I tried it here and it worked. Attached is the project. (Tested with PCA10028 and S210v5.0).

    SDKv9.0_DFU_S210.zip

Children
Related