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

why pa_assist changed my NRF_GPIOTE->CONFIG[0] nterrupt configuration,Program can‘nt enter interrupt?

now,i have a problem,My interrupt configuration,

NRF_GPIOTE->CONFIG[0] =  (GPIOTE_CONFIG_POLARITY_HiToLo << GPIOTE_CONFIG_POLARITY_Pos)

                                           | (EXIT_PIN << GPIOTE_CONFIG_PSEL_Pos) 

                                         | (GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos);

that Equivalent to  NRF_GPIOTE->CONFIG[0] =0x00031f01,if i use the pa_assist(PA_TXEN, PA_RXEN_NONE);

this function changed my interrupt configuration to NRF_GPIOTE->CONFIG[0] =0x0;when pa_assist(PA_TXEN, PA_RXEN_NONE) wroks  NRF_GPIOTE->CONFIG[0] =0x31103, I just according 0x31103 find what it relation the pa_assist,so i don't use pa_assist(PA_TXEN, PA_RXEN_NONE), it works ok.

      so if i use pa_assist,my interrupt configuration is Invalid,you know why?

the below is my function,  PA_TXEN  is 17, EXIT_PIN   is 31

void pa_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 assist
ble_opt_t opt;
memset(&opt, 0, sizeof(ble_opt_t));
// Common PA config
opt.common_opt.pa_lna.gpiote_ch_id = gpio_toggle_ch; // GPIOTE channel
opt.common_opt.pa_lna.ppi_ch_id_clr = ppi_set_ch; // PPI channel for pin clearing
opt.common_opt.pa_lna.ppi_ch_id_set = ppi_clr_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

// opt.common_opt.pa_lna.lna_cfg.active_high = 1;
// opt.common_opt.pa_lna.lna_cfg.enable = 1;
// opt.common_opt.pa_lna.lna_cfg.gpio_pin = gpio_lna_pin;
err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &opt);
APP_ERROR_CHECK(err_code);
}

my english is not good.

Thank you very much

Parents Reply Children
  • sdk16_base.rar

    this is my project,

     i don't use pa_assist(PA_TXEN, PA_RXEN_NONE), it works ok

     i  use pa_assist(PA_TXEN, PA_RXEN_NONE), it works not ok

    NRF_GPIOTE->CONFIG[0] =0x00021f01,pa_assist will changed it NRF_GPIOTE->CONFIG[0] =0x0,when  pa_assist  works NRF_GPIOTE->CONFIG[0] =0x00031103.

    Thank you very much

  • hello,i have another question

         i don't use pa_assist(PA_TXEN, PA_RXEN_NONE),and i don‘’t use adv_scan_start(erase_bonds),i can Receive the data  through interrupt  many times ,the data is through  uart to spi by another device,

       but  i don't use pa_assist(PA_TXEN, PA_RXEN_NONE),and i  use adv_scan_start(erase_bonds),i can only Receive the data  through interrupt  one time or two times or three times,then the program run to app_error_fault_handler,

    case NRF_FAULT_ID_SD_ASSERT:
    printf("SOFTDEVICE: ASSERTION FAILED"); 
    the pc=0x000172C0,

    i use sdk16, s132_nrf52_7.0.1_softdevice.

    the External Interrupt  can break ble when the ble is running ?i don‘t know why?’

  • Hi,

    I'm not sure I understand the problem correctly, I'm not able to reproduce the issue. When I use the debugger in µvision I see no change in value for the GPIOTE->CONFIG[0] register after the pa_assist() function call. See attached images.  

Related