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

GPIOTE input pins dont work

Hello,

I use NRF52810 with SDK 14.2.0 and softdevice 112. I need to use 7 input pins,  but if I config more than 3 pins, all signals disappear.

GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS is setted to 7.
My configuration for each pins is like below:
Fullscreen
1
2
3
4
5
6
/**< INPUT. */
nrf_drv_gpiote_in_config_t config_pwr = GPIOTE_CONFIG_IN_SENSE_TOGGLE(false);
// BTN_PWR
err_code = nrf_drv_gpiote_in_init(BTN_PWR, &config_pwr, PIN_EVT_Handler);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(BTN_PWR, true);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Parents
  • Hello,

     

    but if I config more than 3 pins, all signals disappear.

     It sounds like your error handler catches something. Have you tried to debug? 

    Probably one of your APP_ERROR_CHECK(err_code) receives an err_code != 0. Turn off optimization to  be able to see the value of err_code while debugging, and set breakpoints on APP_ERROR_CHECK(). Which one has an err_code != 0?

    (NRF_SUCCESS = 0)

  • err_code = 0 always. I have found than it doesnt connect with number of pins. So, if i config some pin (for example, 31), response of  GPIOTE_IRQHandler will disappear. State in IN register is toggled, but CNF->SENS  doesnt react

  • Ok. And NRF_LOG_ENABLED is 0 or 1?

    The reason I ask is because it sounds like somewhere in the project the application "crashes", and the most common reason is because an APP_ERROR_CHECK(err_code) receives an err_code != 0.

    I don't know what HW you are testing on, but if you can connect an UART to it (if it is a DK, then it is connected to the on board Segger chip). Alternatively you can use the RTT backend if you have a segger debugger. You can use JLink RTT Viewer.

    The error handler is a very useful tool while developing, and one way is to monitor it via the log. It will let you know if APP_ERROR_CHECK() receives != 0.

    Another way is to define DEBUG in your preprocessor defines and set a breakpoint on line 73 in the app_error.c. But you may need to disable optimization to see what err_code it was and where it occured.

  • NRF_LOG_ENABLED is set.

    I can not use logging, because it`s a custom board,  and it hasnt got any external pin for uart logging and rtt logging with RTT Viewer doesnt work.

    I use define DEBUG, but I havent got hard error.

    Now, I trying to find mistake in the board. Maybe, it is not problem in the code.

  • LeonardPak said:
    and rtt logging with RTT Viewer doesnt work.

     Why? 

     

    LeonardPak said:
    I use define DEBUG, but I havent got hard error.

    Do you mean that it doesn't stop on line 73 in app_error.c?

    If you want to check whether it is the application that contains a bug or not, you can try your project on a DK, and just test by shorting GND to the pins that you use as input (remember to set pullup in the configuration, since the DK doesn't have external pull-up resistors).

  • I dont now, why RTT Viewer doesnt work. But I find the solution! My problem is the same as this .  Now all is well.

  • That is good news. I didn't understand exactly what the issue was. Didn't you already use toggle?

    Best regards,
    Edvin

Reply Children