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

Configuration changes from nRF52832-DK to BL654PA module

Hi Guys

I recently made my own PCB for a project. On the PCB I am using a Laird BL654PA Module with external antenna. All the I/O's work great but im struggling with the BLE on the chip.

I'm trying to run the ble_beacon example which works fine on the 52832 DK and my Samsung. But however if I flash it to the BL654PA it doesn't work allthought it is able to flash the software and the softdevice. 

Im using:

- SDK16

- nRF52832-DK as a programmer

- S140 Soft device

- BL654PA Module

Somehow I feel like that I have to change a few parameters in the sdk_config.h file but I dont know what exactly because I am a newbie. I already found out that I have to eneable "NRF_LOG_BACKEND_RTT_ENABLED" to get some log informations from the J-Link RTT Viewer.

I also found a post about the external crystal... however I am using the internal crystal from the BL654PA and changed the settings according to this post: https://devzone.nordicsemi.com/f/nordic-q-a/46564/error-133-0x85-gatt-error-on-nrf52840/183860#183860 , bit it did not work...

What else has to be changed to make the ble_beacon example running on the BL654PA? 

Thanks in advance

Michael

  • thanks for your answer! I will have a look at this guide. 

    Thanks a lot!

  • Hello it's me again...

    As I am not a very experienced programmer, the guide which you suggested to me was somehow to advanced and I was not able to understand how I have to extend the example code fron the ble_app_beacon or ble_app_blinky.

    But I looked for similar posts in the forum and I found this post (PA_LNA Support S140). I copied the function and the function call into the example und flashed the soft device and the code to the board even though I was not completely understanding the code (shame on me).

    Now the current consumtion of my BL654PA is around 100mA which made me curious and I hope I did not destroy the chp Disappointed Also when I erase the chip it still draws 100mA... this matches the current consumption of the data sheet at maximum tx power. but I am still not able to see the chip on my phone.

    Normal example (without BLE) still work on the chip..

    What am I doing wrong? Was it a bad approach to copy the code from this post?

    kind regards

    Michael

  • UPDATE:

    it woks now. after several times erasing and flashing it seems to work now. with this code

    static void pa_lna_assist(uint32_t gpio_pa_pin, uint32_t gpio_lna_pin)
    {
        ret_code_t err_code;
    
        static const uint32_t gpio_toggle_ch = 0;
        static const uint32_t ppi_set_ch = 0;
        static const uint32_t ppi_clr_ch = 1;
        
        // Configure SoftDevice PA/LNA assist
        ble_opt_t opt;
        memset(&opt, 0, sizeof(ble_opt_t));
    	
        // Common PA/LNA config
        opt.common_opt.pa_lna.gpiote_ch_id  = gpio_toggle_ch;        // GPIOTE channel
        opt.common_opt.pa_lna.ppi_ch_id_clr = ppi_clr_ch;            // PPI channel for pin clearing
        opt.common_opt.pa_lna.ppi_ch_id_set = ppi_set_ch;            // PPI channel for pin setting
    	
        // PA config
        opt.common_opt.pa_lna.pa_cfg.active_high = 1;                // Set the pin to be active high
        opt.common_opt.pa_lna.pa_cfg.enable      = 1;                // Enable toggling
        opt.common_opt.pa_lna.pa_cfg.gpio_pin    = gpio_pa_pin;      // The GPIO pin to toggle
      
        // LNA config
        opt.common_opt.pa_lna.lna_cfg.active_high  = 1;              // Set the pin to be active high
        opt.common_opt.pa_lna.lna_cfg.enable       = 1;              // Enable toggling
        opt.common_opt.pa_lna.lna_cfg.gpio_pin     = gpio_lna_pin;   // The GPIO pin to toggle
    
        err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &opt);
        APP_ERROR_CHECK(err_code);
    }

    and this is the function call:

    pa_lna_assist(NRF_GPIO_PIN_MAP(1,2),NRF_GPIO_PIN_MAP(1,4));

    I am happy that it worked and the chip is not damaged. But I still don't know how to set tx power and I also dont know how to deactivate the ble again.

    Is there a guide with simple explanations?

    kind Regards 

    Michael

  • Hi Michael,

    I'm not sure why it would help to re-program it several times, but glad to hear that it works now. You can adjust the TX power by calling sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, 0, <TXPOWER>) after enabling the Softdevice. The default is 0 dBm.

    For the beacon example, you can call advertising stop to stop all BLE activity. It is not necessary to disable the Softdevice, etc. There is also a beginners' guide on BLE advertising here that you may be interested in https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-advertising-a-beginners-tutorial 

Related