theCore-embedded / theCore

theCore: C++ embedded framework
https://forgge.github.io/theCore
Mozilla Public License 2.0
81 stars 23 forks source link

HTU21D example does not work in release mode #256

Closed forGGe closed 7 years ago

forGGe commented 7 years ago

See analyser output:

2017-05-13-003054_933x138_scrot

rasendubi commented 7 years ago

I'll decipher what happens:

It fails because the device did not answer with an ACK (due to it being resetting). Now the I2C driver is waiting for a Master Transmitter Mode Selected event, which never occurs due to the error.

This issue directly relates to #19. I would say, this issue is an instance of absent error handling.

A fast workaround is to add a ~15ms delay to allow HTU21D complete reset before issuing the read command.

forGGe commented 7 years ago

A fast workaround is to add a ~15ms delay to allow HTU21D complete reset before issuing the read command.

@Dubland, since you are working on #183 , it will be useful to you also check @rasendubi's workaround.

rasendubi commented 7 years ago

ping @Dubland ?

Dubland commented 7 years ago

With delay after soft reset example working fine. Shall I create PR for adding the delay?

Also, need to swap RX and TX for UART-to-USB converter in the documentation.

rasendubi commented 7 years ago

Shall I create PR for adding the delay?

Yes please.

forGGe commented 7 years ago

@Dubland now, when #271 is merged, I propose to try find real root cause and fix it. @rasendubi can guide you trough it.

forGGe commented 7 years ago

@Dubland any news?

forGGe commented 7 years ago

Implement in #279 Thanks to @Dubland !