Hi there,
I've provided an implementation of chirp_bsp.h i.e. a board support package functions to interface Chirp SonicLib, for the Nordic nRF52840-DK. I'm having difficultly initialising the CH-201 I've got hooked up. I'm unsure of what the condition is, but sometimes the initialisation works, sometimes it doesn't. I can consistently reproduce the initialisation problem after leaving the DK unpowered for some time (like overnight).
In essence, the I2C interface (known as TWI in the Nordic world) is stating that the program address (0x45) is bad. The program pin appears to be high. However, *sometimes* all is well, which leads me to think that the wiring side of things is ok.
Here's what the nRF52 logs report:
<info> app_timer: RTC: initialized.
<info> TWIM: Function: nrfx_twim_init, error code: NRF_SUCCESS.
<info> TWIM: Instance enabled: 0.
<info> TWIM: Transfer type: XFER_TX.
<info> TWIM: Transfer buffers length: primary: 3, secondary: 0.
<debug> TWIM: Primary buffer data:
<debug> TWIM: 85 FC FF |...
<debug> TWIM: Secondary buffer data:
<debug> TWIM: |
<debug> TWIM: TWIM: Event: NRF_TWIM_EVENT_ERROR.
<debug> TWIM: TWIM: Event: NRF_TWIM_EVENT_STOPPED.
<warning> TWIM: Function: nrfx_twim_xfer, error code: NRF_ERROR_DRV_TWI_ERR_ANACK.
<info> TWIM: Transfer type: XFER_TX.
<info> TWIM: Transfer buffers length: primary: 2, secondary: 0.
<debug> TWIM: Primary buffer data:
<debug> TWIM: C2 40 |.@
<debug> TWIM: Secondary buffer data:
<debug> TWIM: |
<debug> TWIM: TWIM: Event: NRF_TWIM_EVENT_ERROR.
<debug> TWIM: TWIM: Event: NRF_TWIM_EVENT_STOPPED.
<warning> TWIM: Function: nrfx_twim_xfer, error code: NRF_ERROR_DRV_TWI_ERR_ANACK.
<info> TWIM: Transfer type: XFER_TX.
<info> TWIM: Transfer buffers length: primary: 2, secondary: 0.
<debug> TWIM: Primary buffer data:
<debug> TWIM: C2 11 |..
<debug> TWIM: Secondary buffer data:
<debug> TWIM: |
<debug> TWIM: TWIM: Event: NRF_TWIM_EVENT_ERROR.
<debug> TWIM: TWIM: Event: NRF_TWIM_EVENT_STOPPED.
<warning> TWIM: Function: nrfx_twim_xfer, error code: NRF_ERROR_DRV_TWI_ERR_ANACK.
<info> TWIM: Transfer type: XFER_TX.
<info> TWIM: Transfer buffers length: primary: 1, secondary: 0.
<debug> TWIM: Primary buffer data:
<debug> TWIM: 00 |.
<debug> TWIM: Secondary buffer data:
<debug> TWIM: |
<debug> TWIM: TWIM: Event: NRF_TWIM_EVENT_ERROR.
<debug> TWIM: TWIM: Event: NRF_TWIM_EVENT_STOPPED.
<warning> TWIM: Function: nrfx_twim_xfer, error code: NRF_ERROR_DRV_TWI_ERR_ANACK.
<error> app: ERROR 3 [NRF_ERROR_INTERNAL] at ../../../main.c:46
PC at: 0x000072FD
<error> app: End of error report
Any ideas?
For further info, I've distilled the code into a smaller example which is similar to the "find_sensors" function in the sample chbsp_chirp_samg55.c file. I now call this code having setting up the nRF52840-DK's clocks and GPIO. I get the same result i.e. the ANACK.
Hi huntc,
I'm also facing same issue right now, did you figured it out. If you help me also with the solution.