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

racp nrf52 external memory

Hello, I have in a multi-sensor application some actual data (including RTC) which appear continuously and which have to be saved in an external RAM connected by I²C. All these data for one time take 20 Bytes and build a data set. Up to 1024 data sets shall be saved; an external device like a Tablet or a Smartphone shall read them all or only a part of it. I saw the interesting blog devzone.nordicsemi.com/.../ but unfortunately this is for nrf51 and with encryption - in my project the encryption is planned much later. My questions are:

  • Is there any example with code, which shows how to implement this?
  • Is it possible to preview already the encryption for the future? Thanks in advance
Parents
  • The function advertising_init() is implemented like shown in SDK13:

    static void advertising_init(void) { ret_code_t err_code; uint8_t adv_flags; ble_advdata_t advdata; ble_adv_modes_config_t options;

    // Build and set advertising data
    memset(&advdata, 0, sizeof(advdata));
    
    adv_flags                       = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    advdata.name_type               = BLE_ADVDATA_FULL_NAME;
    advdata.include_appearance      = true;
    advdata.flags                   = adv_flags;
    advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    advdata.uuids_complete.p_uuids  = m_adv_uuids;
    
    memset(&options, 0, sizeof(options));
    options.ble_adv_whitelist_enabled      = true;
    options.ble_adv_directed_enabled       = true;
    options.ble_adv_directed_slow_enabled  = false;
    options.ble_adv_directed_slow_interval = 0;
    options.ble_adv_directed_slow_timeout  = 0;
    options.ble_adv_fast_enabled           = true;
    options.ble_adv_fast_interval          = APP_ADV_FAST_INTERVAL;
    options.ble_adv_fast_timeout           = APP_ADV_FAST_TIMEOUT;
    options.ble_adv_slow_enabled           = true;
    options.ble_adv_slow_interval          = APP_ADV_SLOW_INTERVAL;
    options.ble_adv_slow_timeout           = APP_ADV_SLOW_TIMEOUT;
    
    err_code = ble_advertising_init(&advdata, NULL, &options, on_adv_evt, ble_advertising_error_handler);
    APP_ERROR_CHECK(err_code);
    

    }

    The error appears in the function advertising_start(erase_bonds) just before the for (;;) loop in main(); in this ble_advertising_start(ble_adv_mode_t advertising_mode) is called. Inside this ble_advertising_init() a local parameter structure ble_gap_adv_params_t adv_params is declared and initialized with 0; then only the type and fp element are preset to 0; a little bit later the interval is set to 40 and the timeout to 30 and then the function sd_ble_gap_adv_start is called with the error nr. 7, so all coming from SDK13. I don't know what to change/replace/add... Do you have any idea?

Reply
  • The function advertising_init() is implemented like shown in SDK13:

    static void advertising_init(void) { ret_code_t err_code; uint8_t adv_flags; ble_advdata_t advdata; ble_adv_modes_config_t options;

    // Build and set advertising data
    memset(&advdata, 0, sizeof(advdata));
    
    adv_flags                       = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    advdata.name_type               = BLE_ADVDATA_FULL_NAME;
    advdata.include_appearance      = true;
    advdata.flags                   = adv_flags;
    advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    advdata.uuids_complete.p_uuids  = m_adv_uuids;
    
    memset(&options, 0, sizeof(options));
    options.ble_adv_whitelist_enabled      = true;
    options.ble_adv_directed_enabled       = true;
    options.ble_adv_directed_slow_enabled  = false;
    options.ble_adv_directed_slow_interval = 0;
    options.ble_adv_directed_slow_timeout  = 0;
    options.ble_adv_fast_enabled           = true;
    options.ble_adv_fast_interval          = APP_ADV_FAST_INTERVAL;
    options.ble_adv_fast_timeout           = APP_ADV_FAST_TIMEOUT;
    options.ble_adv_slow_enabled           = true;
    options.ble_adv_slow_interval          = APP_ADV_SLOW_INTERVAL;
    options.ble_adv_slow_timeout           = APP_ADV_SLOW_TIMEOUT;
    
    err_code = ble_advertising_init(&advdata, NULL, &options, on_adv_evt, ble_advertising_error_handler);
    APP_ERROR_CHECK(err_code);
    

    }

    The error appears in the function advertising_start(erase_bonds) just before the for (;;) loop in main(); in this ble_advertising_start(ble_adv_mode_t advertising_mode) is called. Inside this ble_advertising_init() a local parameter structure ble_gap_adv_params_t adv_params is declared and initialized with 0; then only the type and fp element are preset to 0; a little bit later the interval is set to 40 and the timeout to 30 and then the function sd_ble_gap_adv_start is called with the error nr. 7, so all coming from SDK13. I don't know what to change/replace/add... Do you have any idea?

Children
No Data
Related