/ Unbricking: Last updated 2022-02-08 09:34:50 by Conrad Wood

Unbricking


With “Unbricking” we mean the process of flashing software on to the Catty Module if no software whatsoever is installed on the module. This is a rare occasion and requires a high degree of experience. In most cases Catty Modules can be flashed with new software via its USB-C port. See more details about the process of flashing via USB-C here: stage2

If a Catty Module does not start at all, it can be unbricked via JTAG. This requires special hardware, namely a JTAG programmer and its corresponding software. We use the STLink/V2 from STM32. Available, for example here: https://uk.farnell.com/stmicroelectronics/st-link-v2/icd-programmer-for-stm8-stm32/dp/1892523?st=jtag%20stlink

Connect the programmer to the JTAG connector on-board.

We use openocd (version 0.10.0). You will need to flash 3 files to the module:

  1. Stage1 loader (more info: stage1)
  2. Stage2 loader (more info: stage2)
  3. Application (more info: scapplication)

Loaders

Download the stage1 and stage2 loaders from here: https://www.singingcat.net/artefacts/artefactid/84/version/latest/dist

You will need the .bin files (stage1.bin and stage2.bin).

  1. Flash stage1.bin to address 0x08000000. (more info: https://openocd.org/)
  2. Flash stage2.bin to address 0x08001000. (more info: https://openocd.org/)

Application

You need to download the scapplication from here:

https://www.singingcat.net/artefacts/artefactid/82/version/latest/dist/firmware

Download main1.bin.

Flash main1.bin to address 0x08009000.

That’s it. Your module should start again.

Note: if your module is completely wiped clean, you may need to set its nodeid again. To do so, use a terminal program and issue “newnodeid [nodeid]” on the command line.