STM32F103VCT6 more RAM+Flash than datasheet says?
Hi,
today I stumbled across a problem, where I wanted to assign around 50k of RAM to FreeRTOS and I immediately got a linker error, because target ran out of RAM.
I had a look at the datasheet and this says 48k RAM. I've been using a self-hacked-together linkerscript for very long now, that has 64k set.
For a long time now I was thinking it has 64k, because my flash programming utilities report it every time I program this chip.
I am using a ST-LinkV2, host-OS is linux and I use texane's stlink utility. I also tried with stm32flash and stm32loader.py.
This is what they report:
st-info from texane's st-link utility reports 64k RAM, 256k flash
$ st-info --probe
Found 1 stlink programmers
serial: 513f6f06503f55493945093f
openocd: "\x51\x3f\x6f\x06\x50\x3f\x55\x49\x39\x45\x09\x3f"
flash: 262144 (pagesize: 2048)
sram: 65536
chipid: 0x0414
descr: F1 High-density devicestm32flash reports 64k RAM and 512k FLASH:
$ stm32flash /dev/ttyUSB0
stm32flash 0.5
http://stm32flash.sourceforge.net/
Interface serial_posix: 57600 8E1
Version : 0x22
Option 1 : 0x00
Option 2 : 0x00
Device ID : 0x0414 (STM32F10xxx High-density)
- RAM : 64KiB (512b reserved by bootloader)
- Flash : 512KiB (size first sector: 2x2048)
- Option RAM : 16b
- System RAM : 2KiBstm32loader.py does not report sizes:
$ sudo ./stm32loader.py -V -p /dev/ttyUSB0
Open port /dev/ttyUSB0, baud 115200
*** Get command
Bootloader version: 0x22
Available commands: 0x0, 0x1, 0x2, 0x11, 0x21, 0x31, 0x43, 0x63, 0x73, 0x82, 0x92
Bootloader version 22
*** GetID command
Chip id: 0x414 (STM32 High-density)Is this a false report? I assume the serial bootloader (in case of stm32flash) reports the memory sizes to the tool. Also I assume ST wouldn't program wrong memory sizes to the bootloader. Does this mean my device has 64k/512k?
Does the internal bootloader scan flash for availability or does it work with pre-programmed flash/ram-size values?
How does the ST-LinkV2 (swdio/swdclk connection) work? It detects 256k flash (as this device is supposed to have), but it detects 64k RAM (16k more than supposed).
How would I test for this? Writing an application, that writes and reads back RAM above 48k and same for the flash?
I already heard about the 128k STM32F103C8T6 (blue pills etc) that have 128k flash. Maybe it is the same with these..,
Thanks in advance,
Doss
