Python’s role in developing real-time embedded systems

Lanruizhi 1

  • A programming language
  • python
  • object-oriented
  • Object-oriented programming
  • test
  • The data analysis
  • The script
  • Regression testing
  • programming
  • Automated testing
  • Data is stored

Abstract: Python has become a popular programming language in the past few years. Named after the famous Monty Python comedy group, the language is object-oriented and interpreted (not compiled). This property has led to the adoption of Python on platforms such as Linux and Windows, and on single-board computers such as Raspberry Pi.

Over the past few years, Python has become a popular programming language. Named after the famous Monty Python comedy group, the language is object-oriented and interpreted (not compiled). This property has led to the adoption of Python on platforms such as Linux and Windows, and on single-board computers such as Raspberry Pi. With this widespread and growing adoption, one might wonder if Python has a place in real-time embedded systems. Here are five roles that developers might find Python to play in real-time embedded systems.Copy the code

Equipment control and debugging

During embedded software development, developers often find themselves analyzing bus traffic, such as USB, SPI, or I2C. Sometimes the analysis is only used for debugging purposes, but sometimes it is necessary to actually control the bus analyzer and send messages to the embedded system. Many bus parsers and communication tools have user-friendly interfaces that can be used to control tools. They also typically provide a way to develop scripts that can be used to control tools. Python is a scripting language that generally supports (and sometimes only supports) interface and control with tools.Copy the code

Automated testing

The ability to control tools that can send and receive messages from embedded systems through Python opens up the possibility of creating automated tests using Python, including regression tests. Python scripts can be developed to set the embedded system to different states, set up configurations, and test for any possible interference and interaction with the outside world. One advantage of using Python for automated testing is that you can develop regression tests that continuously test and run the system. Any code changes that lead to errors or nonconformance will be found immediately.Copy the code

The data analysis

A simple search of Python libraries on the Web shows that there are many free and powerful libraries available for developing Python applications. Python can be used to receive critical embedded system data, which can then be stored in a database or locally for analysis. Developers can then use Python to develop real-time visualizations that display key parameters, or store and save these parameters for later analysis. The advantage of using Python for data analysis is that the groundwork is already done; The function is simple.Copy the code

Real-time software

Python itself turned out to be so powerful and easy to use that Python could even make its way into real-time embedded systems as a programming language. Yes, the embedded software itself is written in Python rather than C/C ++. The most widely used version of Python for Real-time is the MicroPython port, designed to run on microcontrollers such as the ARM Cortex-M3/4. MicroPython is not alone. Companies such as Synapse and OpenMV use Micro Python or their own Python ports in embedded systems. Readers interested in learning more about MicroPython may be interested in continuing education courses at DesignNews, a sister publication of EDN. There are also overview articles to be found elsewhere in the EDN.Copy the code

Learn object-oriented programming

Python is a free programming language available on multiple platforms that students and non-programming types can easily learn how to program. Unlike C, the language is modern and can be structured as a free-form script type or as a complex object-oriented architecture. Python also proved to be very versatile. In some cases, electrical engineers with no programming experience can use Python to write useful test scripts or perform board inspections with minimal time commitment.Copy the code

Python does not have a steep learning curve, and developers familiar with it find it an easy language to switch from. The language itself is flexible and can be adapted to work in a microcontroller-based environment.

For details, please click

To:

Related articles

The net friend comment on