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

How to interface external TWI sensor (MAX30105) with Nordic Thingy 52 application source?

I am trying to implement the MAX30105 pulse oximeter sensor along with the Nordic Thingy 52 application source.

I referred the sample ADXL375 code provided by Simon here https://devzone.nordicsemi.com/members/simoniversen and have integrated source for max30105 accordingly.

Now as I debug the code, it goes into infinite loop while executing the nrf_drv_twi_init() function invoked by twi_init().

Can you please help me understand the issue here?

I see that the handler function is missing; is it a mandatory function to have?

Parents
  • it goes into infinite loop while executing the nrf_drv_twi_init() function

    Do you mean it's going to the Error Handler ?

    Have you called nrf_drv_twi_init/twi_init elsewhere in the code?
    Yes, the source code that I am using is invoking the twi_init()

    That wasn't actually the question!

    asked if you are also nrf_drv_twi_init() elsewhere in the code.

    If you call nrf_drv_twi_init() again when it has already been called before, you will probably get an error - and end up in the Error Handler.

    This should be easy to see in the debugger ...

  • No, I am not calling nrf_drv_twi_init()  elsewhere again. 

    On line #375 while invoking nrf_drv_twi_init(), NULL is passed as the 3rd argument of event handler. 

    From documentation I get that NULL in place of event handler means working in blocking mode. 

    I see address 0x000000 in place of event handler in the watch window watching m_twi.

    So is this the reason execution end up in infinite loop since event handler is pointing to NULL?

Reply
  • No, I am not calling nrf_drv_twi_init()  elsewhere again. 

    On line #375 while invoking nrf_drv_twi_init(), NULL is passed as the 3rd argument of event handler. 

    From documentation I get that NULL in place of event handler means working in blocking mode. 

    I see address 0x000000 in place of event handler in the watch window watching m_twi.

    So is this the reason execution end up in infinite loop since event handler is pointing to NULL?

Children
Related