Micropython File Access on Spike Prime #1792
Redstonetill
started this conversation in
General
Replies: 1 comment
-
Technically, it isn't saving "files". Basically, there is a region of RAM that gets saved to flash memory at power off and restored at power on. Most of the relevant code is at https://github.com/pybricks/pybricks-micropython/blob/master/lib/pbio/sys/storage.c Pybricks currently only uses <1MB of the 32MB external flash for this so that we don't mess up the file system from the official LEGO firmware. So there isn't much free space to work with (that's why |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just thought about a possibility to access a single file (I know that the Spike Prime (the hub I am using for pybricks) doesnt support a filesystem). So my generell idea was that the firmware already has a way to read and write code to the drive in the hub (I couldn't figure out what type of storage the hub is using, just 1MB flash and another 32MB of something unkown) since it can save code even if the hub is power off (I am aware of the 512byte storage already supported by the pybricks firmware but since it isnt that much space another would be great). So if the firmware is already able to read and store files, I dont think, that it should be to hard to write a function in the firmware to read parts of a file previously hard coded into the firmware.
I would love to hear the take of someone other on this and if possible some information where the read and write code is being stored in the firmware since I would love to try it out :)
Beta Was this translation helpful? Give feedback.
All reactions