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

Interference of bsp-module while re-configuring NFC-pins as GPIOs

Hello,

on my custom board I am trying to use pin P0.09 and P0.010 for interrupt-purposes. So I integrated the necessary adjustments as mentioned in this topic here, which resulted in an immediate 'halt' of my board, upon entering the configuration for the bsp-module!

Here are the relevant code-snippets:

a) gpio_config() [called 1st]

{
    ret_code_t err_code;

    err_code = nrf_drv_gpiote_init();
    check_error_code(__func__, err_code, 1);

    nrf_drv_gpiote_in_config_t pin_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);
    nrf_gpio_cfg_input(IRQ_PIN, NRF_GPIO_PIN_NOPULL);

    err_code = nrf_drv_gpiote_in_init(IRQ_PIN, &pin_config, irq_evt_handler);
    check_error_code(__func__, err_code, 2);
    nrf_drv_gpiote_in_event_enable(IRQ_PIN, true);

    printf("%s(): GPIOs initialized\r\n", __func__);
} 

b) bsp_config(bool *p_erase_bonds) [called 2nd]

{
    bsp_event_t startup_event;
    uint32_t err_code = NRF_SUCCESS;

    err_code = bsp_init(BSP_INIT_LED | BSP_INIT_BUTTONS,
                        APP_TIMER_TICKS(100, APP_TIMER_PRESCALER),
                        bsp_evt_handler);
    if (err_code != NRF_ERROR_INVALID_STATE)
    {
        check_error_code(__func__, err_code, 1);
    }// if (err_code != NRF_ERROR_INVALID_STATE)

    err_code = bsp_btn_ble_init(NULL, &startup_event);
    if (err_code != NRF_ERROR_INVALID_STATE)
    {
        check_error_code(__func__, err_code, 2);
    }// if (err_code != NRF_ERROR_INVALID_STATE)

    *p_erase_bonds = (startup_event == BSP_EVENT_CLEAR_BONDING_DATA);

    printf("%s(): BSP initialized\r\n", __func__);
}

Whenever I configure IRQ_PIN as 9 or 10, then I wont see the log-message in bsp_config() (neither anything after that), unless I comment out everything within bsp_config() (both functions get called directly after each other). While disabling the bsp_config()-functionality the IRQ_PIN works as expected for 9 or 10 and also the log-messages after bsp-config() are shown.

I already had an issue with the GPIO- and the BSP-module once (see here), but this time it seems to be a different situation. Jorn pointed out that pin 13-20 will be configured by the bsp-module, but what happens for 9 and 10? I thought if I take care of that default-configuration it should be enough...

Also checked the register-adress '0x1000120C' and it shows the value '0xFFFFFFFE' which should be absolutely fine and corresponding to the adjustments taken above.

If you got any idea what might cause this problem, please let me know!

Parents
  • Yes I already tried using the preprocessor-flag and also your description for modifying the loader-file including the uicr-register-initialization. Strangely is that I am not seeing any debug-output, neither from within gpio_config() (which is as expected) or from within bsp_config() (here it should cause some error due to a potential re-configuration). I do have the APP_ERROR_CHECK()-api in place inside my check_error_code()-wrapper including a preceeding printf() for any error-code that might get checked. But there is nothing - its just not showing anything from bsp_config() or anything afterwards! But I cant realy imagine that it might run in some branch within the corresponding SDK-api, that is not showing any debug-messages...

Reply
  • Yes I already tried using the preprocessor-flag and also your description for modifying the loader-file including the uicr-register-initialization. Strangely is that I am not seeing any debug-output, neither from within gpio_config() (which is as expected) or from within bsp_config() (here it should cause some error due to a potential re-configuration). I do have the APP_ERROR_CHECK()-api in place inside my check_error_code()-wrapper including a preceeding printf() for any error-code that might get checked. But there is nothing - its just not showing anything from bsp_config() or anything afterwards! But I cant realy imagine that it might run in some branch within the corresponding SDK-api, that is not showing any debug-messages...

Children
No Data
Related