2.7. Play Python on Raspberry Pi Pico in MDK
It is well known that MicroPython supports the Raspberry Pi Pico, and we see there some room to improve, not only about the memory footprint, but also about the way to bind your own c modules. It’s not rare to see people in the community complain about the complexity and debugging experience.
The resources and price of the Raspberry Pi Pico are really good, it is fun to play with, not to mention there is a big community behind it. One question for most of the MCU developer is that can we use MDK to develop Raspberry Pi Pico and play with PikaPython? Why not? Thanks to a open-source project called Pico_Template, dream becomes reality. Please note that Pico_Template allows you to compile the latest pico-sdk using the Arm Compiler 6, debug without an extra pico and retarget printf to MDK without using any Serial2USB adapter.
For details, see:
As we mentioned before, binding C modules in MicroPython is very complicated and difficult to debug. Is there a more convenient way to do it for python running on MCUs?
YES! Our answer to this question is PikaPython. PikaPython is a completely rewritten ultra-lightweight python vitual machine, with zero dependency on toolchain, simple configuration, ultra-low memory footprint (i.e. you can use it with less than 4KB of SRAM). Using framework based C module development tools, your API calling written in Python can be automatically connect to the your C modules. Cannot be more simple or convenient, isn’t it? No need to manually handle any global tables, macro functions, module registration, etc.
PikaPython provides MDK projects, hence you can debug C modules with python scripts.
In addition to pico, the portability of pikascript allows you to use it on a wide variety of platforms. For example: stm32g0, stm32f1, ch32, apm32, cm32, as well as Pingtou’s w801, Boliu’s bl-706…
The very popular ESP32C3, Godson architecture.
In fact, PikaPython is deeply integrated with rt-thread, it supports rt-thread full series of BSP via software packages.
Let’s see how to play PikaPython on Raspberry Pi pico using MDK:
If you can see the following information (or similar) on the Debug(printf) View, congrats!
For getting technical support, please raise issues on github. Thank you.