I have been working on porting my code from Keil to gcc because it has grown larger than the 32K limit that the free version of Keil allows. I am using the s110 softdevice. I have used the example makefiles and linker files as templates with the same read-only and read-write addresses that I specified in Keil. The code will compile, link and flash, but when I initialize the bond manager (ble_bondmngr_init), the error returned is NRF_ERROR_INVALID_DATA. This code runs fine when built using Keil. I have no idea where to begin. Any help would be greatly appreciated.
EDIT: It appears that ble_bondmngr_init is not null, and the blocks are word aligned. It appears that it is returning this error from crc_extract in ble_bondmngr:
static uint32_t crc_extract(uint32_t header, uint16_t * p_crc)
{
if ((header & 0xFFFF0000U) == BOND_MANAGER_DATA_SIGNATURE)
{
*p_crc = (uint16_t)(header & 0x0000FFFFU);
return NRF_SUCCESS;
}
else if (header == 0xFFFFFFFFU)
{
return NRF_ERROR_NOT_FOUND;
}
else
{
return NRF_ERROR_INVALID_DATA; <- RIGHT HERE
}
}
My header value = 0x20003330 and BOND_MANAGER_DATA_SIGNATURE = 0x53240000 as defined by ble_bondmngr. I am not sure why my header value is so different from the expected value.