Upgrade from STM32F103RC to STM32F103RE - Page 1
Forum section: electronics / general

author: Zucca
author_rank: Unknown
timestamp: September 12, 2021, 01:42:49 am
content: This is my boardOn my board the µC is aSTM32F103RCLot of discussion on the internet that a STM32F103RC can be open up to 512KB.I just compiled the last stable Marlin 2.0.9.1 with this Platformio env:Code:src_dir = Marlinboards_dir = buildroot/share/PlatformIO/boardsdefault_envs = STM32F103RE_btt_mapleinclude_dir = Marlinextra_configs =ini/avr.iniini/due.iniini/esp32.iniini/features.iniini/lpc176x.iniini/native.iniini/samd51.iniini/stm32-common.iniini/stm32f0.iniini/stm32f1-maple.iniini/stm32f1.iniini/stm32f4.iniini/stm32f7.iniini/stm32h7.iniini/teensy.iniand everything works perfectly. I have to admit my firmware build is still below the 256KB limit.I am sure the STM32F103RC has a flash memory of 512KB on the die, the problem it is not specified by ST.Usually it is common to have only one part in production, and then assign a different name depending on the quality check results.I imagine if a STM32F103R passes the 512KB flash test then it becomes a STM32F103RE, if only the 256KB flash test then STM32F103RC.So if your firmware is >256KB in a STM32F103RC, and it acts funny we know why now.It is like playing the lottery: hit or miss.Am I right with my assumption?Second, the cost of a STM32F103RE is not prohibitive. I have the soldering equipment required to swap the STM32F103RC with a STM32F103RE.I have also the firmware from Platformio, what I do not have is the ability to flash the proper bootloader to a virgin STM32F103RE.In other words what µC tools I need to up upgrade a board from the STM32F103RC to STM32F103RE?Many thanks and sorry in advance if the questions are too stupid...

author: Kean
author_rank: Unknown
timestamp: September 12, 2021, 03:05:02 am
content: What I would do is create a few 265kB and 512kB test files, e.g. all 0x00, all 0x55, all 0xAA, all 0xFF, and most importantly random data, etc. Then use an STLink or similar programmer to write and verify the test files to flash, and see if and where it errors out. The random data verification should indicate the memory size. The other simple patterns would help detect stuck/faulty bits.You could also try various counting or walking bit patterns, but they would have to be unique between the memory boundaries you want to test across to prove your goal. Random data just seems like an easier and quicker way to acheive that.

author: Kjelt
author_rank: Super Contributor
timestamp: September 12, 2021, 08:45:14 am
content: I had this discussion over ten years ago with ST about the STM8.They then confirmed it was the same die/chip for 16kB/32kB and 64kB but what they did is test each chip before it is cut out of the wafer and this test determined the correct chips. The chip was correct or not.The incorrect chips no matter what the fault was are left on the wafer and never used.Then after bonding packaging and before laserlabelling they flash otp fuses for chip type on the correct chips.So it is afaik not that error on flash on higher region will be made to an smaller flash chip, it is post fusing the chip. If the older stm32f103 did not have that then you can try it and see if it works. Provided the used programming device ignores the chip id. It would surprise me that if it works, any part of the flash would not be ok, since then it would mean they changed strategies.

author: Zucca
author_rank: Unknown
timestamp: September 12, 2021, 01:44:02 pm
content: Quote from: Kjelt on September 12, 2021, 08:45:14 amAFAIK For most 3D printer user the programming device is just a micro SD with a "firmware.bin" on it. It does not check the chip id as any normal professional device.The FW upgrade process is in the bootloader, if the bootloader sees a firmware.bin in the SW then it grabs it and flash it.Anyway, the ST-link it cheap and maybe worth a shot. Maybe a Segger J link even better money invested.Doing my homeworks...

author: Zucca
author_rank: Unknown
timestamp: September 12, 2021, 02:52:34 pm
content: Board schematics herenot sure how to connectthis

author: Kjelt
author_rank: Super Contributor
timestamp: September 12, 2021, 08:52:08 pm
content: Just use the swdebug port with swim protocol.Clk, dio, gnd and reset is all you need if you power the targetboard yourself.

author: Kean
author_rank: Unknown
timestamp: September 12, 2021, 10:03:30 pm
content: There is diagnostics code for testing the flash size on the C8 chip common on Blue Pill boardshttps://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-diagnostics-v1.6.html#diags-1-6So 64k vs 128k. I guess it could be tweaked for the RC, and made into a firmware.bin recognized by the boot loader and show a yea/nay message on the display.

author: Zucca
author_rank: Unknown
timestamp: September 13, 2021, 12:04:24 am
content: thanks guys.This is all I need. I will continue to use the STM32F103RC as long it works as a STM32F103RE.If something funny happens now I know what to do. I will report back in case it happens.

author: bingo600
author_rank: Super Contributor
timestamp: September 13, 2021, 05:32:24 pm
content: Don't get bitten by Clones ....This "Double size" flash "Feature" is normally just present on "Original STM Chips"This might come in handyhttps://www.eevblog.com/forum/microcontrollers/is-stm32f030c8t6-a-rebadged-bigger-brother/msg3643336/#msg3643336Code:DIE414 STM32F101R(C-D-E)TxDIE414 STM32F101V(C-D-E)TxDIE414 STM32F101Z(C-D-E)TxDIE414 STM32F103R(C-D-E)TxDIE414 STM32F103R(C-D-E)YxDIE414 STM32F103V(C-D-E)HxDIE414 STM32F103V(C-D-E)TxDIE414 STM32F103Z(C-D-E)HxDIE414 STM32F103Z(C-D-E)TxEdit: I use a st-link v2 Clone like this one (was 3€ from China)But if you're in a hurry ... Amazon.dehttps://www.amazon.de/ST-Link-Programming-H%C2%A8%C2%B9lle-Emulator-Downloader/dp/B01F37YMJ4/

author: capt bullshot
author_rank: Super Contributor
timestamp: September 13, 2021, 06:39:09 pm
content: bingo600, you've been faster.The DIExxx numbers from the XML files are my primary source of information, too. Discovered them by chance while watching the console output of STM32CubeMX when generating code ...

author: Zucca
author_rank: Unknown
timestamp: September 13, 2021, 11:05:31 pm
content: Thanks guys,awesomeI already invested some $in china for this nice to have project.Lovely!