Skip to content

Can't execute files from FS using pyexec_file #4550

@orpheeantoniadis

Description

@orpheeantoniadis

Hello,

I am currently porting micropython for a project using an LPC1759. I want to have a FAT file system and execute files from the C code and not from the micropython REPL.

I tried to use the function pyexec_file but it didn't work and I cannot find any documentation about how to use it. I understand that I must implement mp_import_stat and mp_lexer_new_from_file but I don't know what pyexec_file is expecting those functions to do.

I use oofatfs lib for the FAT implementation and everything is working well. I can initialize the FS in the flash of my microcontroller and create some files. I can see the files when I mount the flash as a USB mass storage device. I can also execute the content of the file when I import it directly in the REPL using a serial interface so it is not a problem with the python code. By the way, the code is really simple, it just turns on some leds.

If someone could help me it would be great, I am looking for a solution for 2 days now and nothing is working.

Regards,

Orphee Antoniadis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions