Author Topic: Upgrade from STM32F103RC to STM32F103RE  (Read 1865 times)

0 Members and 1 Guest are viewing this topic.

Offline ZuccaTopic starter

  • Supporter
  • ****
  • Posts: 4576
  • Country: it
  • EE meid in Itali
Upgrade from STM32F103RC to STM32F103RE
« on: September 12, 2021, 01:42:49 am »
This is my board
On my board the µC is a STM32F103RC

Lot 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: [Select]
[platformio]
src_dir      = Marlin
boards_dir   = buildroot/share/PlatformIO/boards
default_envs = STM32F103RE_btt_maple
include_dir  = Marlin
extra_configs =
    ini/avr.ini
    ini/due.ini
    ini/esp32.ini
    ini/features.ini
    ini/lpc176x.ini
    ini/native.ini
    ini/samd51.ini
    ini/stm32-common.ini
    ini/stm32f0.ini
    ini/stm32f1-maple.ini
    ini/stm32f1.ini
    ini/stm32f4.ini
    ini/stm32f7.ini
    ini/stm32h7.ini
    ini/teensy.ini

and 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...  :-[
« Last Edit: September 12, 2021, 01:44:43 am by Zucca »
Can't know what you don't love. St. Augustine
Can't love what you don't know. Zucca
 

Online Kean

  • Supporter
  • ****
  • Posts: 2228
  • Country: au
  • Embedded systems & IT consultant
    • Kean Electronics
Re: Upgrade from STM32F103RC to STM32F103RE
« Reply #1 on: September 12, 2021, 03:05:02 am »
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.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6571
  • Country: nl
Re: Upgrade from STM32F103RC to STM32F103RE
« Reply #2 on: September 12, 2021, 08:45:14 am »
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.
 

Offline ZuccaTopic starter

  • Supporter
  • ****
  • Posts: 4576
  • Country: it
  • EE meid in Itali
Re: Upgrade from STM32F103RC to STM32F103RE
« Reply #3 on: September 12, 2021, 01:44:02 pm »
Provided the used programming  device ignores the chip id.

AFAIK 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...

Can't know what you don't love. St. Augustine
Can't love what you don't know. Zucca
 

Offline ZuccaTopic starter

  • Supporter
  • ****
  • Posts: 4576
  • Country: it
  • EE meid in Itali
Re: Upgrade from STM32F103RC to STM32F103RE
« Reply #4 on: September 12, 2021, 02:52:34 pm »
Board schematics here

not sure how to connect this
Can't know what you don't love. St. Augustine
Can't love what you don't know. Zucca
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6571
  • Country: nl
Re: Upgrade from STM32F103RC to STM32F103RE
« Reply #5 on: September 12, 2021, 08:52:08 pm »
Just use the swdebug port with swim protocol.
Clk, dio, gnd and reset is all you need if you power the targetboard yourself.

 
The following users thanked this post: Zucca

Online Kean

  • Supporter
  • ****
  • Posts: 2228
  • Country: au
  • Embedded systems & IT consultant
    • Kean Electronics
Re: Upgrade from STM32F103RC to STM32F103RE
« Reply #6 on: September 12, 2021, 10:03:30 pm »
There is diagnostics code for testing the flash size on the C8 chip common on Blue Pill boards
https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-diagnostics-v1.6.html#diags-1-6
So 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.
 

Offline ZuccaTopic starter

  • Supporter
  • ****
  • Posts: 4576
  • Country: it
  • EE meid in Itali
Re: Upgrade from STM32F103RC to STM32F103RE
« Reply #7 on: September 13, 2021, 12:04:24 am »
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.
Can't know what you don't love. St. Augustine
Can't love what you don't know. Zucca
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2031
  • Country: dk
Re: Upgrade from STM32F103RC to STM32F103RE
« Reply #8 on: September 13, 2021, 05:32:24 pm »
Don't get bitten by Clones ....

This "Double size" flash "Feature" is normally just present on "Original STM Chips"

This might come in handy
https://www.eevblog.com/forum/microcontrollers/is-stm32f030c8t6-a-rebadged-bigger-brother/msg3643336/#msg3643336


Code: [Select]
DIE414  STM32F101R(C-D-E)Tx
DIE414  STM32F101V(C-D-E)Tx
DIE414  STM32F101Z(C-D-E)Tx
DIE414  STM32F103R(C-D-E)Tx
DIE414  STM32F103R(C-D-E)Yx
DIE414  STM32F103V(C-D-E)Hx
DIE414  STM32F103V(C-D-E)Tx
DIE414  STM32F103Z(C-D-E)Hx
DIE414  STM32F103Z(C-D-E)Tx

Edit: I use a st-link v2 Clone like this one (was 3€ from China)
But if you're in a hurry ... Amazon.de
https://www.amazon.de/ST-Link-Programming-H%C2%A8%C2%B9lle-Emulator-Downloader/dp/B01F37YMJ4/
« Last Edit: September 13, 2021, 06:23:50 pm by bingo600 »
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: Upgrade from STM32F103RC to STM32F103RE
« Reply #9 on: September 13, 2021, 06:39:09 pm »
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 ...
Safety devices hinder evolution
 

Offline ZuccaTopic starter

  • Supporter
  • ****
  • Posts: 4576
  • Country: it
  • EE meid in Itali
Re: Upgrade from STM32F103RC to STM32F103RE
« Reply #10 on: September 13, 2021, 11:05:31 pm »
Thanks guys,
awesome I already invested some $ in china for this nice to have project.

Lovely!
Can't know what you don't love. St. Augustine
Can't love what you don't know. Zucca
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf