Compiling issue: different advertising info between release build and debug build Segger Embedded Studio v5.42a SDK v17.1.0

Hello,

after importing the dfu_buttnoless service in my application, I'm experiencing a strange issue with the advertising info between release builds and debug builds.

My advertising info are basically manufacturer data (company ID plus firmware version) and ESS service

this is the relevant code:

I have these global variables defined:

 

static uint8_t fw_version[2]; //{major version, minor_version}
static uint16_t company_id = 0x008F; //Telit ID
static ble_uuid_t m_adv_uuids[] =                                   /**< Universally unique service identifiers. */
{
    {BLE_UUID_ENVIRONMENTAL_SENSING_SERVICE,           BLE_UUID_TYPE_BLE}
};

and my advertising_init() function is defined as follow:

static void advertising_init() {
  uint32_t err_code;
  ble_advertising_init_t init;
    ble_advdata_manuf_data_t manufdata;  


  memset(&manufdata, 0, sizeof(manufdata));
  
  manufdata.company_identifier = company_id;
  manufdata.data.size = 2;
  manufdata.data.p_data = fw_version;

  memset(&init, 0, sizeof(init));

  init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
  init.advdata.include_appearance = false;
  init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
  //    init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
  init.advdata.p_manuf_specific_data = &manufdata;

  init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
  init.srdata.uuids_complete.p_uuids = m_adv_uuids;

  init.config.ble_adv_fast_enabled = true;
  init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
  init.config.ble_adv_fast_timeout = APP_ADV_DURATION;
  init.evt_handler = on_adv_evt;

  err_code = ble_advertising_init(&m_advertising, &init);
  APP_ERROR_CHECK(err_code);

  ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
}

If I compile the debug build, the company id is wrong (0x0000 instead of 0x008F):

if I compile the release build, the service is wrong (General Access u1800 instead of Environmental Sensing u181A)

the main difference between release build and debug build is that release builds are optimized for size

what could be the cause of the issue?

Regards,

Rocco

Parents Reply Children
Related