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

NRF52 BLE examples not working with gcc

After working with NRF51822, I decided to go for NRF52832, and I bought some modules that have NRF52. I am using GCC and SDK13. I installed the S132 soft device which is in "sdk13\components\softdevice\s132\hex" using NRFGo. Then, I compiled and tested the blink example which is in "blinky\pca10040\s132", and it worked perfectly. However, none of BLE examples don't work at all. I tested many samples like "ble_peripheral\ble_app_beacon". However, the device doesn't advertise. I've done all the necessary things completely. Even the blinky example works, and I don't know why BLE examples are not working. Please, help me

This is the module that I am using image description

Parents
  • Hi,

    Assuming that the board don't have a LFCLK crystal oscillator, you will need to use the LFCLK RC oscillator. For SDK 13 you can change this in ble_stack_init()

    Code snippet:

    static void ble_stack_init(void)
    {
        ret_code_t err_code;
    
        nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;
        clock_lf_cfg.source = NRF_CLOCK_LF_SRC_RC;
        clock_lf_cfg.rc_ctiv = 32;
        clock_lf_cfg.rc_temp_ctiv = 2;
            
    
        // Initialize the SoftDevice handler module.
        SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
        .
        .
        .
    
  • the pre compiled example does not work but i think this is likely because of the need to change the lfclk. i flashed softdevice using the make flash_softdevice command .

Reply
  • the pre compiled example does not work but i think this is likely because of the need to change the lfclk. i flashed softdevice using the make flash_softdevice command .

Children
No Data