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

Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial

I'm using nRF52840 with SDK15.0.0

Following this tutorial : https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial

AT STEP 2.H my module is Advertising i can connect and then see the service and its characteristics write and read with nRF connect app.

Then at  next  step :STEP 3.A, i add : 

		BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.read_perm);
		BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.write_perm);
		cccd_md.vloc                = BLE_GATTS_VLOC_STACK;
		char_md.p_cccd_md           = &cccd_md;
		char_md.char_props.notify   = 1;

Here is problem : there is err_code 0x07 in return from sd_ble_gatts_characteristic_add, and no more advertising.

if i comment APP_ERROR_CHECK where err_code = 0x07, i can see my module advertising but i don't see the service and its characteritics

I tryed to use solutions file, but i get same problem...

Parents
  • if i comment this line : 

    char_md.p_cccd_md           = &cccd_md;

    err_code is 0x00

    i don't know if it can help, but i printed char_md.p_cccd_md value : 0x2000FEBC,

    in file ble_app_template_gcc_nrf52.ld i have values : 

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xda000
      RAM (rwx) :  ORIGIN = 0x20002274, LENGTH = 0xdd8c
    }

    I tryed to declare cc_md in static : 

    static ble_gatts_attr_md_t cccd_md;

    here i get char_md.p_cccd_md value : 0x20002F00, i still have err_code 0x07

Reply
  • if i comment this line : 

    char_md.p_cccd_md           = &cccd_md;

    err_code is 0x00

    i don't know if it can help, but i printed char_md.p_cccd_md value : 0x2000FEBC,

    in file ble_app_template_gcc_nrf52.ld i have values : 

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xda000
      RAM (rwx) :  ORIGIN = 0x20002274, LENGTH = 0xdd8c
    }

    I tryed to declare cc_md in static : 

    static ble_gatts_attr_md_t cccd_md;

    here i get char_md.p_cccd_md value : 0x20002F00, i still have err_code 0x07

Children
No Data
Related