Skip to content

Instantly share code, notes, and snippets.

View vanbwodonk's full-sized avatar

Arif Darmawan vanbwodonk

  • Surabaya, Indonesia
View GitHub Profile
@vanbwodonk
vanbwodonk / read-stm32-firmware.md
Last active November 2, 2024 19:05
Read stm32 firmware binary with openOCD

read-stm32-firmware

OpenOCD scripts for read STM32 firmware binary

Requirements

Linux

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with a hardware debugger's JTAG port. OpenOCD provides debugging and in-system programming for embedded target devices. OpenOCD provides the ability to flash NAND and NOR FLASH memory devices that are attached to the processor on the target system. Flash programming is supported for external CFI compatible flashes (Intel and AMD/Spansion command set) and several internal flashes (LPC2000, AT91SAM7, STR7x, STR9x, LM3 and STM32x).

OpenOCD was originally developed by Dominic Rath at the University of Applied Sciences Augsburg. The OpenOCD source code is now available through the GNU General Public License (GPL).

Using pioasm in platformio projects

Here is somethig you might find useful: automatic pio assembly -> h file generation for platformio.
I have tested it on Linux only.

This is the state as of Nov 2022. The arduino core for RP2040 will most likely change in the future and make this method obsolete.

Step 1:

Contrary to the docs, stating the pioasm is installed together with the dev platform:
https://registry.platformio.org/tools/earlephilhower/tool-pioasm-rp2040-earlephilhower/installation
the json file
https://github.com/maxgerhardt/platform-raspberrypi/blob/develop/platform.json