Hey,
I have written a custom service for my company's sensor readings on the nRF51 DK, on top of the uart peripheral example given n SDK_11.0.0. However, for the final product development, the PCB will be using nrf51822 since it's cheaper and we don't need ANT in our product. For testing code compatibility, I have used one of the RFduino's (has nrf51822 chip) to upload the code. I have erased the boot loader and programmed the correct Softdevice S130. I also changed the target device in the code and IRAM and IROM addresses for S130 with memory of nRF51822:
IROM base: 0x1B00 - 0X25000 (256kB flash) IRAM base: 0x20001870 - 0x2790 (16kB RAM)
I also changed the clock in initialisation of SoftDevice to:
#define NRF_CLOCK_LFCLKSRC {
.source = NRF_CLOCK_LF_SRC_SYNTH,
.rc_ctiv = 0,
.rc_temp_ctiv = 0,
.xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
Which synthesises the low frequency clock from high frequency since RFduino doesn't have an external 32.768KHz oscillator.
I have tested the program is correctly flashing the LED's I soldered on two GPIO pins. I have also tested that the clock is correctly working by using a timer to flash LED's every second and it did indeed work. However, the bluetooth is not advertising although there aren't any compile errors. I have pinpointed the function where I guess the bluetooth might not be working. In the static void ble_stack_init(void):
err_code = softdevice_enable(&ble_enable_params);
I tried using breakpoints to see what went wrong, but I can't figure out the problem.
My only guess is because the revision of nrf chip on RFduino is not compatible with SDK 11.0.0?