hydrafw: 1-wire: scan does not work with multiple devices
I bought a HydraBus a few days ago and started to play with it:
> show system
HydraFW (HydraBus) v0.9-beta-115-ge463bc7 2020-01-29
sysTime: 0x046b48aa.
cyclecounter: 0x00809116 cycles.
cyclecounter64: 0x0000000000809128 cycles.
10ms delay: 1680032 cycles.
MCU Info
DBGMCU_IDCODE:0x10076413
CPUID: 0x410FC241
Flash UID: 0x31001A 0x58535011 0x20383658
Flash Size: 1024KB
Kernel: ChibiOS 5.1.0
Compiler: GCC 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 227977]
Architecture: ARMv7E-M
Core Variant: Cortex-M4F
Port Info: Advanced kernel mode
Platform: STM32F405 High Performance with DSP and FPU
Board: HydraBus 1.0
Build time: Jan 29 2020 - 20:45:13
The firmware isn’t all up-to-date, but I don’t have the STM flasher available, so I probably cannot easily update it.
However, as the onewire code didn’t change since 2019, I experience issues with the scan
command, which are probably still valid.
- Attached are two (original) DS1820 (no “S” version or anything newer), to +5V, Data, GND.
- Communication works, but only after
pull up
. Maybe that would be a more sensible default thanfloating
? - The
scan
command works with one DS1820 attached:
> 1-wire
Device: onewire1
GPIO resistor: floating
Bit order: LSB first
onewire1> pull up
onewire1> scan
Discovered devices : 10 54 D0 D3 00 08 00 A8
onewire1>
- …or the other:
onewire1> scan
Discovered devices : 10 D5 E9 D3 00 08 00 02
- Attaching both DS1820 in parallel, it scans indefinitely until Reset/UBTN:
onewire1> scan
Discovered devices : 10 54 D0 D3 00 08 00 A8
10 54 D0 D3 00 08 00 A8
10 54 D0 D3 00 08 00 A8
10 54 D0 D3 00 08 00 A8
10 54 D0 D3 00 08 00 A8
[...]
and only finds one of the two.
- Both DS1820 are working. I can (with only one attached) scan for both of them, and when both are attached, I can individually send them ROM_MATCH commands and let them sample a temperature or return their latest temperature reading.
I’d be willing to hack on this, but I would need to have a programmer, is that right? Flashing over USB or UART does not work?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (14 by maintainers)
I opened an issue for getting infrastructure for scan results into place.
Meanwhile, here’s an updated patch. The search state is placed into a struct (instead of global variables). Works for me. I’d appreciate comments on this new patch: onewire-scan.patch.txt.