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
  • Didnt touch anything there specifically, so everything inside sdk_config is as it comes from the SDK.

    ...
    
    #ifndef UART_DEFAULT_CONFIG_HWFC
    #define UART_DEFAULT_CONFIG_HWFC 0
    #endif
    
    ...
    
    // <o> NRF_LOG_BACKEND_SERIAL_UART_TX_PIN - UART TX pin
    #ifndef NRF_LOG_BACKEND_SERIAL_UART_TX_PIN
    #define NRF_LOG_BACKEND_SERIAL_UART_TX_PIN 6
    #endif
    
    // <o> NRF_LOG_BACKEND_SERIAL_UART_RX_PIN - UART RX pin
    #ifndef NRF_LOG_BACKEND_SERIAL_UART_RX_PIN
    #define NRF_LOG_BACKEND_SERIAL_UART_RX_PIN 8
    #endif
    
    // <o> NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN - UART RTS pin
    #ifndef NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN
    #define NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN 5
    #endif
    
    // <o> NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN - UART CTS pin
    #ifndef NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN
    #define NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN 7
    #endif
    
Reply
  • Didnt touch anything there specifically, so everything inside sdk_config is as it comes from the SDK.

    ...
    
    #ifndef UART_DEFAULT_CONFIG_HWFC
    #define UART_DEFAULT_CONFIG_HWFC 0
    #endif
    
    ...
    
    // <o> NRF_LOG_BACKEND_SERIAL_UART_TX_PIN - UART TX pin
    #ifndef NRF_LOG_BACKEND_SERIAL_UART_TX_PIN
    #define NRF_LOG_BACKEND_SERIAL_UART_TX_PIN 6
    #endif
    
    // <o> NRF_LOG_BACKEND_SERIAL_UART_RX_PIN - UART RX pin
    #ifndef NRF_LOG_BACKEND_SERIAL_UART_RX_PIN
    #define NRF_LOG_BACKEND_SERIAL_UART_RX_PIN 8
    #endif
    
    // <o> NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN - UART RTS pin
    #ifndef NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN
    #define NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN 5
    #endif
    
    // <o> NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN - UART CTS pin
    #ifndef NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN
    #define NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN 7
    #endif
    
Children
No Data
Related