Workaround for FreeRTOS Runtime Counter Issues in VS Code

FreeRTOS has a great performance measurement feature built-in: Performance counters. At each context switch, the RTOS can do a bookkeeping of time spent in tasks. With this, it can estimate the runtime distribution between the tasks. A very useful feature to get a feeling what the tasks are doing.

But I noticed that with recent FreeRTOS versions, VS Code extension have issues showing the correct runtime counter values:

Unknown Runtime Counters in VS Code Extension (mcu-debug.rtos-views)
Unknown Runtime Counters in VS Code Extension (mcu-debug.rtos-views)
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