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

SPI initialization for communicating with the sensor

I am using a custom board based on nRF52 (nRF52832-QFAB-R). I am using the ble_hid_mouse app and performing the initialization for SPI in the main routine. But with the SPI initialization code enabled the device stops even advertising whereas with SPI initialization code disabled the device does advertise. I am performing the gpiote initialization for max user 5 using the macro before SPI init. Can you please suggest what may be going wrong here? How to debug?

Thanks

Parents
  • Hey Alok,

    We need more information. "with the SPI initialization code enabled the device stops even advertising", what do you mean by stops advertising, does your softdevice calls return any error message?

    Cheers,

    Håkon.

  • Hi Håkon,

    While performing the initialization for the SPI, I am configuring a pin in order to monitor the motion events from the sensor over SPI using the routine : nrf_gpio_cfg_input(pin num, NRF_GPIO_PIN_NOPULL). After this I am registering a gpiote user/handler for the same using the call to app_gpiote_user_register() routine.

    On debugging, it is found that the app_gpiote_user_register() routine returns the ERROR code 4(No Memory).

    Just to inform that I am not doing APP_GPIOTE_INIT(MAX_USERS) or app_gpio_init() before this anywhere in the code currently but I have already tested by performing the above initialization also with same result.

    Thanks

Reply
  • Hi Håkon,

    While performing the initialization for the SPI, I am configuring a pin in order to monitor the motion events from the sensor over SPI using the routine : nrf_gpio_cfg_input(pin num, NRF_GPIO_PIN_NOPULL). After this I am registering a gpiote user/handler for the same using the call to app_gpiote_user_register() routine.

    On debugging, it is found that the app_gpiote_user_register() routine returns the ERROR code 4(No Memory).

    Just to inform that I am not doing APP_GPIOTE_INIT(MAX_USERS) or app_gpio_init() before this anywhere in the code currently but I have already tested by performing the above initialization also with same result.

    Thanks

Children
Related