-
Notifications
You must be signed in to change notification settings - Fork 230
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 bootloader after initial flashing (P8) #222
Comments
Flashing display or stuck in a cycle has happened to me before and I call it softbricking the device. where the watch being very slow in processing and responding to the program command request When I say slow its compared my phone. I use to often press the button prematurely thinking I may be able to break out of the loop of flickering display or switching between two screens. Solution that worked for me was wait for the battery to drain completely and upload the new firmware using dfu.py and not OTA daflasher Android App https://wiki.pine64.org/wiki/Switching_your_PineTime_between_InfiniTime_and_Wasp-os But you may also try recovery bootloader https://github.com/Peetz0r/wasp-reloader/releases/tag/infinitime-0.14.1-recovery |
I'm also having this problem and flashed the MCUBoot bootloader with SWD and it does not boot, completely black screen. What do you think I should do? |
Thanks for the comments although I think there might have been a bit of a misunderstanding here. The original reporter is describing a problem using the P8b rather than the PineTime. AFAIK neither Infinitime nor mcuboot have been ported to the P8b. Regarding the original reports, 5 seconds is the watchdog timeout so it sounds like watch is stuck somewhere during boot and it unable to feed the dog. Of course the big question is why and I'm afraid that is not clear since I've never seen anything like this before. If I understood the report correclty the bootloader stays on the boot graphic (the wasp-os logo) indefinitely until you don't press the button? And that pressing the button makes the screen go black and then five seconds later there is a reset? Did the same thing happen with the reloader.zip or did that run properly (when the reloader runs properly it puts up a small blue logo (a pinecone I think) which slowly fills with white as a progress meter. When the pinecone is entirely white the device should reset. |
What you just described is 90% accurate. The only thing thats different is that the watch does not stay on the bootloader graphic indefinitely, it resets by itself after almost exactly 5 min. Just tested the reloader and the same problem still persists after the pinecone graphic. |
Hi, I have a P8b MOY-TON5 in the same status but I've followed different steps:
After that the screen is black, if I do |
@evanhuang117: Can you confirm you are using a P8b smartwatch? Earlier you said you installed mcuboot which implies you have a different device. |
I think we should assume that the watchdog it not being fed. There could be two reasons for this:
Removing boot.py from the manifest is a very good idea since that greatly simplifies what is happening. Basically micropython should initialize itself and then enter a loop waiting for characters: I guess the task is to figure out whether (without boot.py in the manifest) if we reach this bit of code. Perhaps you could try pulsing the motor from this bit of code or something like that (try pulsing it early in main first to make sure the motor pulsing code it OK. Of course if we have a reproduction on an unsealed system with SWD then we could try to get the system halted during those five seconds before it resets and try to read out a backtrace would give us further clues. |
If I'm correct the P8b's have a magnetic charger? The Wasp bootloader is the closest I've ever had to a working bootloader, all others have not turned on at all. The builds in this issue for Infinitime are supposed to work for the P8 but all show a black screen. Currently testing removing boot.py, will update later. Update: I reflashed with
|
Hello, every now and then, the watch reboots from the bootloader and follows the same pattern without pressing the button. Pressing the button makes the screen go black, then immediatelly the wasp logo appears for a short time, then the screen goes black for 5 seconds and then the wasp logo appears with the bluetooth icon. reloader.zip worked properly. The white pinecone icon appeared and then started filling as a progress meter. When it became entirely white, the device did reset and then reentered the bootloader. |
@arvchristos Just a note to remember https://www.colmi.com/pages/contact-us do not make / manufacture the hardware like Pine64 design and make their own PineTime watch and it has been common practice among Chinese they often switch vendors and part base on price and availability So if there is no guarantee on consistent behavior response from the P8 watch. However given price and performance of P8 you may get lucky and it all works. |
I tried triggering a motor pulse in main.py and nothing happened so I guess there should be an issue with the device. I have a sealed device so no way to use SWD at the moment. |
I'm having the same issue. Has anyone had success in correctly booting WaspOS on a sealed P8b? |
One tip, the P8 with TON firmware does not have 32kHz crystal soldered on board, if micropython is built with softdevice initialization that requires crystal, it may do this. Previous P8 versions had this component soldered. bootloader may be built without this => it can still work. |
it is this line https://github.com/daniel-thompson/micropython/blob/e0cb9de8a7e788a533bd91fa3710ddb4b44ff1fb/ports/nrf/drivers/bluetooth/ble_drv.c#L147 |
I've tested @fanoush 's recommendation on my P8b TON5 watch, adding "CFLAGS += -DBLUETOOTH_LFCLK_RC" to https://github.com/daniel-thompson/micropython/blob/e0cb9de8a7e788a533bd91fa3710ddb4b44ff1fb/ports/nrf/boards/p8/mpconfigboard.mk and rebuilding from source did the trick for me. |
Hm, didn't work for me, unfortunately. Did you change anything else? |
I just built it with gcc-8 on Debian, and it works! :-) |
Just tested this and it worked, thank you for figuring this out! |
For people, dont want to compile wasp-os specifically for the P8b MOY-TON5 with the CFLAGS += -DBLUETOOTH_LFCLK_RC if you want to know what i modify to compile it. all my work are here https://github.com/Elenedeath/wasp-os/tree/P8b this is my zip file based on source for wasp-os 0.4.1 i try to flash bootloader via daflasher or OpenOCD and all method work. this is the bootloader.hex for flashing via OpenOCD but github dont accept hex file directly |
I got a P8b MOY-TON5, but I' m hesitant to change the bootloader. |
So is tge current situation that P8b needs a different compiler flag? We should add a new board type and update the install docs if so? |
From the thread it looks more like we could set the option and both P8a and P8b would work. Currently wasp-os is looking for a wider pool of contributors/maintainers so the current status of the issue is "pull requests welcome" (whether that is documentation changes or code changes). To be honest code review is a little haphazard at the moment too. Volunteers are also welcome there! |
Well, I'll have a P8 (b, seems to have a magnetic charger) as soon as EBay deliver me one so will be able to confirm the build flag change, and also if master flashes OK or not (sounds like doesn't at the moment). |
My P8b is here. Using DaFlasher and the files above, it seems stuck on a screen with a black pine cone and blue Bluetooth icon. Uploading micropython.zip , the last thing it says is please wait, this might take up to five minutes. Progress bar at the top of DaFlasher does not move as when uploading other files. |
The watch intermittently restarts and DaFlasher says "Starting flashing..." etc again |
The ota-dfu tool from the v4.0.1 release zip, using the .zip from above, does
|
Using the v4.0.1 binary release, all is fine.
But this just returns me to the pine cone bootloader :( |
But I then tried the micropython.zip from above with dfu.py again, and it's given the progress bar (!) I think this "str" message is just something that happens and the trick is to try again. Dunno what's up with DaFlasher tho. Watch has now booted OK, but the display is mirrored/inverted ( #343 ) and i can't build wasp-os ( #437 ) - @Elenedeath don't suppose you could apply that one line patch and recompile ? |
Yes, depending on the device sometimes you have to retry many times |
Worth me putting a PR into the docs to say that ? |
Yes please! This is not the first time people ask about this |
Add note per wasp-os#222 signed-off-by: tom+spam@falkensweb.com
I managed to track down from where the error 'Exception at line 163: a bytes-like object is required, not 'str'' is coming from. It's from the file
The test fails because '[ ]' is of type 'str' and string is of type bytes. You have to use I don't know why the reported line number is off though. Also, remeber to change the |
I think I made more progress:
then add This way you see in real time wha's happening and you can see that:
The notification handle is actually sent just before the code starts to wait for it. |
Finally fixed it: My solution was to forcibly add a logfile to the pexpect.spawn. This way if the notification waiter timed out : just check backwards in the log if the notification was received. Here's the relevant function from
The spawn lines (there are two of them):
And the logger at the top:
|
Is there somewhere I could make a PR? Anyway I think this can be closed. |
This project accepts PR
--
†øღ
Sent from a super computer that fits in my pocket and is connected to the sum total of all human knowledge
…On 16 September 2023 14:16:36 BST, thiswillbeyourgithub ***@***.***> wrote:
Is there somewhere I could make a PR? Anyway I think this can be closed.
--
Reply to this email directly or view it on GitHub:
#222 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
Oh I just noticed that the ota-dfu dir is a fork from @daniel-thompson so I'll make a PR this week |
Nice fix! PR should go to https://github.com/wasp-os/ota-dfu-python . |
I made the PR. I have not really tested it because I'm not familiar with exactly how it's loaded by the wasp-os code so be warned. |
Here's the link to the repo with the working code for those coming from google. Clone it and use as normal https://github.com/thiswillbeyourgithub/ota-dfu-python/tree/bugfixes Fantastic work @thiswillbeyourgithub |
I already sent a daflasher.zip that was from either the release 0.4.1 or master, I cannot remember which. I have the P8b device mentioned here. How do I send a new bootloader-daflasher.zip? Do I have to? When I try, I get invalid state. I am trying to send the micropython from this issue now which is transferring, will know shortly if this is enough. |
Success! Well, almost. Just flashing the micropython from here was enough. But! The screen is backwards! How do I flip it around? Looks like the fix is here #343 (comment) |
Hi,
I followed the documentation and flashed my P8b (MOY-TON5). After flashing
micropython.py
, instead of being greeted with the wasp-os watchface, I am stuck in the bootloader (Start with bluetooth icon). After I press the button, I see the following pattern:So far, I have tried the following:
boot.py
from the manifestreload.zip
All of the above did not change the aforementioned pattern. Any ideas?
The text was updated successfully, but these errors were encountered: