Thanks to visit codestin.com
Credit goes to github.com

Skip to content

esp32/modules/inisetup.py: Allows to format the partition as FAT. #11864

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

Merged
merged 1 commit into from
Jun 25, 2023
Merged

esp32/modules/inisetup.py: Allows to format the partition as FAT. #11864

merged 1 commit into from
Jun 25, 2023

Conversation

Wind-stormger
Copy link
Contributor

@Wind-stormger Wind-stormger commented Jun 25, 2023

To fix this #11528 (comment) .

Now the compiled micropython.uf2 can be directly used in UF2 bootloader.

@Wind-stormger Wind-stormger changed the title esp32/modules:Allows to format the partition as fat when it is fat. esp32/modules/inisetup.py: Allows to format the partition as FAT. Jun 25, 2023
check_bootsec()
print("Performing initial setup")
os.VfsLfs2.mkfs(bdev)
vfs = os.VfsLfs2(bdev)
if Partition.info(bdev)[4] == "vfs":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to do just bdev.info()[4].

if Partition.info(bdev)[4] == "vfs":
os.VfsLfs2.mkfs(bdev)
vfs = os.VfsLfs2(bdev)
elif Partition.info(bdev)[4] == "ffat":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bdev.info()[4]

@@ -35,10 +35,16 @@ def fs_corrupted():


def setup():
from esp32 import Partition
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import won't be needed with the changes below.

@dpgeorge dpgeorge merged commit 23fe170 into micropython:master Jun 25, 2023
@dpgeorge
Copy link
Member

Thanks for the fix! Now merged.

@HonestQiao
Copy link

To fix this #11528 (comment) .

Now the compiled micropython.uf2 can be directly used in UF2 bootloader.

Test passed on esp32-s3-box-lite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants