The Blinky example is a simple demonstration of Python VIO module interaction with the application running on AVH model. Application VIO (LEDs, buttons) is therefore handled with Python script. Status of LEDs is printed to the terminal like LED: 00000000, where each digit represents one LED (e.g. LED: 00000001 means LED0 ON). The same applies to buttons, which will be presented as BTN: 00000000 in the terminal.
Numeric keys from 0 to 7 on PC keyboard are mapped to vioButton0 through vioButton7 respectively and can be used to interact with the application.
Note: Terminal printing LED status must have focus for key input to be registered.
- In the beginning
vioLED0blinks in 1 s interval. After 15 s the Python script will automatically pressvioButton0. - Blinking rate of
vioLED0changes andvioLED1also starts blinking. Event onvioLED1triggers an automatic event onvioButton0which is delayed by 5 s. - After 5s
vioLED1stops blinking and blinking rate ofvioLED0has returned to 1 s interval. - After 25 s have passed, the Model will be automatically stopped by the Python script.
- CMSIS-Toolbox 1.5.0 or later
- Arm Compiler 6.18 or later
Install Python getch package with:
pip3 install py-getch
- Use the
csolutioncommand to create.cprjproject files.csolution convert -s Blinky.csolution.yml - Use the
cbuildcommand to create executable files.cbuild Blinky.Debug+AVH.cprj cbuild Blinky.Release+AVH.cprj
Execute the following steps:
- run the VHT model from the command line by executing:
VHT_MPS3_Corstone_SSE-300 -f ./fvp_config.txt -V ./Python out/Blinky/AVH/Debug/Blinky.axf - Press key
0on PC keyboard to change LED blinking rate.