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);
        .
        .
        .
    
  • Actually, I bought this module from a website in China and the only resource that I have is the photo. It seems that the module has a crystal on it which can be seen in the photo. I don't know whether is it for LF or anything else. It is true that the examples are meant for Devkits, however, I believe they are actually for the NRF52832 IC and not the Dev Kits so that with some modification they can work with any module. it seems that the module has all the necessary components because I was able to run the Blinky example. I inserted the codes for using LFCLK RC oscillator and the result is the same and I don't get anything from the device. I will go for another DevKit, however, the problem remains a mystery for me. RTT connects to the device. But it just connects and I don't get any debugging from it.

    image description

Reply
  • Actually, I bought this module from a website in China and the only resource that I have is the photo. It seems that the module has a crystal on it which can be seen in the photo. I don't know whether is it for LF or anything else. It is true that the examples are meant for Devkits, however, I believe they are actually for the NRF52832 IC and not the Dev Kits so that with some modification they can work with any module. it seems that the module has all the necessary components because I was able to run the Blinky example. I inserted the codes for using LFCLK RC oscillator and the result is the same and I don't get anything from the device. I will go for another DevKit, however, the problem remains a mystery for me. RTT connects to the device. But it just connects and I don't get any debugging from it.

    image description

Children
No Data
Related