I did hardware resets and power resets without any success.
I have implemented the update functions from this application, but OK, I will try to test the OTA update sample app "as is" on my board this week
I tested today the OTA update sample on my board, and it works.
I compared the 2 applications, and I discovered that I declared the device name with 24 characters. I reduced the length to 16 char and it works ! It feels as a side effect !
What is the maximum authorized length for the device name (I saw in the forum that it is also limited by the advertising length) ?
There are constraints on the advertising packet and scan response payloads. The maximum size is 31 octets each as per the BT Specification but it can be shorter. I'm not sure where the payload length is defined in the SDK code, but lets take a look.
So, if I understand (it is not so clear in others topics), each field of advertising or scan response can be 31 bytes long.
For example, if I use this classical function to define and start advertising:
// advertise first vendor specific service
if (sizeof(my_uuid_main_service) > 1)
// total length should be less than 31 bytes
adv.len = 1 + 1;
adv.val = ADV_FLAGS;
adv.data = LE_LIMITED_DISCOVERABLE | BR_EDR_NOT_SUPPORTED;
adv.len = sizeof(my_uuid_main_service) + 1;
adv.val = sizeof(my_uuid_main_service) == 16 ? ADV_SERVICE_UUID128_COMP : ADV_SERVICE_UUID16_COMP;
memcpy(adv.data, &my_uuid_main_service, sizeof(my_uuid_main_service));
// Tx power level
adv.len = TX_POWER_LEN+1;
adv.val = ADV_TX_POWER_LEVEL;
adv.data = bleprofile_p_cfg->tx_power_level;
scr.len = strlen(bleprofile_p_cfg->local_name) + 1;
scr.val = ADV_LOCAL_NAME_COMP;
memcpy(scr.data, bleprofile_p_cfg->local_name, scr.len - 1);
// start device advertisements. By default Advertisements will contain flags, device name,
// appearance and main service UUID.
in this case, could the local_name be 31 bytes long (as scan response payload), or should the total adv fields + scr length be less than 31 bytes ?
The adv and scr are separate packets so they can each be 31 bytes.
But remember each field has two bytes header (length and value).
So that leaves 29 bytes for actual data.
You can find more about adv packets in the following link:
Thanks guys. It confirms that I understood.