-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stuck in AdaDFU bootloader #3
Comments
Sorry, noticed only now. Adafruit bootloader is notlistening for both transports like Desay one, if it advertising as AdaDFU it wont work on serial at the same time. However it waits 3 seconds fo serial DFU after each reboot or poweron on charger from empty battery. So that is the only chance to use serial (or when forced into serial mode from micropython). This is very strange. I would suggest to use different phone. Maybe also test downloaded zip with 7zip or winzip if it is really valid zip file,maybe you downloaded github webpage instead of raw zip? |
Hi, did you resolve the issue? What was the problem? |
Hi. I tried again today. Still cannot get any chatter on serial and AdaDFU device disconnects when attempting to do a DFU update from the D6 Flasher Android app. This is with either of the micropython zip archives from the repo. I've checked that the downloaded files are valid zip archives. How do you restart the DS-D6? In the AdaDFU mode, the screen is off, so it's hard to tell what state it is in. If I open the device up, is there an easy to reach reset pin or pad? |
As explained unfortunately you have no chance with serial if it is advertising over bluetooth, It is serial or bluetooth, not both. Could be you have some interference like too many wireless devices (wi-fi, bluetooth) around like mouse, headphones. In general it should work so I'd try go to different place, turn buetooth off/on on the phone, change between nrfconnect and D6 flasher (both should work) As for reset, yes there is RST pin under OLED so you need to lift it, easier way is to momentarily shorcut battery pins on the side near usb connector (marked +,- on this photo ), that will power off the device. Then you could prepare adafruit-nrfutil command line, slide it into usb socket with usb to serial and power and it will turn on and you have up to 3 seconds to press enter for serial flashing. Also if you have it open you can always restore it fully over SWD pins via openocd. If you still have issues/questions you can also join the lobby as linked in toplevel readme. |
Same problem here. Both apps don't work. The bootloader disconnects the flasher. |
Hello, I have tried this again from scratch with two devices and can confirm this is really not working now. I am no sure what is wrong or what changed. I tried D6Flasher, nrfconnect and nrf toolbox on two phones and it is hit and miss. I did succeed once with nrf toolbox and flashed micropython blerepl to one device but I suppose I was very lucky as I could't repeat it again. This is very strange as I don't remember having any issues when I tried this months before with my first DS-D6. I even tried it like week ago and flashed another DS-D6 succesfully not noticing any issues like this. I guess that after first flashing I am mostly using dfu over serial but I had to flash it over bluetooth at least initially. Will investigate more. I guess the only way out now is to let the battery die and try the serial mode which is available for few seconds when it powers on. Or open the device of course and restore via SWD (or just shortcut battery momentarily, that will turn it off so serial is available at poweron). Sorry about that. Will investigate more. |
I may have a solution. There is similar/same issue reported here adafruit/Adafruit_nRF52_Bootloader#35
and flashed the back-to-desay package and again on first try it worked and I am back to original Desay bootloader. |
so far this worked for me but I flashed the uart version. |
this should not be needed, with uart enabled it does not last very long, so after 1 or 2 days the battery is dead so when you connect it to power again it should boot from scratch and work again, also at poweron time you have those 3 seconds to reflash it over serial via adafruit-nrfutil as for jtag, I don't have ready made guide, the easiest it probably to use openocd and just erase last flash page at 0x7f000, this should force adafruit bootloader to stay in dfu mode after restart and then you can flash recovery DFU package so check this https://gist.github.com/fanoush/06eee6344a2e59f7b12707b25d87edda and this http://openocd.org/doc/html/Flash-Commands.html and run commands like
as for full recovery there is flash write_image that can write bin or hex file BTW, the micropython console uart speed is 115200, I have added it to readme now, ch340G adapter should work and there are only 2 combinations of RX,TX. it may be that repl console gets stuck after some time but after poweron from empty battery it should work. UART hardware is power hungry so it should draw miliamps instead of microamps so the 80mAh battery should last like 8 hours with UART on. |
oh sorry 80mAh is more like 80 hours maximum, not 8 but I guess the draw is more than 1 mA, see e.g. https://devzone.nordicsemi.com/f/nordic-q-a/23444/power-consumption-on-nrf52832-with-uart so it can be like 2 days from full battery And BTW as for SWD setup I found spring loaded pogo pins to be practical, when you connect GND via USB connector it is just 2 pins, see photo here https://ibb.co/album/keQ51F Pogo pins with width 0.68 fit into standard jumper wire female socket like seen on photo, you may search ebay or aliexpress for "Spring Test Pogo Pin P50 0.68mm", should cost dollar or two for pack of 10-20. But even normal male jumper wires could work when aligned properly. I tried also soldering but teared off the pad when I had wire soldered and pulled it by mistake so I'd suggest to avoid that. |
Thanks for your help but I think the device is dead. It does not respond to anything of this. |
What you mean by "anything of this" - serial or SWD? Most probably you are just doing/connecting something wrong, it is quite unlikely to kill it just by flashing. For serial connection - do you attach also 5V (not 3.3V) to usb power pin and GND in addition to (3.3V level TTL) RX/TX? It won't start otherwise if battery is empty. OTOH if you think it is charged but not responding then I'd just put it away for few days to let the battery discharge and start again later. Hopefully you got more than one. The SWD should definitely work in any state of CPU/ram/flash if you attach GND,5V and SWD pins. Also you may measure 3.3 (VDD) voltage pin to ground, next to oled, see https://fccid.io/png.php?id=3414019&page=2 to check if it has power. Anyway if you wish you may describe exactly what you are doing in what order to check if there is some obvious mistake. |
I tried again with a ch340g and ft2322h but no uart response. Switched TX and RX and applied 5V to the USB connector. Usually the device should be rebooted if some of the rst pads is connected to ground? |
Yes, that is right. if battery is fine then for SWD you need 3 wires GND,DIO,CLK connected to STLINK v2 pins GND,SWDIO,SWCLK. GND is easier to connect via usb connector if you have usb female cable. reset is RST under OLED, for reset you need to connect it to gnd momentarily. But easier is to shortcut +/- battery briefly, that will turn it off and you will need to attach 5V to usb to wake it. |
Ok, thanks. Howe ever the RST does not work with all tries I did, the shortcut between the BAT is working properly. |
Both for reset and swd you need ground pin, are you using GND from usb connector? maybe you can scratch test points a bit to get proper contact? can you make photo of your setup? These are both really basic things that should just work (reset and SWD) |
think it was a broken pogo pin. And maybe some of the foam over the RST pad was causing no reliable connection. |
Oh, interesting. Just recently I noticed I have two types of stlink V2 dongles with switched pins - one is marked SWDIO,GND,SWCLK on right side and the other is SWCLK,SWDIO,GND (from top). The markings are correct on both as it is indeed switched inside but maybe you have one mixed. It is great it finally works for you. |
Did you patch this file too: https://github.com/fanoush/ds-d6/blob/master/micropython/DS-D6-adafruit-back-to-desay-sd132v201.zip Currently I can't get into the bootloader successfully, I see only two of the three arrows. |
yes, you are in the bootlaoder if you see the arrows :-) |
Ok, something is fishy here... I can't upload and the bootloader reaches always the timeout. I tried openocd but I fail early:
telnet:
I miss something like a flash or something to write to. Any hints? |
When I flashed
with nrfToolbox UART, nothing seemed to happen. If I try to flash |
see https://github.com/fanoush/ds-d6/tree/master/micropython#how-to-use , for bluetooth you needed the first one |
Edited, I meant ota, sorry. I tried with that, nothing seemed to happen. |
ok, if you still see mpus device (e.g. in nrfConnect Android app when scanning) then micropython is still running. Can you still connect to it in nrfConnect and see nordic uart service? Not sure what nrfToolbox UART does (e.g. regarding sending new lines), can you try https://aykevl.nl/apps/nus/ from Chrome on PC or Android phone to type in the machine.enter_ota_dfu() code? Or there is also https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal&hl=en&gl=US D6Flasher cannot handle switch from micropython (it would need to send the import+enter_ota_dfu() lines too) |
Ok, it worked from Android Chrome. Before I tried on desktop linux latest Chromium, but it said bluetooth not supported. From Android Brave it was the same. Now I'm back, thank you very much. |
Hello, I have a DS-D6 device I'm trying to update. As per the micropython instructions I flashed the patched Desay bootloader, then the Adafruit bootloader via the D6 Flasher Android app.
The DS-D6 is now advertising as AdaDFU and the D6 Flasher app detects a Nordic bootloader. However, trying to flash either of the micropython packages results in a Disconnected and
OPERATION FAILED
error. I've also tried flashing a micropython package with the nRF Connect app (since it sees the DFU service) with the same disconnect behavior.When connecting the DS-D6 USB port to a serial cable I don't see any communication at 115200 bps or 38400 bps. The
adafruit-nrfutil
errors out withTimed out waiting for acknowledgement from device
. I've tried swapping around the TX/RX lines in case I had them backwards.Any tips for flashing the uncommunicative device?
The text was updated successfully, but these errors were encountered: