3.4. Serial port download Python script run file

    obj_run supports running Python scripts in the form of strings, so no matter how you store them, just pass the string of the Python script to obj_run at the end. So the possible storage methods are: flash direct storage, file system, external storage and so on.

    PikaScript supports running Python script source code and parsed Pika bytecode.

    Storing the Python source code is very simple, just write the Python script string received by the serial port into Flash completely. Instead of using the pikaScriptInit() function at startup, manually create the pikaMain root object, and then use obj_run(pikaMain, code) to run the script, where code represents the stored python source code.

    For specific code examples, please refer to:

    (to be improved) For specific code examples, please refer to:

    1. bsp/stm32g030c8/Booter/main.c

    2. bsp/stm32g030c8/Booter/pika_config.c

    [Note: requires kernel version .

    The file API needs to be interfaced to the following file systems by overriding the WEAK function.

    Use to run a single Python file (no other files can be imported).

    Function prototype.

    Use to run Python files and their files. A new folder needs to be created in the same level path as the running Python file to hold the intermediate files.