Feather M4 read only
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- askker
- Posts: 12
- Joined: Fri Sep 03, 2021 3:57 am
Feather M4 read only
I saved the code.py while it was running and suddenly the Feather M4 enters this read-only mode that I can not delete anything. Also I can not view the content of code.py or remove it. How should I reset the drive and revert it to writable mode?
- jerryn
- Posts: 1890
- Joined: Sat Sep 14, 2013 9:05 am
Re: Feather M4 read only
You can recreate the file system as described in this guide https://learn.adafruit.com/welcome-to-c ... 2978456-23
Warning, It will erase everything on the board.
Warning, It will erase everything on the board.
- mikeysklar
- Posts: 14194
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Feather M4 read only
@askker what OS are you on and what editor are you using?
While this was not necessary implemented there is a summary of concerns about when to be read-only vs read-write that might help understand the logical goals.
https://github.com/adafruit/circuitpython/issues/1528
While this was not necessary implemented there is a summary of concerns about when to be read-only vs read-write that might help understand the logical goals.
https://github.com/adafruit/circuitpython/issues/1528
So, if you are off USB you'd be able to read and write the filesystem without any CircuitPython specific code.
If you are off USB and then plug it in:
If you have a file open for writing, then the filesystem will be read-only to the host.
If your code isn't running or all open files are read-only then the host will be able to write and CircuitPython won't.
If you are on USB and iterating on code that writes to the filesystem:
When your code isn't running the computer will be able to mount writable.
When the drive is mounted and you save it will trigger a reload. If your code tries to open a file for write it will fail as it does now and it will likely stop running (unless you catch the exception).
When your code isn't running and the computer ejects the drive it will reload your code with the ability for CircuitPython to write to the file system. The host will not see the drive until the user code stops. At that point the drive will mount on the computer as writable again.
- askker
- Posts: 12
- Joined: Fri Sep 03, 2021 3:57 am
Re: Feather M4 read only
I was on the usb and not running any code that would write to the filesystem. I used vscode on ubuntu to update the code.py and suddenly all files becomes read-only and would not even show me the content of the code.py (still shows content of other files though). Am I right to assume that there is some kind of bug on the board that corrupted the code file?mikeysklar wrote:@askker what OS are you on and what editor are you using?
While this was not necessary implemented there is a summary of concerns about when to be read-only vs read-write that might help understand the logical goals.
https://github.com/adafruit/circuitpython/issues/1528
So, if you are off USB you'd be able to read and write the filesystem without any CircuitPython specific code.
If you are off USB and then plug it in:
If you have a file open for writing, then the filesystem will be read-only to the host.
If your code isn't running or all open files are read-only then the host will be able to write and CircuitPython won't.
If you are on USB and iterating on code that writes to the filesystem:
When your code isn't running the computer will be able to mount writable.
When the drive is mounted and you save it will trigger a reload. If your code tries to open a file for write it will fail as it does now and it will likely stop running (unless you catch the exception).
When your code isn't running and the computer ejects the drive it will reload your code with the ability for CircuitPython to write to the file system. The host will not see the drive until the user code stops. At that point the drive will mount on the computer as writable again.
- mikeysklar
- Posts: 14194
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Feather M4 read only
I do recall we were suggesting a bootloader update on the M4 Express boards (not limited to Feather) due to filesystem corruption.
Have you updated your bootloader?
https://circuitpython.org/board/feather_m4_express/
Have you updated your bootloader?
https://circuitpython.org/board/feather_m4_express/
- askker
- Posts: 12
- Joined: Fri Sep 03, 2021 3:57 am
Re: Feather M4 read only
Yes, it was running the latest bootloader and circuitpython (6.3). I formatted the disk per instruction above and it has been working okay since then.mikeysklar wrote:I do recall we were suggesting a bootloader update on the M4 Express boards (not limited to Feather) due to filesystem corruption.
Have you updated your bootloader?
https://circuitpython.org/board/feather_m4_express/
- mikeysklar
- Posts: 14194
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Feather M4 read only
@askker,
Please report back here on this thread if you see corruption again.
CP7-rc1 is worth the upgrade and would be more relevant for troubleshooting any filesystem issues you see.
Please report back here on this thread if you see corruption again.
CP7-rc1 is worth the upgrade and would be more relevant for troubleshooting any filesystem issues you see.
- askker
- Posts: 12
- Joined: Fri Sep 03, 2021 3:57 am
Re: Feather M4 read only
Thank you! Will give it a trymikeysklar wrote:@askker,
Please report back here on this thread if you see corruption again.
CP7-rc1 is worth the upgrade and would be more relevant for troubleshooting any filesystem issues you see.
Please be positive and constructive with your questions and comments.