atc1441/ZBS_Flasher

Label doesn't reboot using pass through mode with an ESP32

Albert-nl opened this issue · 2 comments

Hi,

when I tried to use pass trough mode with a 2.9" RBW e-label using an ESP32, the label didn't properly reboot. I got this message on the uart tx output:

$ python3 zbs_flasher.py /dev/ttyUSB0 read image pass
Using port: /dev/ttyUSB0
ZBS Flasher version: 32
Reading flash now
65536 / 65536 100% 11 seconds
Reading flash done, now saving the file
Saving file done, it took 11 seconds
ZBS Reset
Pass Through mode:
booted at 0x1aec Reset reason: 00
SFDP: header not found
failed to init eeprom

It seemed to me the hardware SPI from the ESP somehow locked the SPI bus for the label.
After adding a spi->end() in the reset function this was solved.

diff --git a/ESP32_Flasher/src/zbs_interface.cpp b/ESP32_Flasher/src/zbs_interface.cpp
index df8f650..5675b9a 100644
--- a/ESP32_Flasher/src/zbs_interface.cpp
+++ b/ESP32_Flasher/src/zbs_interface.cpp
@@ -88,6 +88,7 @@ void ZBS_interface::enable_debug()
  
 void ZBS_interface::reset()
 {
+    spi->end();
     pinMode(_SS_PIN, INPUT);
     pinMode(_CLK_PIN, INPUT);
     pinMode(_MOSI_PIN, INPUT);

With that fix the label rebooted properly, pass throuh mode worked and I could see the label associated to the master

Hope that helps,
Albert

Thanks a lot, did add it to the code

Great, working fine indeed.