Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PA/LNA in bootloader

Hello.

I have pa/lna on my device. It works properly in application (rssi is about 30 dbm). But when application goes into bootloader (dfu over ble using nrfconnect on android) rssi is about 95-100 dbm. 

I tried to add pa/lna init to secure_bootloader code. And when i download this on erased chip, I see that rssi is about 20-30 in bootloader mode. But function sd_ble_opt_set() return 1. And when I download the application and start dfu, the application goes into bootloader mode and the signal level becomes 100 again.

Why it happens?

Parents
  • Hi,

    I assume the PA/LNA is controlled by GPIO pins using the PA/LNA support in the SoftDevice? Essentially this is just the SoftDevice asserting selected GPIO pins when there is radioactivity, so it is no different than controlling any other GPIO pins. It should be the same in the bootloader and application, but it has to be configured in both since the SoftDevice is initialized separately in the bootloader and application. Have you checked with a logic analyzer to see if the GPIO pins are controlled as expected? How do you configure the PA/LAN control in the SoftDevice and application?

  • Where could I add PA/LNA init in secure_bootloader code? Before nrf_bootloader_init()?

    My configuration for the PA/LNA. This code the same in the bootloader and application.

    static void pa_lna_start(uint32_t gpio_pa_pin, uint32_t gpio_lna_pin)
    {
        uint8_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);
        NRF_LOG_INFO("pa_lna_assist end, result: %d, error: %s", err_code, nrf_strerror_get(err_code));
    //    APP_ERROR_CHECK(err_code);
    }

    I don’t understand why when downloading the bootloader to erased device everything works, but when I enter the bootloader mode from the application it doesn’t work.

Reply
  • Where could I add PA/LNA init in secure_bootloader code? Before nrf_bootloader_init()?

    My configuration for the PA/LNA. This code the same in the bootloader and application.

    static void pa_lna_start(uint32_t gpio_pa_pin, uint32_t gpio_lna_pin)
    {
        uint8_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);
        NRF_LOG_INFO("pa_lna_assist end, result: %d, error: %s", err_code, nrf_strerror_get(err_code));
    //    APP_ERROR_CHECK(err_code);
    }

    I don’t understand why when downloading the bootloader to erased device everything works, but when I enter the bootloader mode from the application it doesn’t work.

Children
No Data
Related