It is the exam and grading time at the university, and the same time I’m preparing the lectures and labs for the new semester starting mid of February. I’m always heading for using the latest and greatest tools in my labs. A few days ago, NXP released the new version of the MCUXpresso IDE, version 11.7.0. Time to check it out…
The year 2022 is coming to an end, and I have spent some time today on a little side project. It is about making an Electrical Vehicle (EV) wallbox charger accessible over Modbus RTU. It is not finished yet, and I plan to publish more articles on it, but I can share that I’m able to access and control the Heidelberg EV charger with a Raspberry Pi Pico W (Dual Core Cortex M0+), NXP K22FN512 (Cortex M4F) and LPC845 (Single Core Cortex M0+):
One little nasty assertion in the GNU standard library appeared a few days ago, kind out of nowhere, reporting “REENT malloc succeeded”:
Obviously it was caused by the call to srand() which sets the ‘seed’ for the standard library (pseudo) random number generator. The assertion happens as well later for calling the rand() function.
The RP2040 Pico board comes with 2 MByte onboard FLASH memory. While this is plenty of space for many embedded applications, sometimes it needed to have more storage space. Having the ability to adding an extra SPI FLASH memory with a useful file system comes in handy in such situations. This makes the RP2040 ideal for data logger applications or otherwise store a large amount of data. In this article I’ll show you how to add an extra 16 MByte of memory to the Raspberry Pi Pico board, running FreeRTOS, a command line shell and using LittleFS as the file system.
It is already December 1st, and time for a new Advent Calendar. This year the design includes birch plywood with PMMA, SK6812 RGBW LEDs running with a Raspberry Pi Pico board, building a small village.
With the war in the Ukraine, energy prices in Europe reached new record levels. This initially affected the gas price which does not affect me directly. But it had a big impact on the price for electrical energy too. In my village, the price for electrical energy is now at 0.45 CHF/kWh, starting October 1st 2022. It is twice as much as what it used to be, and three times more what it used to be the price for the energy at night time.
Saving energy always makes a lot of sense, now even more, both for the environment and directly saving money. Luckily, I started thinking about optimizing the electrical energy used in my house back in 2021, and now in 2022 it really pays off: The daily average of 16 kWh/day (including heating and cooling) came down to 7 kWh/day, or from 4.5 MWh/year down to 2.4 MWh/year, or a reduction of 47%.
There were different areas contributing to this very positive result:
The above graph shows the changes in the different categories, from 2021 (blue, 4.5 MWh) to 2022 (orange, 2.4 MWh).
Sometimes it can be a challenge to update or add plugins to older software or Eclipse versions. The ‘CodeWarrior for MCU’ from NXP is legacy and replaced by the newer MCUXpresso IDE and tools, but I continue to use CodeWarrior for our older projects, and it still works fine after all the years and Windows host updates. However, trying to install from the standard eGit Update site fails:
In many embedded applications, it is mandatory that memory allocation is static and not dynamic. Means that no calls to things like malloc() or free() shall be used in the application, because they might fail at runtime (out of memory, heap fragmentation).
But when linking with 3rd party libraries or even with the C/C++ standard libraries, how to ensure no dynamic memory is used? The problem can occur as well for C++ objects, or a simple call to printf() which internally requires some dynamic memory allocated.
A typical debugging session involves just one ELF/Dwarf binary or executable. But what if I need to program multiple binary files with gdb? Things like loading both the bootloader and the application binary? Or I have a an on-chip file system or data section I need to program?
In this article I show how I can use gdb to load and program extra data, like a binary (.bin) file, both using command line interface and using an IDE.