modelScript

File system and script: boot.py of the flash, then the script fs_script.py instead of main.py

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

Verification scenario 27 (see requirements.md, decision "Système de fichiers"): same circuit and same flash image as Examples.FileSystem.Boot, but scriptPath is set. The microcontroller then runs boot.py from the flash, then the script fs_script.py instead of main.py — like Thonny running the open script on an already booted board.

The script checks that boot.py did create /data and that main.py did not run (/data empty), writes then reads back /data/notes.txt, and lights led1 (GP1) if everything is as expected.

Components

TypeNameDefaultDescription
MCUmcuboot.py of the flash image, then the script fs_script.py instead of main.py; copy created in the simulation folder (fsWorkspace = "." by default), opened in Explorer at the end of the simulation
Modelica.Electrical.Analog.Basic.Groundground
Modelica.Electrical.Analog.Sources.RampVoltagerampvoltage measured by the ADC (GP0): ramp from 0 to 3.3 V in 1 s
Modelica.Electrical.Analog.Basic.Resistorr1limits the current of led1 (GP1)
MicroPythonMCU.Peripherals.LEDled1GP1: self-check passed