The idea for this posting started when I read New approaches to dominate in embedded development article. Then I found some ther related articles and here is the result: long article.
Embedded devices, or embedded systems, are specialized computer systems that constitute components of larger electromechanical systems with which they interface. The advent of low-cost wireless connectivity is altering many things in embedded development: With a connection to the Internet, an embedded device can gain access to essentially unlimited processing power and memory in cloud service – and at the same time you need to worry about communication issues like breaks connections, latency and security issues.
Those issues are espcecially in the center of the development of popular Internet of Things device and adding connectivity to existing embedded systems. All this means that the whole nature of the embedded development effort is going to change. A new generation of programmers are already making more and more embedded systems. Rather than living and breathing C/C++, the new generation prefers more high-level, abstract languages (like Java, Python, JavaScript etc.). Instead of trying to craft each design to optimize for cost, code size, and performance, the new generation wants to create application code that is separate from an underlying platform that handles all the routine details. Memory is cheap, so code size is only a minor issue in many applications.
Historically, a typical embedded system has been designed as a control-dominated system using only a state-oriented model, such as FSMs. However, the trend in embedded systems design in recent years has been towards highly distributed architectures with support for concurrency, data and control flow, and scalable distributed computations. For example computer networks, modern industrial control systems, electronics in modern car,Internet of Things system fall to this category. This implies that a different approach is necessary.
Companies are also marketing to embedded developers in new ways. Ultra-low cost development boards to woo makers, hobbyists, students, and entrepreneurs on a shoestring budget to a processor architecture for prototyping and experimentation have already become common.If you look under the hood of any connected embedded consumer or mobile device, in addition to the OS you will find a variety of middleware applications. As hardware becomes powerful and cheap enough that the inefficiencies of platform-based products become moot. Leaders with Embedded systems development lifecycle management solutions speak out on new approaches available today in developing advanced products and systems.
Traditional approaches
C/C++
Tradionally embedded developers have been living and breathing C/C++. For a variety of reasons, the vast majority of embedded toolchains are designed to support C as the primary language. If you want to write embedded software for more than just a few hobbyist platforms, your going to need to learn C. Very many embedded systems operating systems, including Linux Kernel, are written using C language. C can be translated very easily and literally to assembly, which allows programmers to do low level things without the restrictions of assembly. When you need to optimize for cost, code size, and performance the typical choice of language is C. Still C is today used for maximum efficiency instead of C++.
C++ is very much alike C, with more features, and lots of good stuff, while not having many drawbacks, except fror it complexity. The had been for years suspicion C++ is somehow unsuitable for use in small embedded systems. At some time many 8- and 16-bit processors were lacking a C++ compiler, that may be a concern, but there are now 32-bit microcontrollers available for under a dollar supported by mature C++ compilers.Today C++ is used a lot more in embedded systems. There are many factors that may contribute to this, including more powerful processors, more challenging applications, and more familiarity with object-oriented languages.
And if you use suitable C++ subset for coding, you can make applications that work even on quite tiny processors, let the Arduino system be an example of that: You’re writing in C/C++, using a library of functions with a fairly consistent API. There is no “Arduino language” and your “.ino” files are three lines away from being standard C++.
Today C++ has not displaced C. Both of the languages are widely used, sometimes even within one system – for example in embedded Linux system that runs C++ application. When you write a C or C++ programs for modern Embedded Linux you typically use GCC compiler toolchain to do compilation and make file to manage compilation process.
Most organization put considerable focus on software quality, but software security is different. When the security is very much talked about topic todays embedded systems, the security of the programs written using C/C++ becomes sometimes a debated subject. Embedded development presents the challenge of coding in a language that’s inherently insecure; and quality assurance does little to ensure security. The truth is that majority of today’s Internet connected systems have their networking fuctionality written using C even of the actual application layer is written using some other methods.
Java
Java is a general-purpose computer programming language that is concurrent, class-based and object-oriented.The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them. Java is intended to let application developers “write once, run anywhere” (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation.Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. Java is one of the most popular programming languages in use, particularly for client-server web applications. In addition to those it is widely used in mobile phones (Java apps in feature phones, ) and some embedded applications. Some common examples include SIM cards, VOIP phones, Blu-ray Disc players, televisions, utility meters, healthcare gateways, industrial controls, and countless other devices.
Some experts point out that Java is still a viable option for IoT programming. Think of the industrial Internet as the merger of embedded software development and the enterprise. In that area, Java has a number of key advantages: first is skills – there are lots of Java developers out there, and that is an important factor when selecting technology. Second is maturity and stability – when you have devices which are going to be remotely managed and provisioned for a decade, Java’s stability and care about backwards compatibility become very important. Third is the scale of the Java ecosystem – thousands of companies already base their business on Java, ranging from Gemalto using JavaCard on their SIM cards to the largest of the enterprise software vendors.
Although in the past some differences existed between embedded Java and traditional PC based Java solutions, the only difference now is that embedded Java code in these embedded systems is mainly contained in constrained memory, such as flash memory. A complete convergence has taken place since 2010, and now Java software components running on large systems can run directly with no recompilation at all on design-to-cost mass-production devices (consumers, industrial, white goods, healthcare, metering, smart markets in general,…) Java for embedded devices (Java Embedded) is generally integrated by the device manufacturers. It is NOT available for download or installation by consumers. Originally Java was tightly controlled by Sun (now Oracle), but in 2007 Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java (bytecode compiler), GNU Classpath (standard libraries), and IcedTea-Web (browser plugin for applets).
My feelings with Java is that if your embedded systems platform supports Java and you know hot to code Java, then it could be a good tool. If your platform does not have ready Java support, adding it could be quite a bit of work.
Increasing trends
Databases
Embedded databases are coming more and more to the embedded devices. If you look under the hood of any connected embedded consumer or mobile device, in addition to the OS you will find a variety of middleware applications. One of the most important and most ubiquitous of these is the embedded database. An embedded database system is a database management system (DBMS) which is tightly integrated with an application software that requires access to stored data, such that the database system is “hidden” from the application’s end-user and requires little or no ongoing maintenance.
There are many possible databases. First choice is what kind of database you need. The main choices are SQL databases and simpler key-storage databases (also called NoSQL).
SQLite is the Database chosen by virtually all mobile operating systems. For example Android and iOS ship with SQLite. It is also built into for example Firefox web browser. It is also often used with PHP. So SQLite is probably a pretty safe bet if you need relational database for an embedded system that needs to support SQL commands and does not need to store huge amounts of data (no need to modify database with millions of lines of data).
If you do not need relational database and you need very high performance, you need probably to look somewhere else.Berkeley DB (BDB) is a software library intended to provide a high-performance embedded database for key/value data. Berkeley DB is written in Cwith API bindings for many languages. BDB stores arbitrary key/data pairs as byte arrays. There also many other key/value database systems.
RTA (Run Time Access) gives easy runtime access to your program’s internal structures, arrays, and linked-lists as tables in a database. When using RTA, your UI programs think they are talking to a PostgreSQL database (PostgreSQL bindings for C and PHP work, as does command line tool psql), but instead of normal database file you are actually accessing internals of your software.
Software quality
Building quality into embedded software doesn’t happen by accident. Quality must be built-in from the beginning. Software startup checklist gives quality a head start article is a checklist for embedded software developers to make sure they kick-off their embedded software implementation phase the right way, with quality in mind
Safety
Traditional methods for achieving safety properties mostly originate from hardware-dominated systems. Nowdays more and more functionality is built using software – including safety critical functions. Software-intensive embedded systems require new approaches for safety. Embedded Software Can Kill But Are We Designing Safely?
IEC, FDA, FAA, NHTSA, SAE, IEEE, MISRA, and other professional agencies and societies work to create safety standards for engineering design. But are we following them? A survey of embedded design practices leads to some disturbing inferences about safety.Barr Group’s recent annual Embedded Systems Safety & Security Survey indicate that we all need to be concerned: Only 67 percent are designing to relevant safety standards, while 22 percent stated that they are not—and 11 percent did not even know if they were designing to a standard or not.
If you were the user of a safety-critical embedded device and learned that the designers had not followed best practices and safety standards in the design of the device, how worried would you be? I know I would be anxious, and quite frankly. This is quite disturbing.
Security
The advent of low-cost wireless connectivity is altering many things in embedded development – it has added to your list of worries need to worry about communication issues like breaks connections, latency and security issues. Understanding security is one thing; applying that understanding in a complete and consistent fashion to meet security goals is quite another. Embedded development presents the challenge of coding in a language that’s inherently insecure; and quality assurance does little to ensure security.
Developing Secure Embedded Software white paper explains why some commonly used approaches to security typically fail:
MISCONCEPTION 1: SECURITY BY OBSCURITY IS A VALID STRATEGY
MISCONCEPTION 2: SECURITY FEATURES EQUAL SECURE SOFTWARE
MISCONCEPTION 3: RELIABILITY AND SAFETY EQUAL SECURITY
MISCONCEPTION 4: DEFENSIVE PROGRAMMING GUARANTEES SECURITY
Some techniques for building security to embedded systems:
Use secure communications protocols and use VPN to secure communications
The use of Public Key Infrastructure (PKI) for boot-time and code authentication
Establishing a “chain of trust”
Process separation to partition critical code and memory spaces
Leveraging safety-certified code
Hardware enforced system partitioning with a trusted execution environment
Plan the system so that it can be easily and safely upgraded when needed
Flood of new languages
Rather than living and breathing C/C++, the new generation prefers more high-level, abstract languages (like Java, Python, JavaScript etc.). So there is a huge push to use interpreted and scripting also in embedded systems. Increased hardware performance on embedded devices combined with embedded Linux has made the use of many scripting languages good tools for implementing different parts of embedded applications (for example web user interface). Nowadays it is common to find embedded hardware devices, based on Raspberry Pi for instance, that are accessible via a network, run Linux and come with Apache and PHP installed on the device. There are also many other relevant languages
One workable solution, especially for embedded Linux systems is that part of the activities organized by totetuettu is a C program instead of scripting languages (Scripting). This enables editing operation simply script files by editing without the need to turn the whole system software again. Scripting languages are also tools that can be implemented, for example, a Web user interface more easily than with C / C ++ language. An empirical study found scripting languages (such as Python) more productive than conventional languages (such as C and Java) for a programming problem involving string manipulation and search in a dictionary.
Scripting languages have been around for a couple of decades Linux and Unix server world standard tools. the proliferation of embedded Linux and resources to merge systems (memory, processor power) growth has made them a very viable tool for many embedded systems – for example, industrial systems, telecommunications equipment, IoT gateway, etc . Some of the command language is suitable for up well even in quite small embedded environments.
I have used with embedded systems successfully mm. Bash, AWK, PHP, Python and Lua scripting languages. It works really well and is really easy to make custom code quickly .It doesn’t require a complicated IDE; all you really need is a terminal – but if you want there are many IDEs that can be used. High-level, dynamically typed languages, such as Python, Ruby and JavaScript. They’re easy—and even fun—to use. They lend themselves to code that easily can be reused and maintained.
There are some thing that needs to be considered when using scripting languages. Sometimes lack of static checking vs a regular compiler can cause problems to be thrown at run-time. But it is better off practicing “strong testing” than relying on strong typing. Other ownsides of these languages is that they tend to execute more slowly than static languages like C/C++, but for very many aplications they are more than adequate. Once you know your way around dynamic languages, as well the frameworks built in them, you get a sense of what runs quickly and what doesn’t.
Bash and other shell scipting
Shell commands are the native language of any Linux system. With the thousands of commands available for the command line user, how can you remember them all? The answer is, you don’t. The real power of the computer is its ability to do the work for you – the power of the shell script is the way to easily to automate things by writing scripts. Shell scripts are collections of Linux command line commands that are stored in a file. The shell can read this file and act on the commands as if they were typed at the keyboard.In addition to that shell also provides a variety of useful programming features that you are familar on other programming langauge (if, for, regex, etc..). Your scripts can be truly powerful. Creating a script extremely straight forward: It can be created by opening a separate editor such or you can do it through a terminal editor such as VI (or preferably some else more user friendly terminal editor). Many things on modern Linux systems rely on using scripts (for example starting and stopping different Linux services at right way).
The most common type of shell script is a bash script. Bash is a commonly used scripting language for shell scripts. In BASH scripts (shell scripts written in BASH) users can use more than just BASH to write the script. There are commands that allow users to embed other scripting languages into a BASH script.
There are also other shells. For example many small embedded systems use BusyBox. BusyBox providesis software that provides several stripped-down Unix tools in a single executable file (more than 300 common command). It runs in a variety of POSIX environments such as Linux, Android and FreeeBSD. BusyBox become the de facto standard core user space toolset for embedded Linux devices and Linux distribution installers.
Shell scripting is a very powerful tool that I used a lot in Linux systems, both embedded systems and servers.
Lua
Lua is a lightweight cross-platform multi-paradigm programming language designed primarily for embedded systems and clients. Lua was originally designed in 1993 as a language for extending software applications to meet the increasing demand for customization at the time. It provided the basic facilities of most procedural programming languages. Lua is intended to be embedded into other applications, and provides a C API for this purpose.
Lua has found many uses in many fields. For example in video game development, Lua is widely used as a scripting language by game programmers. Wireshark network packet analyzer allows protocol dissectors and post-dissector taps to be written in Lua – this is a good way to analyze your custom protocols.
There are also many embedded applications. LuCI, the default web interface for OpenWrt, is written primarily in Lua. NodeMCU is an open source hardware platform, which can run Lua directly on the ESP8266 Wi-Fi SoC. I have tested NodeMcu and found it very nice system.
PHP
PHP is a server-side HTML embedded scripting language. It provides web developers with a full suite of tools for building dynamic websites but can also be used as a general-purpose programming language. Nowadays it is common to find embedded hardware devices, based on Raspberry Pi for instance, that are accessible via a network, run Linux and come with Apache and PHP installed on the device. So on such enviroment is a good idea to take advantage of those built-in features for the applications they are good – for building web user interface. PHP is often embedded into HTML code, or it can be used in combination with various web template systems, web content management system and web frameworks. PHP code is usually processed by a PHP interpreter implemented as a module in the web server or as a Common Gateway Interface (CGI) executable.
Python
Python is a widely used high-level, general-purpose, interpreted, dynamic programming language. Its design philosophy emphasizes code readability. Python interpreters are available for installation on many operating systems, allowing Python code execution on a wide variety of systems. Many operating systems include Python as a standard component; the language ships for example with most Linux distributions.
Python is a multi-paradigm programming language: object-oriented programming and structured programming are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming, Many other paradigms are supported using extensions, including design by contract and logic programming.
Python is a remarkably powerful dynamic programming language that is used in a wide variety of application domains. Since 2003, Python has consistently ranked in the top ten most popular programming languages as measured by the TIOBE Programming Community Index. Large organizations that make use of Python include Google, Yahoo!, CERN, NASA. Python is used successfully in thousands of real world business applications around globally, including many large and mission-critical systems such as YouTube.com and Google.com.
Python was designed to be highly extensible. Libraries like NumPy, SciPy and Matplotlib allow the effective use of Python in scientific computing. Python is intended to be a highly readable language. Python can also be embedded in existing applications and hasbeen successfully embedded in a number of software products as a scripting language. Python can serve as a scripting language for web applications, e.g., via mod_wsgi for the Apache web server.
Python can be used in embedded, small or minimal hardware devices. Some modern embedded devices have enough memory and a fast enough CPU to run a typical Linux-based environment, for example, and running CPython on such devices is mostly a matter of compilation (or cross-compilation) and tuning. Various efforts have been made to make CPython more usable for embedded applications.
For more limited embedded devices, a re-engineered or adapted version of CPython, might be appropriate. Examples of such implementations include the following: PyMite, Tiny Python, Viper. Sometimes the embedded environment is just too restrictive to support a Python virtual machine. In such cases, various Python tools can be employed for prototyping, with the eventual application or system code being generated and deployed on the device. Also MicroPython and tinypy have been ported Python to various small microcontrollers and architectures. Real world applications include Telit GSM/GPRS modules that allow writing the controlling application directly in a high-level open-sourced language: Python.
Python on embedded platforms? It is quick to develop apps, quick to debug – really easy to make custom code quickly. Sometimes lack of static checking vs a regular compiler can cause problems to be thrown at run-time. To avoid those try to have 100% test coverage. pychecker is a very useful too also which will catch quite a lot of common errors. The only downsides for embedded work is that sometimes python can be slow and sometimes it uses a lot of memory (relatively speaking). An empirical study found scripting languages (such as Python) more productive than conventional languages (such as C and Java) for a programming problem involving string manipulation and search in a dictionary. Memory consumption was often “better than Java and not much worse than C or C++”.
JavaScript and node.js
JavaScript is a very popular high-level language. Love it or hate it, JavaScript is a popular programming language for many, mainly because it’s so incredibly easy to learn. JavaScript’s reputation for providing users with beautiful, interactive websites isn’t where its usefulness ends. Nowadays, it’s also used to create mobile applications, cross-platform desktop software, and thanks to Node.js, it’s even capable of creating and running servers and databases! There is huge community of developers. JavaScript is a high-level language.
Its event-driven architecture fits perfectly with how the world operates – we live in an event-driven world. This event-driven modality is also efficient when it comes to sensors.
Regardless of the obvious benefits, there is still, understandably, some debate as to whether JavaScript is really up to the task to replace traditional C/C++ software in Internet connected embedded systems.
It doesn’t require a complicated IDE; all you really need is a terminal.
JavaScript is a high-level language. While this usually means that it’s more human-readable and therefore more user-friendly, the downside is that this can also make it somewhat slower. Being slower definitely means that it may not be suitable for situations where timing and speed are critical.
JavaScript is already in embedded boards. You can run JavaScipt on Raspberry Pi and BeagleBone. There are also severa other popular JavaScript-enabled development boards to help get you started: The Espruino is a small microcontroller that runs JavaScript. The Tessel 2 is a development board that comes with integrated wi-fi, an ethernet port, two USB ports, and companion source library downloadable via the Node Package Manager. The Kinoma Create, dubbed the “JavaScript powered Internet of Things construction kit.”The best part is that, depending on the needs of your device, you can even compile your JavaScript code into C!
JavaScript for embedded systems is still in its infancy, but we suspect that some major advancements are on the horizon.We for example see a surprising amount of projects using Node.js.Node.js is an open-source, cross-platform runtime environment for developing server-side Web applications. Node.js has an event-driven architecture capable of asynchronous I/O that allows highly scalable servers without using threading, by using a simplified model of event-driven programming that uses callbacks to signal the completion of a task. The runtime environment interprets JavaScript using Google‘s V8 JavaScript engine.Node.js allows the creation of Web servers and networking tools using JavaScript and a collection of “modules” that handle various core functionality. Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world. Modern desktop IDEs provide editing and debugging features specifically for Node.js applications
JXcore is a fork of Node.js targeting mobile devices and IoTs. JXcore is a framework for developing applications for mobile and embedded devices using JavaScript and leveraging the Node ecosystem (110,000 modules and counting)!
Why is it worth exploring node.js development in an embedded environment? JavaScript is a widely known language that was designed to deal with user interaction in a browser.The reasons to use Node.js for hardware are simple: it’s standardized, event driven, and has very high productivity: it’s dynamically typed, which makes it faster to write — perfectly suited for getting a hardware prototype out the door. For building a complete end-to-end IoT system, JavaScript is very portable programming system. Typically an IoT projects require “things” to communicate with other “things” or applications. The huge number of modules available in Node.js makes it easier to generate interfaces – For example, the HTTP module allows you to create easily an HTTP server that can easily map the GET
method specific URLs to your software function calls. If your embedded platform has ready made Node.js support available, you should definately consider using it.
Future trends
According to New approaches to dominate in embedded development article there will be several camps of embedded development in the future:
One camp will be the traditional embedded developer, working as always to craft designs for specific applications that require the fine tuning. These are most likely to be high-performance, low-volume systems or else fixed-function, high-volume systems where cost is everything.
Another camp might be the embedded developer who is creating a platform on which other developers will build applications. These platforms might be general-purpose designs like the Arduino, or specialty designs such as a virtual PLC system.
This third camp is likely to become huge: Traditional embedded development cannot produce new designs in the quantities and at the rate needed to deliver the 50 billion IoT devices predicted by 2020.
Transition will take time. The enviroment is different than computer and mobile world. There are too many application areas with too widely varying requirements for a one-size-fits-all platform to arise.
Sources
Most important information sources:
New approaches to dominate in embedded development
A New Approach for Distributed Computing in Embedded Systems
New Approaches to Systems Engineering and Embedded Software Development
Embracing Java for the Internet of Things
Embedded Linux – Shell Scripting 101
Embedded Linux – Shell Scripting 102
Embedding Other Languages in BASH Scripts
PHP Integration with Embedded Hardware Device Sensors – PHP Classes blog
JavaScript: The Perfect Language for the Internet of Things (IoT)
Anyone using Python for embedded projects?
JavaScript: The Perfect Language for the Internet of Things (IoT)
MICROCONTROLLERS AND NODE.JS, NATURALLY
Node.JS Appliances on Embedded Linux Devices
The smartest way to program smart things: Node.js
Embedded Software Can Kill But Are We Designing Safely?
DEVELOPING SECURE EMBEDDED SOFTWARE
1,687 Comments
Tomi Engdahl says:
Python Ditches The GILs And Comes Ashore
https://hackaday.com/2021/11/03/python-ditches-the-gils-and-comes-ashore/
The Python world has been fractured a few times before. The infamous transition from version 2 to version 3 still affects people today, and there could be a new schism in the future. [Sam Gross] proposed a solution to drop the Global Interrupt Lock (GIL), which would have enormous implications for many projects that leverage the CPython internals, such as Pandas and NumPy.
The fact that Python is interpreted is a double edge sword. It means there can be different runtimes, such as Pyston, Cinder, MicroPython, PyPy, and others, that might support the whole language, a specific version, or a subset. But if you’re using Python, you’re probably running CPython. And it has something known as global interpreter lock that affects threaded code. In a nutshell, only one thread can run in the interpreter at a time. There are some ways around it, such as moving performance-critical sections to C or having multiple interpreters. However, most existing solutions come with considerable downsides.
Why Was the GIL There, and How do You Remove It?
Program state is much easier to reason about when you can guarantee that only one thread will be running at a time. Reference counting, memory allocation, method resolution order caches, and garbage collections are just some of the things that aren’t thread-safe without the GIL.
Tomi Engdahl says:
The Linux X86 Journey To Main()
https://hackaday.com/2021/11/05/the-linux-x86-journey-to-main/
Have you ever had a program crash before your main function executes? it is rare, but it can happen. When it does, you need to understand what happens behind the scenes between the time the operating system starts your program and your first line of code in main executes. Luckily [Patrick Horgan] has a tutorial about the subject that’s very detailed. It doesn’t cover statically linked libraries but, as he points out, if you understand what he does cover, that’s easy to figure out on your own.
http://dbp-consulting.com/tutorials/debugging/linuxProgramStartup.html
Tomi Engdahl says:
Linux Fu: Automatic Header File Generation
https://hackaday.com/2021/11/08/linux-fu-automatic-header-file-generation/
I’ve tried a lot of the “newer” languages and, somehow, I’m always happiest when I go back to C++ or even C. However, there is one thing that gets a little on my nerves when I go back: the need to have header files with a declaration and then a separate file with almost the same information duplicated. I constantly make a change and forget to update the header, and many other languages take care of that for you. So I went looking for a way to automate things. Sure, some IDEs will automatically insert declarations but I’ve never been very happy with those for a variety of reasons. I wanted something lightweight that I could use in lots of different toolsets.
Tomi Engdahl says:
https://fossil-scm.org/home/doc/trunk/src/makeheaders.html
Tomi Engdahl says:
Azure RTOS tuo paljon lisää 32-bittisiin
https://etn.fi/index.php/tekniset-artikkelit/12816-azure-rtos-tuo-paljon-lisaeae-32-bittisiin
STMicroelectronicsin suositun STM32-ohjainperheen parissa työskentelyyn tarjotut uudet resurssit ovat mielenkiintoisia. Erityisen kiintoisa on mahdollisuus integroida Microsoftin reaaliaikainen Azure RTOS – käyttöjärjestelmä kirjastoineen STM32-kehitysalustaan.
Sulautettuihin järjestelmiin tarkoitettujen mikro-ohjainten parissa työskenteleville kehitys- resursseista ja kirjastoista on tullut selkeästi erittäin tärkeä osa itse ohjainpiirien tarjontaa. Monille kehittäjille nämä resurssit ovat yhtä tärkeitä kuin sovelluksissa käytettävien mikro-ohjainten ominaisuudet ja hinnat. Mikä on tilanne omalla kohdallasi?
Yksinkertaisesti ilmaistuna Microsoft on tehnyt yhteistyötä STMicroelectronicsin kanssa varmistaakseen, että Azure RTOS hyödyntää tehokkaasti STM32- mikro-ohjaimia, minkä ansiosta suunnittelijat voivat nopeasti aloittaa projektiensa kehitystyön käyttämällä ThreadX RTOS – käyttöjärjestelmää ja lukuisia muita Azure RTOS -komponentteja (USBX, NEXT Duo, FileX, LevelX jne).
STM32 säilyy luonnollisesti edelleen avoimena alustana myös muille RTOS-käyttöjärjestelmille. Tämä tarkoittaa, että ne kehittäjät, jotka haluavat käyttää FreeRTOS-, Zephyr- tai mitä tahansa muuta RTOS-järjestelmää sulautetuissa sovelluksissaan, voivat edelleen tehdä niin.
MITÄ AZURE RTOS TUO STM32-KEHITYKSEEN?
Azure RTOS on ainoa sulautetuille järjestelmille suunnattu ilmainen käyttöjärjestelmä, jolla on useita sertifikaatteja sekä turvallisuuden (IEC 61508 SIL 4, ISO 26262 ASIL D, IEC 62304 Medical Class C) että tietoturvan (EAL4+, FIPS 140-2) alueilta. Käyttäjät, jotka haluavat edetä esimerkiksi teollisuuden, autonvalmistuksen tai lääketieteen markkinoille tai muille uusille alueille, voivat kääntyä ST-kumppanuusohjelman jäseneksi liittyneen Micro- softin puoleen saadakseen nämä standardit käyttöön ja tarjotakseen asiakkailleen aiempaa laajemmat takuut.
STMicroelectronics jatkaa yhteistyötä Microsoftin kanssa varmistaakseen, että Azure RTOS hyödyntää parhaalla mahdollisella tavalla STM32-perheen mikro- ohjainten tärkeimpiä resursseja kuten laitepohjaista salausydintä.
Toinen huomioitava seikka on, että siirtyminen suunnittelukonseptista lopputuotteeseen voi olla hyvin monimutkainen tehtävä. Tästä syystä markkinoille tuomi- sen nopeuttamiseksi kaikki STM32-mikro-ohjaimet saavat Azure RTOSin vapaat käyttö- ja tuotantolisenssit.
STMicroelectronicsin ja Microsoftin välisen yhteistyön ansiosta kehittäjät voivat muokata Azure RTOS -pohjaista lähdekoodia ja jakaa sen uudelleen järjestelmiinsä. Tämän lisäksi STMicroelectronics päivittää ja julkaisee myös uusia integroituja ohjelmistopaketteja ja työkaluja STM32Cube-kehitysalustalle Azure RTOS -ympäristön hyödyntämiseksi.
MITÄ AZURE RTOS TUO STM32CUBEEN?
Azure RTOS:n ytimenä on ThreadX RTOS, joka erottuu muun muassa tehokkaiden ajoitusominaisuuksiensa ansi- osta. Microsoft esittää artikkelissa ’Preemption-Threshold Scheduling’, kuinka RTOS perinteisesti mahdollistaa minkä tahansa korkeamman prioriteetin säikeen ennakoinnin, mikä tarkoittaa tehtävän haltuunottoa käynnissä olevalta alemman prioriteetin säikeeltä.
ThreadX tarjoaa kuitenkin paljon enemmän hienojakoisuutta ja antaa kehittäjille mahdollisuuden asettaa kynnysarvoja, jotta voidaan välttää ennakointeja ja vähentää kontekstin vaihtamista, mikä optimoi merkittävästi järjestelmän suorituskykyä. Lisäksi se tarjoaa tapahtumien ketjutuksen, joka mahdollistaa määrätyn toiminnon suorituksen, kun tapahtuma ilmenee. Tämän ansiosta tapahtumaa odottavat säikeet voivat aloittaa käsittelyn automaattisesti, mikä helpottaa kehitystyötä ja vähentää tarvittavia resursseja.
MIKÄ SÄILYY ENNALLAAN?
STMicroelectronicsin tarjoama tekninen tuki säilyy ennallaan asiakkaille, jotka ovat STM32:n, STM32Cuben tai Azure RTOS:n käyttäjiä.
Tomi Engdahl says:
Linux Fu: Automatic Header File Generation
https://hackaday.com/2021/11/08/linux-fu-automatic-header-file-generation/
I’ve tried a lot of the “newer” languages and, somehow, I’m always happiest when I go back to C++ or even C. However, there is one thing that gets a little on my nerves when I go back: the need to have header files with a declaration and then a separate file with almost the same information duplicated. I constantly make a change and forget to update the header, and many other languages take care of that for you. So I went looking for a way to automate things. Sure, some IDEs will automatically insert declarations but I’ve never been very happy with those for a variety of reasons. I wanted something lightweight that I could use in lots of different toolsets.
I found an older tool, however, that does a pretty good job, although there are a few limitations. The tool seems to be a little obscure, so I thought I’d show you what makeheaders — part of the Fossil software configuration management system.
https://fossil-scm.org/home/doc/trunk/src/makeheaders.html
Tomi Engdahl says:
SEGGER tekee RTOSista selvästi nopeamman
https://etn.fi/index.php/13-news/12776-segger-tekee-rtosista-selvaesti-nopeamman
Tomi Engdahl says:
https://hackaday.com/2021/11/03/python-ditches-the-gils-and-comes-ashore/
Tomi Engdahl says:
Parempaa energiatehokkuutta prosessorijärjestelmiin
https://www.uusiteknologia.fi/2021/11/16/parempaa-energiatehokkuutta-prosessorijarjestelmiin/
Sulautettujen tietokonejärjestelmien määrä kasvaa voimakkaasti tulevaisuudessa, mikä aiheuttaa painetta niiden energiatehokkuuden parantamiselle. Tampereella diplomi-insinööri Joonas Multanen on tutkinut tekniikoita, joilla sulautettujen järjestelmien prosessoreista saataisiin energiatehokkaampia.
Vaikka paras energiatehokkuus saavutetaan suunnittelemalla laitteisto suorittamaan vain ennalta määrättyjä toimintoja, laitteiston joustavuus on entistä tärkeämpää tulevaisuudessa. Ratkaisujen edelleen kehittäminen ja päivittäminen on entistä tärkeämpää.
’’Ohjelmoitavuuden avulla järjestelmää voidaan käyttää toiminnallisuuden päivittämiseen ja esimerkiksi käytön aikana havaittaviin toimintoihin, jotka eivät olleet tiedossa sen suunnittelun aikana’’, kertoo ensi viikolla alueen tekniikoista väittelevän Tampereen yliopistolla väittelevä DI Joonas Multanen.
Ohjelmoitavuudella on hänen mukaansa kuitenkin hintansa. Prosessoreiden suorituksen ohjaamisessa käytettävien käskyjen sekä prosessoitavan datan säilytykseen käytetään muisteja, jotka voivat kuluttaa suurimman osan koko prosessorin käyttämästä sähköenergiasta.
Väitöskirjassaan Multanen keskittyi kehittämään menetelmiä käskymuistihierarkioiden energiatehokkuuden lisäämiseksi.
Energy-Efficient Instruction Streams for Embedded Processors
Multanen, Joonas (2021)
https://trepo.tuni.fi/handle/10024/135338
The information and communication technology (ICT) sector is consuming an increasing proportion of global electricity production. At the heart of ICT are computer systems that perform computations on data. During the last two decades the rate of improvement in their energy-efficiency has declined.
Tomi Engdahl says:
Väitös: komponenttien säteilynkesto vaatii uusia menetelmiä
https://etn.fi/index.php/13-news/12824-vaeitoes-komponenttien-saeteilynkesto-vaatii-uusia-menetelmiae
Tomi Engdahl says:
https://hackaday.com/2021/11/16/making-your-own-touchpad-with-pwm-and-rust/
The modern touchpads are incredible feats of engineering, with everything from complex signal processing for noise and tremendous economies of scale driving prices low. So [Kevin] decided to see if he could make his own touchpad. Partially out of curiosity of what makes one touchpad better than another, but also because he was curious if he could. Using an STM32 and a custom PCB, he was off to the races in an incredibly cost-effective way.
After writing some quick firmware in Rust, he was reporting the values read by the PWM channels. Using python, he could get a good idea of the raw values that were being written over USB and visualized.
https://kevinlynagh.com/touchpad/
Tomi Engdahl says:
Secure Development Lifecycle or SDL is a process that standardizes security best practices across a range of products and applications. It captures industry-standard security activities, packaging them so they may be easily implemented.
In many industries such as automotive, industrial equipment/machinery and medical devices, secure product development lifecycle is also becoming a market or regulatory requirement.
Tomi Engdahl says:
Discover the Best Practices for Embedded Development in 2021
Oct. 27, 2021
Access the most up-to-date embedded best development practices from setting the scope, streamlining workflow, and selection of software stack and hardware.
https://www.electronicdesign.com/resources/white-paper/whitepaper/21179604/discover-the-best-practices-for-embedded-development-in-2021?code=QtCompanyDE2-11162021&utm_rid=CPG05000002750211&utm_campaign=36813&utm_medium=email&elq2=8f0bcf734eeb43cf8d01e3a86c106790&oly_enc_id=7211D2691390C9R
The abundance of technology choices without clear and definitive selection criteria can derail development into non-productive research projects and analysis paralysis. Worse yet, bets on technology losers can force engineering teams into market-delaying re-work exercises or early product obsolescence.
Tomi Engdahl says:
SCPI: On Teaching Your Devices The Lingua Franca Of Laboratories
https://hackaday.com/2021/11/17/scpi-on-teaching-your-devices-the-lingua-franca-of-laboratories/
One could be excused for thinking sometimes that the concept of connecting devices with other devices for automation purposes is a fairly recent invention. Yet for all the (relatively) recent hype of the Internet of Things and the ‘smart home’, laboratories have been wiring up their gear to run complicated measurement and test sequences for many decades now, along with factories doing much the same for automating production processes.
Much like the chaotic universe of IoT devices, lab equipment from different manufacturers feature a wide number of incompatible protocol and interface standards. Ultimately these would coalesce into IEEE-488.1 (GPIB) as the physical layer and by 1990 the first Standard Commands for Programmable Instruments (SCPI) standard was released that built on top of IEEE-488.
SCPI defines (as the name suggests) standard commands to interact with instruments. It has over the past decades gone on to provide remote interaction capabilities to everything from oscilloscopes and power supplies to exotic scientific equipment. Many off the shelf devices a hobbyist can buy today feature an SCPI interface via its Ethernet, USB or RS-232C port(s) that combined with software can be used to automate one’s home lab.
Reinventing the Wheel Is No Fun
As much fun as it is to come up with one’s own communication standard for a custom widget, there is a lot to be said for sticking to existing standards, instead of adding another ‘standard’ to the pile.
Another reason is that of compatibility with existing software, which also touches on why end users likely to be enthused about this awesome new protocol. When using SCPI, it can be fairly painlessly integrated into existing (lab) automation software, as the whole concept behind SCPI is that each instrument will implement its own range of custom commands in addition to a number of required ones.
For users of software like LabVIEW or Sigrok, the ideal scenario is that the device speaks SCPI, and that in the worst-case a custom handler has to be written for the custom SCPI commands when one isn’t available yet.
Enter LibSCPI
Not everyone wants to write their own SCPI parser from scratch, which is why the SCPI parser library v2, or simply ‘libscpi‘ is a good start. It implements the current SCPI 1999 standard. Since we’d be interested in using SCPI on an embedded device, we’ll take a look at the provided FreeRTOS with LwIP (netconn) example. This shows the implementation of an SCPI server which runs in a FreeRTOS thread.
Tomi Engdahl says:
C Is The Greenest Programming Language
https://hackaday.com/2021/11/18/c-is-the-greenest-programming-language/
Have you ever wondered if there is a correlation between a computer’s energy consumption and the choice of programming languages? Well, a group Portuguese university researchers did and set out to quantify it. Their 2017 research paper entitled Energy Efficiency across Programming Languages / How Do Energy, Time, and Memory Relate? may have escaped your attention, as it did ours.
Last year they updated the functional language retults, and all the setups, benchmarks, and collected data can be found here.
Energy Efficiency across Programming Languages
How does energy, time, and memory relate?
https://sites.google.com/view/energy-efficiency-languages/
Energy Efficiency across Programming Languages
https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf
Tomi Engdahl says:
https://etn.fi/index.php/tekniset-artikkelit/12843-turvaa-ja-luotettavuutta-rtosiin
Monisäikeisyys on iso haaste sulautettujen sovellusten mikro-ohjaimille ja niiden reaaliaikakäyttöjärjestelmille. Apua kehittäjille tuo Zephyr RTOS, joka on suunniteltu turvallisuutta sekä nopeaa ja tehokasta kehitystä silmällä pitäen.
Viimeisten viiden vuoden aikana Zephyr-projekti on kehittänyt monisäikeistä avoimen lähdekoodin reaaliaikaista käyttöjärjestelmää eli RTOSia sulautetuille suunnitteluille.
RTOS tukee tällä hetkellä yli 200 korttia, joissa on sulautettuja mikro-ohjaimia Arm:sta ja RISC-V:stä Tensilicaan, NIOSiin ja ARC:een yksi- ja moniytimisinä järjestelminä. Lisäksi korteilla on yhteyksiä kuten Bluetooth Low Energy, Wi-Fi ja 802.15.4 Matter, 6LoWPAN, CoAP, Ethernet, USB, CAN ja Thread. BSD-paketit sisältävät kirjastot, joiden avulla kehittäjien on helppo saada RTOS käyttöön.
Yksi tärkeä näkökohta Zephyr-projektissa on, että RTOS on suunniteltu turvallisuutta sekä nopeaa ja tehokasta kehitystä silmällä pitäen. Osana The Linux Foundationia projektia tukee tuotehäiriöiden vastaustiimi, auditoitava koodikanta, joka on kehitetty turvallisuussertifioinneilla, sekä pitkäaikainen tuki (LTS) tietoturvapäivityksillä.
Sulautettu järjestelmä, jossa on yhteys pilveen, sisältää kohtuullisen määrän koodia ja on siten varsin monimutkainen. “Hello world” -projekti, jossa on AWS-yhteys MQTT:n ja TLS:n kautta, tuottaa satojen kilotavujen kokoisen binäärikoodin. Useimmissa RTOS-sovelluksissa on paljon monimutkaisia vuorovaikutuksia, joissa virheet ovat melko yleisiä, mukaan lukien haavoittuvuudet, joita voidaan hyödyntää päästäkseen kiinni laitteeseen ja mahdollisesti muuhun verkkoon. Jos järjestelmä ei ole suojattu, se ei ole turvallinen, ja mahdollisilla haavoittuvuuksilla voi olla dramaattisia seurauksia teollisiin tai lääketieteellisiin järjestelmiin.
Zephyrin kaltainen RTOS lisää toisen kerroksen monimutkaisuutta, joka sulautettujen suunnittelijoiden on otettava huomioon eli monisäikeisyyden. Tämä mahdollistaa koodin jakamisen erillisiin säikeisiin, jotka toimivat itsenäisesti, ainakin teoriassa. Käytännössä säikeiden välillä on usein riippuvuuksia, jotka lisäävät monimutkaisuutta. Jotkut ovat tarkoitettuja ja tarpeellisia, koska säikeiden on usein kommunikoitava, mutta toiset ovat tahattomia ja joskus ongelmallisia. Ne eivät useinkaan näy lähdekoodissa, ja on vaikea ennustaa, kuinka ne vaikuttavat ajonaikaiseen käyttäytymiseen.
Tämä on haaste mikro-ohjaimille (MCU), joita käytetään yleisesti IoT-sovelluksissa, koska niissä ei aina ole muistinsuojausta. Siten bugeja ei eristetä, ja ne voivat vaikuttaa mihin tahansa ajonaikaisen järjestelmän osaan datan korruptoitumisen kautta. Yhdessä monisäikeisyyden kanssa, jossa muut säikeet voivat estää suorittamisen melkein milloin tahansa ja jossa säieriippuvuudet lisäävät monimutkaisuutta, on olemassa suurempi riski epädeterministiselle käytökselle, vaikeasti havaittaville virheille/bugeille ja haavoittuvuuksille.
Deterministinen suorittaminen on ratkaisevan tärkeää testattavuuden, tietoturvan ja turvallisuuden kannalta ja edellyttää, että ohjelmiston ajoituksen vaihtelut minimoidaan eivätkä ne vaikuta tärkeiden tapahtumien järjestykseen. Muuten voi tuloksena olla tähtitieteellinen määrä mahdollisia toteutusskenaarioita, joita on mahdotonta testata.
https://zephyrproject.org/
Tomi Engdahl says:
https://www.electrokits.ro/en/what-are-and-how-do-ice-in-circuit-emulators-work/
Tomi Engdahl says:
RTOS: Zephyr Project
https://www.electronicdesign.com/magazine/50595?utm_source=EG%20ED%20Connected%20Solutions&utm_medium=email&utm_campaign=CPS211115036&o_eid=7211D2691390C9R&rdx.ident%5Bpull%5D=omeda%7C7211D2691390C9R&oly_enc_id=7211D2691390C9R
The Zephyr® Project strives to deliver the best-in-class RTOS for connected resource-constrained devices, built to be secure and safe.
https://zephyrproject.org/
Complete flexibility & freedom of choice
Open source & neutral governance
Supports multiple hardware architectures
Small footprint: scales from small Cortex-M devices to multi-core 64-bit CPUs
Connect embedded devices securely to any cloud
Multiple protocol options including BLE mesh and Thread
Supporting industrial, automotive, smart city and smart home
Cloud agnostic – Connect with transport layer security to any cloud
Develop products with safety built in
Long-term support
In-depth security development lifecycle
Functional safety certification coming soon
350+ Boards Supported
Zephyr supports more than 350 boards. Search our list for the hardware used in your application. This diversity of supported boards gives developers and product manufacturers multiple options to solve their embedded RTOS challenges with Zephyr. If your board is not supported out of the box, adding support for a new board is simple.
Tomi Engdahl says:
MicroPython Hardware: Digital I/O
https://learn.adafruit.com/micropython-hardware-digital-i-slash-o
Tomi Engdahl says:
Toit open-source language claims to be 30x faster than MicroPython on ESP32
https://www.cnx-software.com/2021/11/28/toit-open-source-language-claims-to-be-30x-faster-than-micropython-on-esp32/
Developed by a team of former Google employees, Toit is a complete IoT platform with remote management, firmware updates for fleets of devices with features similar to the one offered by solutions such as balena, Microsoft Azure, or Particle edge-to-cloud platform.
POSTED ON AUGUST 6, 2021 BY SAUMITRA JAGDALE – NO COMMENTSON MICROSOFT AZURE IOT, BALENA, PARTICLE, OR TOIT – CHOOSING THE RIGHT IOT DEVELOPMENT PLATFORM
https://www.cnx-software.com/2021/08/06/microsoft-azure-iot-balena-particle-toit-iot-development-platform-comparision/
Microsoft Azure IoT, Balena, Particle, or Toit – Choosing the Right IoT Development Platform
With the ongoing fourth Industrial Revolution (Industry 4.0), IoT technologies are playing a major role in automating industrial processes. Integrating existing systems with IoT results in an intelligent solution that focuses more on providing better adaptability and resource efficiency. If you start building such systems from scratch while ensuring reliability and other factors, it will surely take a lot of research and time. This is where an IoT development platform steps in to save your time and makes things a lot easier.
Tomi Engdahl says:
Six Tips for Power Integrity Debug with an Oscilloscope
Dec. 1, 2021
Detailed real-world advice and demonstrations of multiple techniques on a sample microcontroller board can help you debug your power integrity problems fast.
https://www.electronicdesign.com/technologies/test-measurement/article/21182573/teledyne-lecroy-six-tips-for-power-integrity-debug-with-an-oscilloscope?utm_source=EG%20ED%20Analog%20%26%20Power%20Source&utm_medium=email&utm_campaign=CPS211130095&o_eid=7211D2691390C9R&rdx.ident%5Bpull%5D=omeda%7C7211D2691390C9R&oly_enc_id=7211D2691390C9R
What you’ll learn:
Remember fundamentals and practice situational awareness in taking measurements.
It’s not only using the right probe, but it’s also using the probe right.
Eliminating measurement artifacts is tricky, but not impossible.
An oscilloscope is an essential instrument for making power integrity (PI) measurements, but to apply it effectively, you’ll need situational awareness. Be aware of the oscilloscope features, the signal features, and potential measurement artifacts that could impede your view of the real signal. Key scope features include the bandwidth, sample rate, time base, vertical scale, input impedance, channel bandwidth, and probe bandwidth.
Demonstrations of measurements on sample microcontroller boards illustrate six tips that you can apply to your own PI debug tasks. In addition to an oscilloscope, you will need high-performance probes and the ability to choose the optimum versions—including 10x passive, power-rail, near-field, current, and differential probes—for your application.
Tip 1: Get the most out of your 10x passive probe
The 10x passive probe is the workhorse probe for most oscilloscope measurements. The first thing you want to do is apply color bands on your 10x passive probes that match the color of the corresponding oscilloscope trace to keep track of what you’re measuring
Tip 2: Use dc coupling for power-rail measurements
If you’re looking for small variations in noise on a 5-V power rail, you may be inclined to use ac coupling. It lets you zoom in and out on the signal without having to reposition the trace on the screen every time you change the vertical scale. However, when you do that, you lose information about slow drift or other variations, because everything below about 10 Hz is filtered out.
Tip 3: Use a rail probe to measure switching noise
When looking at the power rails, consider using a rail probe, such as the Teledyne LeCroy RP4030. The RP4030 is a 4-GHz, dc-coupled active probe designed to measure the low impedances of the power rails but with the benefits of a high signal-to-noise ratio (SNR) and high bandwidth.
Like the 10x passive probe, the rail probe includes two paths. First is a passive ac-coupled path for high frequencies that acts like a high-pass filter with a pole frequency of about 10 to 100 kHz. The second path consists of two inverting amplifiers with a 16-bit digital-to-analog converter (DAC) that enables precision offset control. This path together with the oscilloscope’s input impedance acts as a low-pass filter, and again, it’s necessary to align the poles of the high- and low-pass filters to obtain a flat response.
Tip 4: Use a near-field probe to locate EMI problems
When looking for potential EMI problems during the pre-compliance test, opt for a near-field probe. Note that the near-field probe is essentially a low-impedance loop, so take care to connect it to a 50-Ω oscilloscope input—not a 1-MΩ input—to prevent reflections and ringing. In addition, when probing a microcontroller board, a useful technique is to trigger the oscilloscope on a switching I/O signal, so that the observed waveform will be synchronized with the microcontroller’s clock.
Tip 5: Use a current probe to find ground loops
A high-sensitivity current probe can help measure common ground-loop currents found in USB cables and other external connections. These currents can arise from the different ground potentials of multiple instruments connected to the microcontroller demo board, for example. They can fluctuate quickly if the ground potential differences result from switching within the demo board or the devices connected to it.
connecting a ground pin on the microcontroller board to ground on another external device plugged into the wall can result in common currents reaching 75 mA. Only 5 mA is required to fail an FCC part 15 class B test. The current probe is useful in viewing common currents
Tip 6: Use a differential probe to check a microcontroller’s current draw
To measure the actual current that the microcontroller draws in real-time, use a differential probe. First, insert a sense resistor—for example, 0.5 Ω—in the series path of the power rail, and then measure the voltage across it. You could use two single-ended probes, one to measure the voltage to ground on each side of the resistor. However, that would involve subtracting one large number from another to get the voltage across the resistor, which can introduce inaccuracies.
Instead, use the differential probe, which is designed to measure small voltage differences with a large common dc offset. You can use the differential probe and sense resistor to measure inrush as well as steady-state current.
Summary
In conclusion, keep in mind that it’s easy to do a measurement, but hard to do so without artifacts. Practice situational awareness. Make sure you use the right probe for the right application. Use the 10x passive probe with low-inductance ground connections to the extent possible. Then, use a rail probe for measurements requiring high bandwidth and SNR, use a near-field probe for pre-compliance EMC testing, turn to a current probe to measure common currents, and use a differential probe with a series resistor to measure inrush and steady-state currents.
Tomi Engdahl says:
The Co-Processor Architecture: An Embedded System Architecture for Rapid Prototyping
https://www.digikey.com/en/articles/the-co-processor-architecture-an-embedded-system-architecture-for-rapid-prototyping?dclid=CMmf7YCc0fQCFUykGAodJuIGwg
Editor’s Note — Although well known for its digital processing performance and throughput, the co-processor architecture provides the embedded systems designer opportunities to implement project management strategies, which improve both development costs and time to market. This article, focused specifically upon the combination of a discrete microcontroller (MCU) and a discrete field programmable gate array (FPGA), showcases how this architecture lends itself to an efficient and iterative design process. Leveraging researched sources, empirical findings, and case studies, the benefits of this architecture are explored and exemplary applications are provided. Upon this article’s conclusion, the embedded systems designer will have a better understanding of when and how to implement this versatile hardware architecture.
Tomi Engdahl says:
Run Machine Learning Code in an Embedded IoT Node to Easily Identify Objects
https://www.digikey.com/en/articles/run-machine-learning-code-in-an-embedded-iot-node?dclid=CLG_joKc0fQCFeEHogMdwQIGyg
Internet of Things (IoT) networks operating in dynamic environments are being expanded beyond object detection to include visual object identification in applications such as security, environmental monitoring, safety, and Industrial IoT (IIoT). As object identification is adaptive and involves using machine learning (ML) models, it is a complex field that can be difficult to learn from scratch and implement efficiently.
The difficulty stems from the fact that an ML model is only as good as its data set, and once the correct data is acquired, the system must be properly trained to act upon it in order to be practical.
This article will show developers how to implement Google’s TensorFlow Lite for Microcontrollers ML model into a Microchip Technology microcontroller. It will then explain how to use the image classification and object detection learning data sets with TensorFlow Lite to easily identify objects with a minimum of custom coding.
It will then introduce a TensorFlow Lite ML starter kit from Adafruit Industries that can familiarize developers with the basics of ML.
Tomi Engdahl says:
Sulautetun laitteen kehitys verkon kautta 4 dollarilla päivä
https://www.uusiteknologia.fi/2021/12/08/sulautetun-laitteen-kehitys-verkon-kautta-4-dollarilla-paiva/
Sulautettujen laitteiden rakentajat voivat verkon kautta testata laiteratkaisuja ilman omaa laitteistoa MikroElektronikan uuden Planet Debug-verkkopalvelun avulla. Ratkaisun avulla yrityksen laite- ja ohjelmistoratkaisuja voidaan kehittää etänä neljän dollarin päivähintaan.
https://www.mikroe.com/planet-debug
Tomi Engdahl says:
ADI toi kehittäjille oman Linuxin
https://etn.fi/index.php/13-news/12925-adi-toi-kehittaejille-oman-linuxin
Analog Devices tunnetaan ennen kaikkea signaalinkäsittelyn piirejä kehittävänä puolijohdetalona. Nyt ADI on tuonut tarjolle oman Linux-versionsa. Kuiper Linux perustuu Raspberry Pi -korteilta tuttuun Raspbianiin ja helpottaa erilaisten ADI-oheislaitteiden liittämistä Linux-järjestelmään.
Kaikkiaan ADI on tuonut tarjolle yli 1000 Linux-ajuria erilaisille oheislaitteille. Nämä avoimen lähdekoodin laiteajurit on suunniteltu mahdollistamaan sulautettujen ratkaisujen nopea kehittäminen, ja ne virtaviivaistavat asiakkaiden ohjelmistokehitysprosessia ja tarjoavat pääsyn testattuihin, korkealaatuisiin ohjelmistoihin.
ADI:n oma Kuiper Linux sisältää ajurit osana kerneliä. Se on optimoitu ADI-oheislaitteille ja tukee suosittuja ARM-pohjaisia järjestelmiä, kuten Raspberry Pi, Xilinx Zynq, Xilinx Zynq Ultrascale+ MPSoC, Intel Cyclone V, Intel Arria 10 SX ja Intel Stratix 10.
Tomi Engdahl says:
Character LCD Emulator
https://hackaday.io/project/171231-character-lcd-emulator
Emulate a HD44780 character LCD.
Includes a web wrapper to emulate it in your browser.
I wanted to add a character LCD to my breadboard computer and web-based emulator. But first, I had to emulate one.
So, this mini project was born.
Emulates all inputs of a standard character LCD, to an internal state. The internal state can be used however you like, but the package includes a WebAssembly wrapper and Javascript front-end example.
Written in C and with no other dependencies, you could use the library with most other languages too.
The Core API doesn’t include any rendering functionality, so you’re free to use any rendering technology to draw the resulting display. What it does provide is a description of the display’s pixels. Which are lit, which are dim. Using this information, rendering a display of any size is trivial.
The repository includes one such renderer using a HTML5 canvas.
Tomi Engdahl says:
Error Codes And The Law Of Least Astonishment
https://hackaday.com/2021/12/17/error-codes-and-the-law-of-least-astonishment/
Do you know the law of least astonishment? I am not sure of its origin, but I first learned it from the excellent “Tao of Programming.” Simply put, it is the principle that software should always respond to the users in a way that least astonishes them. In other words, printing a document shouldn’t erase it from your file system.
Following the law of least astonishment, what should a program do when it hits a hard error? You might say that it should let the user know. Unfortunately, many systems just brush it under the rug these days.
I think it started with Windows. Or maybe the Mac. The thinking goes that end users are too stupid or too afraid of error codes or detailed messages so we are just leaving them out.
But it isn’t just iPhones. Windows is full of things like that and you only hope there will be a log in the event viewer with more details. I also see more of it now on Linux, although there is usually a log file somewhere if you know how to find it. While I get it that programs having errors run the risk of astonishing the user, it is even more astonishing if there’s no explanation of what’s wrong. Imagine if your bank sent you a note: there is a problem with your account. So you respond: “Did I overdraw?” They reply, “No.” Now what? That’s the state of many software errors today.
There’s really no excuse on desktop systems or websites. However, you might want to forgive tiny embedded systems. Don’t! I recently ported the 3D printer firmware Marlin to an ANET A8 board — an 8-bit processor with little memory — that had been on Repetier firmware for many years. The first time I tried to do an autolevel probe I got the message: Probing failed. That’s it.
Too much overhead? Tell me the program counter where the error happened. That used to be a pretty common practice. Granted, it requires you to have a memory map file and know how to read it but it is still better than nothing.
The Tao of Programming
https://www.mit.edu/~xela/tao.html
Tomi Engdahl says:
https://etn.fi/index.php/13-news/12977-nyt-taemaekin-on-mahdollista-laitteisto-palveluna
Tomi Engdahl says:
Kosketusohjausta ilman näköyhteyttä
https://etn.fi/index.php/tekniset-artikkelit/12987-kosketusohjausta-ilman-naekoeyhteyttae
Kosketusnäytöt ovat jo korvanneet monet kytkimet ja valitsimet autossa. Tyylikäs ja tasainen pinta on kuitenkin myös ongelma: säätimiä ei voi tuntea, joten kuljettajan on vilkaistava niitä. Tämä voi olla vaarallista suurissa nopeuksissa ja tiheässä kaupunkiliikenteessä.
Ratkaisu tähän ongelmaan tulee haptisella palautejärjestelmällä. Jos kosketusnäytössä on aktiivinen haptinen palaute, se antaa käyttäjälle samanlaisen palautteen kuin mekaaninen näppäin. Tällaisia haptisia takaisinkytkentäjärjestelmiä varten on kolmen tyyppisiä toimilaitteita: pietsoelementit, värinämoottorit ja lineaariset haptiset aktuaattorit.
Lineaariset haptiset aktuaattorit – myös suurille näytöille
Lineaariset haptiset aktuaattorit tai toimilaitteet määritellään niiden antaman erittäin vahvan palautteen perusteella. Tämän ansiosta ne voivat antaa erittäin havaittavan haptisen palautteen jopa suurilla kosketusnäytöillä: palauta on verrattavissa näppäinpainallukseen. Palaute annetaan nopeasti liipaisuviiveellä, joka on enintään 3-5 millisekuntia.
Lineaarisen haptisen takaisinkytkennän toimilaitteet toimivat 9-16 V:n käyttöjännitteellä ja niiden ainoa haittapuoli on 16 millimetrin asennuskorkeus.
Värinämoottorit – helppoja hallita
Värinämoottorit liikuttavat painoa siten, että ne tärisevät aktuaattorien painalluspalautteen lähettämisen sijaan. Ne kärsivät kuitenkin suhteellisen huomattavasta viiveestä: 20-50 millisekunnin liipaisuviive saa palautteen tuntumaan jokseenkin keinotekoiselta. Ne vaativat alle 12 V:n liipaisujännitteen
Pietsoelementit – litteitä ja paineherkkiä
0,25 millimetrin paksuisina pietsoelementit ovat erittäin litteitä. Ne ovat myös paineherkkiä, mikä tarkoittaa, että suurempi paine näytön tiettyyn kohtaan tuottaa suuremman jännitteen kuin kevyempi paine. Pietsoelementin palaute/takaisinkytkentä vaihtelee jännitteen mukaan, ja aktuaattori voi myös laukaista erityyppisiä takaisinkytkentöjä eri aaltomuodoissa. Tämä avaa muita ohjausmahdollisuuksia: esimerkiksi äänenvoimakkuutta voidaan kasvattaa sitä nopeammin, mitkä kovempaa nappia painetaan. Palaute on kuitenkin vähemmän näkyvää kuin kahdella muulla tekniikalla.
Piezoelementeissä ei ole lainkaan liikkuvia osia, mikä tekee niistä erittäin kestäviä ja pitkäikäisiä. Niiden haittana on kuitenkin korkea, vähintään 24 voltin liipaisujännite.
Tomi Engdahl says:
Kehitystyökalut kaikille alustoille – jopa Windows-on-Armille
https://etn.fi/index.php/13-news/12991-kehitystyoekalut-kaikilla-alustoille-jopa-windows-on-armille
Saksalainen sulautettujen sovellusten työkaluja kehittävä SEGGER ilmoittaa rehvakkaasti, että sen J-Link- ja J-Trace-ohjelmistot toimivat nyt kaikilla mahdollisilla alustoilla. Linuxin, MacOS:n ja Windowsin rinnalle on tullut Windows-on-Arm eli Arm-prosessoreille käännetty Windows.
Windows-on-Arm -keskustelu on kiihtynyt sen jälkeen, kun kävi ilmi, että Qualcommin yksinoikeus kehittää Windowsia tukevia Arm-prosessoreja on päättymässä. Saman tien moni valmistaja, esimerkiksi Meditek, ilmoitti kehittävänsä suorittimien seuraavan aallon Windows-on-Arm -läppäreille.
Tomi Engdahl says:
How Working Remotely is Spawning a Design Revolution
Nov. 15, 2021
The forced isolation from COVID brought a perfect storm of need to foment a greater acceptance of advanced design and development tools.
https://www.mwrf.com/resources/industry-insights/article/21181278/microwaves-rf-how-working-remotely-is-spawning-a-design-revolution?utm_source=RF%20MWRF%20Today&utm_medium=email&utm_campaign=CPS211217039&o_eid=7211D2691390C9R&rdx.ident%5Bpull%5D=omeda%7C7211D2691390C9R&oly_enc_id=7211D2691390C9R
What you’ll learn:
How COVID-19 is impacting design and development.
Some of the solutions people are using to work remotely.
How software-driven design will foment additional development.
The tools required to perform work vary from company to company and industry to industry, but the common-need denominators include the ability to communicate with team members, schedule and manage event timelines, and share data and documents. These needs are often dealt with using separate software-based solutions, but a growing number of all-in-one collaboration suites are emerging.
Designing the Future
Not surprisingly, this growth in the market for collaborative tools of all kinds—societal and commercial—and the infrastructures needed for them is reflected in the design projects of our audience. When we asked them what best describes your current design project, 14.81% replied with communications systems and equipment, such as local-area/wide-area networking products, wireless, cellular, RF and microwave, Bluetooth, etc.
Another big area of interest was in industrial control systems and equipment (including robotics) at 9.88%, reflecting the impact of smart systems on manufacturing (Industry 4.0). This area of industry will eventually meld with the aforementioned collaborative development tools, further enabling real-time manufacturing oversight and management, and on-the-fly redesign and custom work.
Looking Forward
The impact of COVID-19 may have accelerated the adoption of collaborative design tools, but the functionality they provide, and the cascading benefits offered, would have made the transition to their use inevitable. The latest generation of hardware and software solutions for engineering design and development is only beginning to mature, and the best in many ways is yet to come as these tools more deeply integrate into the engineering community.
Tomi Engdahl says:
Check out the new Cloud Scheduler function in your Arduino Cloud, which lets you set up automated events by time, date, frequency and duration.
https://blog.arduino.cc/2021/12/23/arduino-iot-cloud-scheduler-brings-enhanced-automation-to-your-projects/
Tomi Engdahl says:
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.”
Tomi Engdahl says:
https://www.edn.com/deploying-board-resource-depot-for-ic-firms-with-global-operations/
Tomi Engdahl says:
The Past Predicting The Future
https://semiengineering.com/the-past-predicting-the-future/
A look back at the most popular categories and articles published in ‘Systems and Design’ and ‘Low Power-High Performance’ during 2021.
It is often said that you cannot predict the future by looking at the past, but that isn’t always correct. There are many clues provided by digging into change. Those changes are a prelude to what may happen in the future. One way we can do that here at Semiconductor Engineering is by looking at changes in reading habits. What types of articles are attracting the most attention? This is a sure indication that these are the topics that are impacting the work that readers are doing today, that will lead to products in the future. Also, just as interesting are topic areas that are seeing less readership than in the past.
Declining interest
Let’s start with the topics that have dropped. It is a surprising list that includes RISC-V, power optimization, verification, and open source. My guess is that these are going through a consolidation phase after being very hot topics for the past few years.
Having said that, one article on RISC-V saw the fourth-highest readership numbers, High-Level Synthesis For RISC-V. It is the extensibility of RISC-V that is driving a lot of design activity.
Tomi Engdahl says:
Always-On DSPs
https://semiengineering.com/always-on-dsps/?cmid=ad509544-4526-461f-880c-df987090ddef
The best ways to deploy digital signal processors and why multiple DSPs are better than one.
There are tradeoffs between powering circuits down to save power and waking them up to respond to voice and visual commands. Prakash Madhvapathy, director of product marketing and product management at Cadence, talks about the best ways to deploy digital signal processors, why multiple DSPs are often better than just one, and what penalties there are for various approaches.
Tomi Engdahl says:
https://embeddeddesignblog.blogspot.com/2021/12/designing-current-sensor-with-ina180.html
Tomi Engdahl says:
Python vs C/C++ vs Assembly side-by-side comparison
https://www.youtube.com/watch?v=3PcIJKd1PKU
a test of the relative performance, not the prime-checking algorithm
Tomi Engdahl says:
https://www.hackster.io/news/adafruit-is-adding-floppy-disk-support-to-circuitpython-b1e3596213d7
Tomi Engdahl says:
https://www.confluent.io/designing-event-driven-systems/
Tomi Engdahl says:
https://techatronic.com/raspberry-pi-gpio-configure-led/
Tomi Engdahl says:
Software Engineering and everything related – Software and Project as systems
https://dev.solita.fi/2021/10/15/software-and-projects-as-systems.html
Tomi Engdahl says:
Testing Power Rail Sequences in Complex Embedded Systems
https://blog.teledynelecroy.com/2021/08/testing-power-rail-sequences-in-complex.html?utm_source=electronic-design&utm_medium=ai-ads&utm_content=power-integrity&utm_campaign=2021-electronic-Design-ai-ads-power-integrity
Embedded computing systems generally require multiple supply voltages to deliver power to the microprocessor, memory and other on-board devices. There is usually a 12- or 15-volt DC primary supply, and numerous buck or boost converters working off the primary to help provide various voltages throughout the embedded system. Most microcontrollers have a prescribed order in which the voltages must be applied to prevent problems like lockups, so an area of concern when designing deeply embedded systems is the proper sequencing of power rails as they power up or down. Power management IC’s (PMIC) or power sequencers perform many of the sequencing tasks, but during validation and when troubleshooting, the order and timing of the power sequence should be verified.
Tomi Engdahl says:
Blink An LED On A PIC32 With Rust, Easily
https://hackaday.com/2022/01/09/blink-an-led-on-a-pic32-with-rust-easily/
Got a PIC32 microcontroller and a healthy curiousity about the Rust programming language and its low-level capabilities, but unsure how to squash the two of them together with a minimum of hassle? If that’s the case, then today is your lucky day!
[Harry Gill] has you covered with his primer on programming a PIC32 with Rust, which will have you blinking an LED in no time.
https://gill.net.in/posts/pic32-blink-led-rust/
Tomi Engdahl says:
https://etn.fi/index.php/13-news/13033-qt-toimii-mikro-ohjaimilla-entistae-paremmin
Tomi Engdahl says:
The ProtoESP Will Take Your Next Embedded Project From an Idea to Reality In a Snap!
Arsenijs’ ProtoESP lets you work up a new project concept in a snap.
https://www.hackster.io/news/the-protoesp-will-take-your-next-embedded-project-from-an-idea-to-reality-in-a-snap-3cc6771b0710
Tomi Engdahl says:
https://hackaday.com/2022/01/15/serial-studio-one-year-on/
Tomi Engdahl says:
Is Programmable Overhead Worth The Cost?
How much do we pay for a system to be programmable? It depends upon who you ask.
https://semiengineering.com/is-programmable-overhead-worth-the-cost/?cmid=d37ae274-d1bd-4bd9-9fb6-4ed063c60f61
Programmability has fueled the growth of most semiconductor products, but how much does it actually cost? And is that cost worth it?
The answer is more complicated than a simple efficiency formula. It can vary by application, by maturity of technology in a particular market, and in the context of much larger systems. What’s considered important for one design may be very different for another.
In his 2021 DAC keynote, Bill Dally, chief scientist and senior VP of research at Nvidia, compared some of the processors his company has developed with custom accelerators for AI. “The overhead of fetching and decoding, all the overhead of programming, of having a programmable engine, is on the order of 10% to 20% — small enough that there’s really no gain to a specialized accelerator. You get at best 20% more performance and lose all the advantages and flexibility that you get by having a programmable engine,” he said.
Many-processor architectures are being driven by the software intended to run on them. “Not that long ago, people were designing hardware and didn’t know what software to put on it,” says Simon Davidmann, CEO of Imperas Software. “Today, people are trying to work out the best hardware to run applications most efficiently. What’s happening is that the software is driving the functionality in the hardware. Products need better software, which is more efficient, and that is driving the hardware architectures.”
Tomi Engdahl says:
https://www.uusiteknologia.fi/2022/01/18/tee-rahaa-sulautetun-laitteesi-kayttoliittymilla/
Ohjelmistotyökaluja markkinoiva QT tuo asiakkailleen uuden Digital Advertising -ratkaisun, jonka avulla kehittäjät voivat hyödyntää mobiili- ja työpöytäympäristöissä toimivia sovelluksiaan sekä sulautettuja laitteita uudenlaisina tulonlähteinä.
Tomi Engdahl says:
The ProtoESP Will Take Your Next Embedded Project From Idea to Reality In a Snap!
Arsenijs’ ProtoESP lets you work up a new project concept in a snap.
https://www.hackster.io/news/the-protoesp-will-take-your-next-embedded-project-from-idea-to-reality-in-a-snap-3cc6771b0710