Searched the archives and didn't see any mention of this not being supported. And doing so appears to be supported as documented in ST's AN3155 App note. I first tried the canned Ubuntu binary version 0.5, no dice. Then pulled the git repo to build version 0.7, same result. No screening of address was apparent in a quick check of the source for a read command and further suggests the device (STM32F103C8 -- likely a clone) is returning an error from stm32_read_memory(). Before pursuing this further I figured I'd ask if this is a known issue without a resolution. Reads of flash and internal bootrom work fine but attempts to access the SRAM fail. Any clarity much appreciated.
On Tue, Apr 30, 2024 at 4:43 AM osmocom@third-harmonic.com wrote:
Searched the archives and didn't see any mention of this not being supported. And doing so appears to be supported as documented in ST's AN3155 App note. I first tried the canned Ubuntu binary version 0.5, no dice. Then pulled the git repo to build version 0.7, same result. No screening of address was apparent in a quick check of the source for a read command and further suggests the device (STM32F103C8 -- likely a clone) is returning an error from stm32_read_memory(). Before pursuing this further I figured I'd ask if this is a known issue without a resolution. Reads of flash and internal bootrom work fine but attempts to access the SRAM fail. Any clarity much appreciated.
On Tue, Apr 30, 2024 at 4:43 AM osmocom@third-harmonic.com wrote:
Reads of flash and internal bootrom work fine but attempts to access the
SRAM fail. Any clarity much appreciated.
The bootloader reserves some SRAM for its own operation, and disallows access to this area. Reading out the rest of the SRAM shouldn't be a problem.
For example: $ stm32flash -S 0x20000200 /dev/ttyUSB0 -r /tmp/sramout stm32flash 0.7
http://stm32flash.sourceforge.net/
Interface serial_posix: 57600 8E1 Version : 0x22 Option 1 : 0x00 Option 2 : 0x00 Device ID : 0x0410 (STM32F10xxx Medium-density) - RAM : Up to 20KiB (512b reserved by bootloader) - Flash : Up to 128KiB (size first sector: 4x1024) - Option bytes : 16b - System memory : 2KiB Memory read Read address 0x20005000 (100.00%) Done.
You are correct. I was aware on-die bootloader claimed 512 bytes of SRAM but didn't even consider it would block read access. I suppose that's just a concession to implementation simplicity as except for test probing as was the case here, doing so isn't really useful. Thanks!