2.3. Start with RT-Thread package
PikaPython has been added to the RT-Thread package. Under the programming language category, you can quickly use PikaPython by directly adding packages.
The PikaPython package supports full RT-Thread BSP. If you encounter compatibility problems during use, you can file an issue at github or Forum to ask questions.
Import the pikascript package
Add RT_WEAK before rt_vsnprintf in rt-thread/src/kservice.c (only for rt_thread version 4.1.0 and below)
Delete the static (only for rt_thread version 4.1.0 and below) of finsh_getchar in rt-thread/components/finsh/shell.c
2.3.2. start pikascript
Option 1: Start with msh (default mode)
Use the pikaRTThread module in packages/pikascript-latest/requestment.txt (included by default).
The latest default requestment.txt can be viewed here.
Type “pika” in msh to start PikaPython in a thread.
The initial startup will execute the /pikascript-latest/main.py initialization script. After execution, enter pika interactive running mode, Enter “exit()” to return to msh, enter “pika” again to enter pikascript, and enter directly into interactive mode.
Option 2: Automatically start at boot
Enter the package detailed configuration
Check Enable auto-running PikaPython
3 After setting, it will automatically start PikaPython, run the main.py script, and then go back to msh
Enter pika in msh to run interactively.
Option 3: Manual start
If you need custom start, you can use the following methods to start manually.
Import header file:
PikaObj * pikaMain = pikaScriptInit();
Refer to the Support Interactive Run section of the documentation.
Serial download Python script
Refer to the Support Serial Port Download Python part of the document.
126.96.36.199. Using the PikaPython module and package manager
Modify pikascript-latest/requestment.txt, then right-click the project, Sconscripts Update, you can install the module/modify the module version, and precompile.
For more usage, please refer to the package manager, module usage, module development part of the documentation.