1.2. Demo show
I want to expand a C module of my own, but I have to learn to use some completely unintelligible macro functions, and I have to register them manually, and I have to write makeFile, and I can’t debug C after compilation.
I am poor, can not afford to buy STM32F4, want to buy a STM32F103C8T6 micropython development board, Taobao a search, seems not.
Now the C8T6 is also expensive, I still want to use F0, use G0, with domestic chips, can it work?
It seems that it is not very easy to port micropython to G0.
So? Is there another way to play?
In other words, I want to develop with Keil, debug with Keil, and I want to use the cheapest microcontroller, and it’s very easy to develop C modules.
How about trying PikaScript?
What is PikaScript?
PikaScript provides extremely easy to deploy and extend Python scripting support for resource-constrained mcu. It doesn’t require an OS, it runs bare metal, and it doesn’t require a filesystem.
PikaScript supports bare-metal operation, at least for mcu with RAM ≥ 4kB and FLASH ≥ 32kB, the recommended configuration is RAM ≥ 10kB and FLASH ≥ 64kB, such as stm32f103c8t6 and stm32g070RBT6, which have no pressure at all and even meet the recommended configuration.
These are all demos of STM32G070RBT6.
Look at the script, it’s all Python3 standard syntax.
The light is flashing.
1.2.2. Demo 02 Serial port test
Open a serial port and try to read two characters
very smooth
1.2.3. Demo 03 Try reading an ADC
Again a few lines of script fixes it.
This is the output result.
Also running Python, we can briefly compare the common chip STM32F405RG for micropython and the chip STM32G070CB for PikaScript.
1.2.4. RAM resource comparison
1.2.6. Reference price comparison (take the price of 10 pieces of Lichuang Mall on September 11, 2021 as a reference)
image
1.2.7. How about the expansion ability?
In addition to device drivers, developing custom python script bindings for mcu is very easy with the pikascript development framework. The following two demos are custom C module extensions that develop some python script interfaces based on the ARM-2D image driver library.
1.2.8. A few small squares~
1.2.10. So, is PikaScript open source?
Of course, this is the github home page of PikaScript: https://github.com/pikasTech/pikascript
1.2.11. Is it difficult to develop?
PikaScript has prepared rich demos and development guides from shallow to deep for developers, and the guides will continue to be improved and maintained.
1.2.12. Can it be commercialized?
Of course! PikaScript uses the MIT protocol and allows modifications and commercialization, but be careful to keep the original author’s byline.