-
Notifications
You must be signed in to change notification settings - Fork 1.3k
PYPORTAL: wiped itself (several times) #1577
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
Comments
working on reconstructing the lost code as an example |
it's done it two more times. |
ah, i just tried it with 4.0.0-beta.2-36-g66b0c67f5-dirty on 2019-02-12 and it happened again hrmmmm (i saved an old compile) |
|
No, that's not it. |
Since you have a JLink, it'd be awesome if you could have a debug build running through the JLink as you work with it. Set a breakpoint on |
I'll be free at 3 to do so until 4. I do not know what a debug build is nor am I super experienced with a Jlink. Is there a guide you know of ? |
This is the one I used; I hear the author went on to do great things |
|
try these two firmwares, I find the one without init does not have the problem |
TG, when commenting on issues - please add more information so we know what you're doing and what the firmware you are posting does: what 'init code'? how did you verify 'it does not have the problem' during test? we cannot debug, read, or analyze uf2 files :) more detail, information, and code is better, while keeping the information relevant and on topic will help us help you! |
I duplicated the pyportal board profile and changed the board.c to match the board.c from metro m4, thus board.DISPLAY is a Nonetype in code, and I have not been having the file/folder (and occasional) corruption problem while saving or reloading in addition to far fewer safe mode alerts. The board i am running it on is in spi mode, if relevant. ladyada, thank you for the feedback you have been giving I have been finding it very useful and I hope I can someday use it in a job. :-) |
ok thanks - next up, when you get safemode alerts what are they saying? do you have a screenshot? they have the reason for safemode |
to get the pyportal to output this error I just saved the same main.py over and over, using the program in between saves, until it went to safe mode (took three tries). I was using the most recent master (see below for the build number).
|
after i power cycled the drive was wiped again |
@tannewt I think one thing to check here is if a displayio-related object (or maybe a filesystem-related object) should be part of the root pointers lists, but is not. I had a crashing (not a filesystem issue) due to forgetting this for an internal BLE linked list. @TG-Techie What editor and what operating system are you using? (MacOS for the latter, right?) |
I don't know whether it's related or not, but I built the latest version from the repository, and tried adafruit_ble with the echo example. Version: |
@dhalbert. Yes, I'm a Unix/Macos person through and through. I'm using mu 1.0.2. |
There seems to be something wrong with the filesystem drivers, after reformatting the virtual drive, and reflashing, I got all sorts of weird errors, like: main.py output: But when I open the file init.py in an editor, everything looks OK. |
@uhheber what do you mean by main.py output? Via repl? Is init seperate from main ? |
*** This code works: ledg = digitalio.DigitalInOut(board.LED2_G) uart = UARTServer() while True:
######################################## *** This code produces an error: ledg = digitalio.DigitalInOut(board.LED2_G) uart = UARTServer() while True:
############################################## The error is: This is reversible! The error is independent from the used editor (Mu, gedit, Notepad++) and the OS (Windows 10, Linux Mint 19.1). |
@uhrheber Could you say exactly which commit you built, or which UF2 you used? The commit listed in the startup prompt is apparently not accurate. |
I just tried the error prodcing code both manually as test.py and as main,py -- it does produce an error as main.py but it runs normally as test.py
test.py
|
ha! but it runs normally if named code.py ??
|
my tests were on a pca10059 dongle with a build from the current master as of a few hours ago as you can see in the output. Looks like the same commit referenced with the error report above. |
Hrmmm I find mine crashes and wipes regardless of file content. |
@dhalbert Git log says:
commit 3e877e0
commit 0261c57 Is that what you wanted to know? Bootloader is: |
Now I reloaded it as main.py and it works fine ... It may be very important to make sure the File sytem has been updated before resetting - on linux I do "sync" after any write to the board. I had some odd behaviors with trying to load another file and execute it from the REPL -- it resulted in the same "NameError: name= junk " error as above until I reloaded after that even the previous;y failing main.py started working. So it may all be related to not having the FS stable when resetting |
@jerryneedell I don't think that this is the root cause. I had the code that produces the error in main.py, and it was synced, because I could read it with another editor. I then ejected the stick (in Linux), unplugged and replugged it. After that, the file system was wiped clean. Is there something I can check? |
I don't use special mount options, I just disabled the write cache. I said nothing about resetting the board. When I don't use external libraries, I can do with the board what I want, nothing breaks the drive, not even unplugging it while it runs. |
PCA10056 works without a problem, even when I unplug it while it's running, there's no drive corruption. |
@uhrheber Which board(s) are you these problems on? |
Our comments crossed. Thanks! |
Only pca10059 so far, I have some nRF52840 based modules from Fanstel here, but didn't test them so far. They don't have external memory, so they should behave exactly as the pca10059. |
are we proceeding under the assumption that the two problems are linked ? |
But why is TG-Techie having these problems with the PyPortal? It HAS external flash. |
There may be several problems here. @uhrheber’s issue definitely seems related to internal flash. Yours seems to be related to displayio, which they’re not using. |
I think i is worth pointing out I do have displayio compiled into the firmware, I only call release_displays, but it has no pre-initialised display. also that my hardware config does not match the software when init_display is enabled |
i have also noticed my tricorder, basically a stock m4, does not have the file loss issue. |
BTW, the problem with ble.uart still exists also on the pca10056. When I send more than a few characters at once, the program crashes:
|
@uhrheber should that go in a separate issue? |
Definitely. It's a different problem. |
I wonder if this is happening on the hallowing? |
TG - what if you have the backlight very dim, but using the displayio interface - please try that! |
Ladyada, I'm glad to try, and not entirely sure what you want me to try. I use it in spi and even when in repl and not main I don't see anything on the screen, just white. |
to see the the backlight current is causing a brownout while writing to the FAT, its worth a try. you would have displayio active, but just not use high current ALL ON backlight |
OK, guys, the problem seems to be gone after I erased the memory of the pca10059 completely, flashed the newest version of the UF2 bootloader (pca10059_bootloader-0.2.8_s140_6.1.1.hex), and then copied the freshly compiled CircuitPython UF2 file over. Now I feel dumb for not trying this sooner. |
@uhrheber No problem - it can take several tries to divide and conquer an issue. If you are still seeing BLE problems, please open a new issue. |
Unfortunately, I spoke too soon. This made me thinking, that it might be related to the filling level of the disk. It seems, that the flash driver has a problem with concurrent access. I then reflashed all boards, and added a boot.py, that disables autoreloading, then added the libraries and the code. But: When I copy more files to the drive, so that it is nearly full, the program crashes again, and after unplugging, the drive is wiped clean. @TG-Techie Could you please try to add a boot.py to your board?
|
I just repeated the write/read test with F3 on a Pyboard v1.1 (MicroPython v1.9.4), and again on a pca10059 (CircuitPython 4.0.0-beta.2-116-gaf863a378). Would be interesting to see whether this also happens on other ports. Unfortunately, compiling Circuitpython for STM32 fails, and I don't have any SAMD boards. |
CircuitPython is only supported on |
the no auto reload seems to have fixed the file corruption. however, the pyp still freezes while saving occasionally. |
up just hard crashed! |
@dhalbert the wiping problem wasn't. I just tried beta5 on my pyp and it crashed and reappeared as NO NAME.
I updated the firmware and then connected to the repl, using mu, and ctrl-c ed then ctrl-d ed. |
@TG-Techie is it reproducible? If you can do it again, what was the main.py you were running? Thanks. |
i was running code that worked perfectly before but after updating to the most recent master it started hard crashing and then wiped itself
The text was updated successfully, but these errors were encountered: