Page 1 of 1

Error in booting from hybrid filesystem (FAT,Littlefs2)

Posted: Tue Jun 01, 2021 5:56 am
by kalbani
I have been working with micropython for awhile. my project now is to run the main without user can see the source code when mounting the pyb over USB. so I decide to use littlefs2 using this code:

Code: Select all

import os, pyb
os.umount('/flash')
p1 = pyb.Flash(start=0, len=32*1024)
p2 = pyb.Flash(start=32*1024)
os.VfsFat.mkfs(p1)
os.VfsLfs2.mkfs(p2)
os.mount(p1, '/flash')
os.mount(p2, '/data')
os.chdir('/flash')
and I mount the VfsLfs:
[/code]
import os, pyb
p2 = pyb.Flash(start=32*1024)
os.mount(p2, '/data')
[/code]
then I transfer to the partition of littlefs the main.py and boot.py files. But did't boot from it!:(

Im using pyb v1.1 with firmware MicroPython v1.14.

Is there any error in my steps or my understanding of littlefs was wrong?
any help? :)

Re: Error in booting from hybrid filesystem (FAT,Littlefs2)

Posted: Wed Jun 02, 2021 1:42 pm
by smurf
Why should micropython boot from the littlefs volume? It looks at the partition, sees that it's FAT, mounts that and is happy.

Re: Error in booting from hybrid filesystem (FAT,Littlefs2)

Posted: Sun Jun 06, 2021 5:50 am
by kalbani
smurf wrote:
Wed Jun 02, 2021 1:42 pm
Why should micropython boot from the littlefs volume? It looks at the partition, sees that it's FAT, mounts that and is happy.
I dont want the end user to see or copy my code in the pyb , thats why I need to boot from the littlefs volume. :)

Re: Error in booting from hybrid filesystem (FAT,Littlefs2)

Posted: Sun Jun 06, 2021 7:43 am
by Roberthh
The end user can always get access to you r files, if it is on a valid partition. Not to mention flash dumps. using frozen bytecode is a little bit more effective as protection means.

Re: Error in booting from hybrid filesystem (FAT,Littlefs2)

Posted: Sun Jun 13, 2021 7:22 am
by kalbani
thanks for you replay Roberthh :D , I understand your idea. but is there a way to boot and run the main from littlefs in hybrid filesystem?