Run the script from the flash using file system? #11845
Replies: 1 comment 3 replies
-
I am planning to do the same thing on the You should be able to write a MicroPython filesystem driver that delegates to your If you don’t insist on using SPIFFS, you could also write a block device driver for your flash and use the built-in LittleFS or FAT drivers on it. I’m not sure if there is any way around copying the mpy file to RAM however, if your flash is not memory-mapped. If you’re not doing it explicitly, it probably just happens internally. |
Beta Was this translation helpful? Give feedback.
-
Hi all, I'm working on a project where I've taken the minimal port and updated the HAL layer concerning the processor (XMOS XCORE) I'm working on. The processor interfaced with an external SPI flash which we are using for a storage system. All the FileSystem APIs, like Fopen, Fread, and Fwrite, are available. Right now, I'm reading the script from the storage system, copying it into an array and then passing it to the Python executor to execute it. This process consumes an extra large buffer, which is highly unsuitable as we shall be reaching close to the maximum capacity.
Hence, I like to know, instead of reading the script from the file system manually, if there is already a developed API available. And I can link it to the filesystem APIs.
Current code overview:
I have disabled the compiler (MICROPY_ENABLE_COMPILER). And I'm running a ".mpy" file.
Calling the filesystem APIs to read the script from storage.
Beta Was this translation helpful? Give feedback.
All reactions