Debugging Bootloader and Application with one Debug Session

If having a boot loader running on a micro-controller, it is very useful if both the boot loader and the loaded application can be debugged together:

Bootloader with Application Code

Bootloader with Application Code

Continue reading

Linking Bootloader Applications with Eclipse and FreeMarker Scripts

Bootloaders are a fine thing: With this I can load any applications I like. Power comes with some complexity, and a bootloader alone is a complex thing already. But this applies to the application part too: I need to link the application to a certain offset in the memory space so it can be loaded by the bootloader, plus the application typically needs to add some extra information to be used by the bootloader. This article describes how to build a bootloader application with Eclipse (MCUXpresso IDE) using the MCUXpresso SDK.

Build Configuration for Bootloader Application

Continue reading

Tutorial: Booting the NXP i.MX RT from Micro SD Card

It is a common thing to boot a Linux system (see the Raspberry Pi) from a micro SD card. It is not that common for a microcontroller. The NXP i.MX RT ARM Cortex-M7 fills that gap between these two worlds. No surprise that it features a ROM bootloader which can boot from a micro SD card.

SD Card with i.MX RT1052

SD Card with i.MX RT1052

Continue reading

Regaining Debug Access to NXP i.MX RT1064-EVK executing WFI

Working with low power modes can be challenging. It can severely affect debugging capabilities of a microprocessor or microcontroller. I ported a FreeRTOS application using the Tickless Idle Mode to the NXP i.MX RT1064 board, and all of a sudden, the board was unresponsive to any debugger connection. Luckily the board was not really bricked, but it took me while to find a way to recover it. So for when you end up in a situation with a ‘bricked’ i.MX RT1064 board, this article might be helpful for you to recover it.

i.MX RT1064-EVK Board

i.MX RT1064-EVK Board

Continue reading

Flash-Resident USB-HID Bootloader with the NXP Kinetis K22 Microcontroller

The tinyK22 board (see “tinyK22 Boards arrived“) gets rolled out at the Lucerne University of Applied Sciences and Arts, so I thought I write-up an article this weekend how to use that board with a Flash Resident Bootloader.

tinyK22 with USB HID Bootloader

tinyK22 with USB HID Bootloader

Continue reading

Adding a Delay to the ARM DAPLink Bootloader

The ARM mbed USB MSD bootloader which is used on many silicon vendor boards has a big problem: it is vulnerable to operating systems like Windows 10 which can brick your board (see “Bricking and Recovering OpenSDA Boards in Windows 8 and 10“). To recover the board, typically a JTAG/SWD programmer has to be used. I have described in articles (see links section) how to recover from that situation, including using an inofficial new bootloader which (mostly) solves the problem. The good news is that ARM (mbed) has released an official and fixed bootloader. The bad news is that this bootloader does not work on every board because of a timing issue: the bootloader mostly enters bootloader mode instated executing the application.

DAPLink in Bootloader Mode

DAPLink in Bootloader Mode

Continue reading

Recovering and Updating the NXP OpenSDA Bootloader with P&E Multilink and MCUXpresso IDE

Many of the NXP OpenSDA boot loaders are vulnerable to Windows 8.x or Windows 10: write accesses of Windows can confuse the factory bootloader and make the debug firmware and bootloader useless. In this post I show how to recover the bootloader using MCUXpresso IDE and the P&E Universal Multilink.

Using P&E Multilink Universal to restore the OpenSDA Bootloader on NXP FRDM-K22F Board

Using P&E Multilink Universal to restore the OpenSDA Bootloader on NXP FRDM-K22F Board

Continue reading

Reprogramming the Mikroelektronika Hexiwear Dockingstation

The Hexiwear docking station would have a nice feature: it has embedded a debug circuit (OpenSDA). That way I would not need an external debug probe to debug the Hexiwear. However, a debug probe is required to reprogram the docking station itself:

Repgrogramming the Mikroelektronika Docking Station

Repgrogramming the Mikroelektronika Docking Station

Continue reading

Merging S19 Files

If using a bootloader with an application, one thing is to to merge the bootloader with the application into a single file. I do this with the ‘SRecord’ tool like this:

srec_cat bootloader.s19 application.s19 -o merged.s19
Combining S19 Files

Combining S19 Files

Continue reading