Powering up a new board design or even skiing off-piste with an eval board without vendor-suppled code? This post shows a way to look for first signs of life without depending on working debug toolchain or working target software.
I use a Segger JTAG probe that I covered in a previous post.
Some recent eval boards like the one for Nordic Micro’s nRF51822 ship with an on-board USB debug connection that has a USB-JTAG decoder chip on board. This board uses the same Segger driver as their JTAG box embedded in the decoder, so the below approach should also work.
Segger JLINK application driver has a series of useful commands for examining directly addresses in memory:
- mem Read memory. Syntax: mem , (hex)
- mem8 Read 8-bit items. Syntax: mem8 , (hex)
- mem16 Read 16-bit items. Syntax: mem16 , (hex)
- mem32 Read 32-bit items. Syntax: mem32 , (hex)
Since many MCUs have a factory-programmed ID register, you can use JTAG to read this value and check for signs of life.
To start with, I target a STM32F100C8. This MCU has a register at 1FFFF7E0 hex containing a 16-bit value with the flash size of the MCU. This is covered in the STM32F100 programming manual on page 668.
Launch the Segger JLinkExe application (I am using Mac OSX version). The terminal welcome screen should look something like the below. I removed my Segger serial number. I use the mem16 command to get the 16bit value starting at 1FFFF7E0 hex:
(My entries in red). Notice how the JTAG box finds the STM device automatically over SWD.
The resulting value 40 hex corresponds to 64 decimal i.e. 64KB flash on-board. So, device and board are alive and breathing.
On the Nordic nRF51822, there is an ID register called CONFIGID at 1000005C hex. Bits 0-15 contain a hardware config code. The decoder ring for the value you get back is buried in Nordic’s white paper “Migrating to the latest nRF51822 chip version nWP-018″ which currently is here
The 4C00 hex code from my device shows I have a QF AB build code B0 version of nRF51822 which corresponds to the QFN packaged 128KB flash variant.