DS1820 / OneWire library doesn't work on mbedos5, mbedos6 (NUCLEO-F303RE)

Hello 大 电,

Is the timing on onewire devices really so tight that normal GPIO methods don’t work with RTOS?

One-wire timing constrains shouldn’t be a big issue. But, as explained here, a long transition period from digital output to digital input on some ARM targets makes it difficult or even impossible to meet. Wen you are running your code and on the serial terminal you see an error message like:

++ MbedOS Error Info ++
Error Status: 0x80FF0144 Code: 324 Module: 255
Error Message: Assertion failed: _out_to_in_transition_us < _sample_point_us
...

It indicates that your ARM chip is not capable to reconfigure the used GPIO from output to input in time (default is 13us). You can then try to change the sample point by passing a different value in the constructor.
For example:

DS1820  ds1820(D8, 15);  // sample point set to 15 us

Although in some cases (e.g. fake sensors) it could help to shorten the sampling point below 13us.

Best regards, Zoltan