Error in booting from hybrid filesystem (FAT,Littlefs2)

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
kalbani
Posts: 3
Joined: Tue Jun 01, 2021 5:28 am

Error in booting from hybrid filesystem (FAT,Littlefs2)

Post by kalbani » Tue Jun 01, 2021 5:56 am

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? :)

smurf
Posts: 7
Joined: Wed Feb 27, 2019 11:25 am

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

Post by smurf » 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.

kalbani
Posts: 3
Joined: Tue Jun 01, 2021 5:28 am

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

Post by kalbani » Sun Jun 06, 2021 5:50 am

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. :)

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

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

Post by Roberthh » Sun Jun 06, 2021 7:43 am

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.

kalbani
Posts: 3
Joined: Tue Jun 01, 2021 5:28 am

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

Post by kalbani » Sun Jun 13, 2021 7:22 am

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?

Post Reply