My usual workflow is: edit – build – debug and repeat. And this for the same project again and again. So here are a few tips how to make these iterations faster with Eclipse. One thing is to use the F11 shortcut to debug the last launched/debugged application:
The McuOnEclipse GitHub repository hosts many Processor Expert projects and is very popular (cloned more than 1000 times, thank you!). Processor Expert is a powerful framework which generates driver and configuration code, simplifying application development for a wide range of microcontroller and families. But Processor Expert won’t be developed further by NXP and is not part of MCUXpresso IDE. While it is possible to install Processor Expert into MCUXpresso IDE 10.2, how can these projects used ini an IDE *without* Processor Expert? This article describes how to port an existing Processor Expert project into the NXP MCUXpresso IDE.
By default, the NXP S32K144EVB and microcontroller is using a 5V supply voltage and logic levels which is great for noisy environment or any 5V devices. Many of my displays and sensors use 3.3V logic levels, so I would have to use a level shifter from 5V to 3.3V. There is another way: to change the board for 3.3V logic levels so I can use directly things like a SSD1306 display.
In “Tutorial: FreeRTOS 10.0.1 with NXP S32 Design Studio 2018.R1” I showed how to use a custom FreeRTOS with the S32 Design Studio (ARM). The OSIF (OS Interface) provides an operating system and services abstraction for the application which is used by other S32K SDK components:
“There is no ‘S’ for Security in IoT” has indeed some truth. With all the connected devices around us, security of code should be a concern for every developer. “Preventing Reverse Engineering: Enabling Flash Security” shows how to prevent external read-out of critical code from device. What some microcontroller have built in is yet another feature: ‘Execute-Only-Sections‘ or ‘Execute-Only-Memory‘. What it means is that only instruction fetches are allowed in this area. No read access at all. Similar like ‘read-only’ ‘execute-only’ it means that code can be executed there, but no other access from that memory is allowed.
In this article I describe the challenges for a toolchain like the GNU gcc, and how to compile and link code for such an execute-only memory.
In many cases it is very useful to see the generated assembly code produced by the compiler. One obvious way to see the assembly code is to use the Disassembly view in Eclipse:
But this requires a debug session. An easier way is to use command line options to generate the listing file(s).
NXP not only sells general purpose microcontroller, but as well a portfolio of automotive devices which includes the S32K which is ARM Cortex based. For this device family, they offer the S32 Design Studio (or S32DS) with its own Eclipse distribution and SDK. The interesting part is that the S32DS includes Processor Expert (which is a bit different from the ‘mainstream’ Processor Expert). It comes with its own components for the S32K SDK which includes a component for FreeRTOS. But that component in S32DS 2018.R1 comes with an old V8.2.1 FreeRTOS component:
So what to do if I want to use the latest FreeRTOS (currently 10.0.1) with all the bells and whistles?
I recently discovered a nice feature in Eclipse CDT: the ability to show the return value of a function:
By default, the GNU compiler (gcc) optimizes each compilation unit (source file) separately. This is effective, but misses the opportunity to optimize across compilation units. Here is where the Link Time Optimization (LTO, option -flto) can help out: with a global view it can optimize one step further.
The other positive side effect is that the linker can flag possible issues like the one below which are not visible to the compiler alone:
type of '__SP_INIT' does not match original declaration [enabled by default]
Hardware Timers are essential to most embedded applications: I use them mostly for triggering actions at a given frequency, such as acquiring data from a sensor. With using an RTOS I can do a similar thing using a task: the task will run with a given frequency and I can periodic work in it. However, using a task might be too much overhead doing this. The good news is that there is a much more efficient way to do this in FreeRTOS with Software Timers. And this is what this tutorial is about: how to use Software Timers with FreeRTOS.
Decisions, decisions! Such long weekends like Pentecost are a real challenge for a family with engineers:
- Should we join that record long traffic jam to Italy and be stuck for more than 4 hours and analyze it?
- Or: should we stay home, turn the BBQ smoker engine on fire, load it with baby back pork rib racks for a slow-and-low smoke treatment, while doing some on-the-side IDE and technology exploration?
Well, my family vote was kind of clear: they have chosen that second option. Not to mention that hidden technology piece in it, but that was part of the deal ;-).
And I’m sorry: this article is not about BBQ (for this see “Smoking BBQ Baby Back Ribs – Swiss Style“), it is about technology: I’m using the NXP MCUXpresso IDE and tools for many of my projects (see “Eclipse MCUXpresso IDE 10.1 with integrated MCUXpresso Configuration Tools“). Right before the this extended weekend, NXP has released the new v10.2.0 version, so here is where that technology exploration piece comes into play. Checking the release notes, this version number change includes so many cool stuff I decided to have a look and to check it out. Of course always having an electronic eye on the baby back ribs!
I apologize: I have not been blogging much in the past weeks :-(. One reason is that I’m working on a DIY SMT/SMD Pick&Place machine which keeps me busy most of my spare time :-). I admit that this project is not finished yet, but now is the time I can give a sneak preview: a SMD/SMT pick and place machine:
I’m very happy with my 50W Laser Cutter (see “Getting Control over a 50 Watt CO2 Laser Cutter from China“). My main decision factors were (and still are): Software, software, tools and again software, and down in the list finally the hardware. Same thing for that laser cutter. After several upgrades (see “50W Laser Cutter Upgrades“), it was time replace the stock controller hardware with a new one including LCD display:
The map file produced by the GNU linker includes lots of information, however it is very cryptic to read. In “Listing Code and Data Size for each Source File with GNU and Eclipse” I showed how the GNU size utility can be used to report the code and data size for each object file. The Eclipse based MCUXpresso IDE comes with another nice view which shows detailed information about code and data allocation:
If you follow me on Twitter, then you are aware that I’m working on a larger project building an SMT pick and place machine :-). The fun with this project is that it includes electronics, mechanics and all kind of 3D printing and laser cutting. That machine picks SMD components and places them on a PCB. One sub-project is to build a SMD cut tape holder:
I’m dealing a lot with bootloaders recently (see “Flash-Resident USB-HID Bootloader with the NXP Kinetis K22 Microcontroller“), and bootloaders are sometimes very picky about what file format they are able to consume. So what if I have a binary (see “S-Record, Intel Hex and Binary Files“) file and I need to convert it into the Intel Hex format?
In “Flash-Resident USB-HID Bootloader with the NXP Kinetis K22 Microcontroller” I presented how I’m using the tinyK22 (or FRDM-K22F) with a flash resident USB HID bootloader. To make sure that the loaded application is not corrupted somehow, it is important to verify it with a Cyclic redundancy Checksum (CRC). The NXP KBOOT Bootloader can verify such a CRC, but how to generate one and how to use it is not really obvious (at least to me), so this article explains how to generate that CRC.