Close

Backing up the flash

A project log for Amazon Dash and other STM32 ARM Adventures

Got STM32?

georgeGeorge 02/26/2016 at 00:500 Comments

Time to back up the flash. I was trying to use st-flash, OpenOCD, pystlink, and st-util+gdb to get a good dump of the flash memory in case I wanted to go back and play with Amazon's software. The dumps were packed with nil-bytes, so there's probably some read protection going on.

OpenOCD's manual has a nice command for unlocking the flash :

stm32f2 unlock 0

This generates a buttload of output:

Debug: 19140 55145 target.c:2226 target_read_u32(): address: 0x40023c0c, value: 0x00010000
Debug: 19141 55145 stm32f2x.c:219 stm32x_wait_status_busy(): status: 0x10000
Debug: 19142 55146 hla_target.c:752 adapter_read_memory(): adapter_read_memory 0x40023c0c 4 1
Debug: 19143 55148 target.c:2226 target_read_u32(): address: 0x40023c0c, value: 0x00010000
Debug: 19144 55148 stm32f2x.c:219 stm32x_wait_status_busy(): status: 0x10000
Debug: 19145 55149 hla_target.c:752 adapter_read_memory(): adapter_read_memory 0x40023c0c 4 1
Debug: 19146 55150 target.c:2226 target_read_u32(): address: 0x40023c0c, value: 0x00010000
Debug: 19147 55150 stm32f2x.c:219 stm32x_wait_status_busy(): status: 0x10000
Debug: 19148 55151 hla_target.c:752 adapter_read_memory(): adapter_read_memory 0x40023c0c 4 1
Debug: 19149 55152 target.c:2226 target_read_u32(): address: 0x40023c0c, value: 0x00010000
Debug: 19150 55152 stm32f2x.c:219 stm32x_wait_status_busy(): status: 0x10000
Debug: 19151 55153 hla_target.c:752 adapter_read_memory(): adapter_read_memory 0x40023c0c 4 1
Debug: 19152 55154 target.c:2226 target_read_u32(): address: 0x40023c0c, value: 0x00010000
Debug: 19153 55154 stm32f2x.c:219 stm32x_wait_status_busy(): status: 0x10000

.. and then I was left with an empty flash that's perfectly dump-able without error. Doh.

Discussions