cancel
Showing results for 
Search instead for 
Did you mean: 

Problem on replacing MCU

braian_bannert
Associate

Hi everybody. 

First of all let me thank you for reading this post. 

I started a project using STM32F103R8T7 MCU but when I was almost done with the full program of it for my application I noticed the MCU hasn't enough memory for an improvement I tried to do. So, I search over STM32CubeIDE which were the compatible MCUs and found the STM32F412RET6, which is listed inside the mentioned software as a hardware compatible MCU with the first one mentioned here before. I desoldered the old STM32F103 MCU from my custom board and soldered the new one, the STM21F412. Then I started a new project on STM32CubeIDE to configure all the pins as needed in my project. This, of course, was done using STM32CubeMX inside STM32CubeIDE. When everything was configured in the same way as in the previous MCU. 

At this point I tried to upload the basic firmware but for my surprise the CubeIDE is telling me that is not possible to upload the code. 

Please find below some screenshots of what the software is showing me and also all the messages given to me, not only by CubeIDE, also by STM32CubeProgrammer. 

 

braian_bannert_0-1719311190254.jpeg

braian_bannert_1-1719311210385.jpeg

Meesage from STM32CubeIDE

STMicroelectronics ST-LINK GDB server. Version 7.7.0
Copyright (c) 2024, STMicroelectronics. All rights reserved.

Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled

Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
-------------------------------------------------------------------
STM32CubeProgrammer v2.16.0
-------------------------------------------------------------------

 

Log output file: C:\Users\braia\AppData\Local\Temp\STM32CubeProgrammer_a16432.log
ST-LINK SN : 9073050132124647524B4E00
ST-LINK FW : V2J45S7
Board : --
Voltage : 3.17V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x441
Revision ID : Rev C
Device name : STM32F412
Flash size : 1 MBytes (default)
Start Address : 8000000
Device type : MCU
Device CPU : Cortex-M4
BL Version : 0x0

 

Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a16432.srec
File : ST-LINK_GDB_server_a16432.srec
Size : 55.92 KB
Address : 0x08000000


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 3]
Error: failed to erase memory


Error: failed to erase memory
Encountered Error when opening C:\ST\STM32CubeIDE_1.14.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.201.202404072231\tools\bin\STM32_Programmer_CLI.exe
Error in STM32CubeProgrammer
Shutting down...
Exit.

 

Meesage from STM32CubeProgrammer

12:39:03 : UR connection mode is defined with the HWrst reset mode
12:39:03 : ST-LINK SN : 9073050132124647524B4E00
12:39:03 : ST-LINK FW : V2J45S7
12:39:03 : Board : --
12:39:03 : Voltage : 3.17V
12:39:03 : SWD freq : 4000 KHz
12:39:03 : Connect mode: Normal
12:39:03 : Reset mode : Software reset
12:39:03 : Device ID : 0x441
12:39:03 : Revision ID : Rev C
12:39:03 : Debug in Low Power mode is not supported for this device.
12:39:03 : UPLOADING OPTION BYTES DATA ...
12:39:03 : Bank : 0x00
12:39:03 : Address : 0x40023c14
12:39:03 : Size : 8 Bytes
12:39:03 : UPLOADING ...
12:39:03 : Size : 1024 Bytes
12:39:03 : Address : 0x8000000
12:39:03 : Read progress:
12:39:04 : Error: Data read failed

 

At this point I tried to find some help from STM32 Developers group on Facebook at first time, but without any luck. 

What I search over Internet is that maybe the problem comes from RDP bytes and when I checked it, the value found by STM32CubeProgrammer is 0xFF, none of the possible values (0xAA, 0xBB or 0xCC).

I tried to change the value to one of the possible values and press the "Apply" button, but without success again. Below you will be able to find some screenshots related to it. 

braian_bannert_2-1719311543217.jpeg

braian_bannert_3-1719311555783.jpeg

Any comments of suggestions will be very welcome. 

 

Thanks in advance,

Braian Bannert

 

9 REPLIES 9
SofLit
ST Employee

Hello,

For this you need to check AN4904 "Migration of microcontroller applications from STM32F1 Series
to STM32F4 Access lines"

The pinout difference, with LQFP64, is the VCAP pin on STM32F4 which was PB11 on STM32F1.

VCAP pin needs to be connected to GND over a 4.7uF ceramic capacitor:

SofLit_0-1719334806708.png

Refer to the AN4488 "Getting started with STM32F4xxxx MCU hardware development"

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
braian_bannert
Associate

Hello. 

 

First of all let me thank you for your reply. I soldered an electrolitic capacitor between VCAP pin and GND (of course positive side to VCAP pin and negative side to GND). But this didn't worked and I'm still unable to flash the MCU. 

braian_bannert_0-1719332348469.png

Log from STM32CubeProgrammer attached.

CubeIDE Console output as below:

STMicroelectronics ST-LINK GDB server. Version 7.7.0

Copyright (c) 2024, STMicroelectronics. All rights reserved.

 

Starting server with the following options:

Persistent Mode : Disabled

Logging Level : 1

Listen Port Number : 61234

Status Refresh Delay : 15s

Verbose Mode : Disabled

SWD Debug : Enabled

InitWhile : Enabled

 

Waiting for debugger connection...

Debugger connected

Waiting for debugger connection...

Debugger connected

Waiting for debugger connection...

-------------------------------------------------------------------

STM32CubeProgrammer v2.16.0

-------------------------------------------------------------------

 

 

 

Log output file: C:\Users\braia\AppData\Local\Temp\STM32CubeProgrammer_a08620.log

ST-LINK SN : 54FF6B067880565340590667

ST-LINK FW : V2J45S7

Board : --

Voltage : 3.23V

SWD freq : 4000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID : 0x441

Revision ID : Rev C

Device name : STM32F412

Flash size : 1 MBytes (default)

Start Address : 8000000

Device type : MCU

Device CPU : Cortex-M4

BL Version : 0x0

 

 

 

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a08620.srec

File : ST-LINK_GDB_server_a08620.srec

Size : 4.89 KB

Address : 0x08000000

 

 

Erasing memory corresponding to segment 0:

Erasing internal memory sector 0

Error: failed to erase memory

 

 

Error: failed to erase memory

Encountered Error when opening C:\ST\STM32CubeIDE_1.14.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.201.202404072231\tools\bin\STM32_Programmer_CLI.exe

Error in STM32CubeProgrammer

Shutting down...

Exit.

 

Any other suggestion?

Thanks in advance,

Braian

Chris21
Senior

There are other variants of the STM32F103 that have much more flash / RAM.

As said previously you need to check at first your HW, especially with the two application notes I provided. 

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hi,

> I soldered an electrolitic capacitor between VCAP pin and GND

Wrong ! You have to use a cer.cap , short (wire) connection vcap--gnd .

This is the core supply, a elko almost useless here.

AScha3_0-1719334425905.png

 

If you feel a post has answered your question, please click "Accept as Solution".
BarryWhit
Lead II

Nothing in AN4904 suggests that STM32F412RET6 is a drop-in replacement for STM32F103R8T7. I think you misunderstood what CubeIDE means by "compatible". It doesn't look like it's "compatible" at the pin level. i.e. you can't just solder a chip from another family in place.

 

ST may have kept "most" pins compatible between packages across families. But you only need one pin wrong to have your design fail:

migrate.jpg

 

Find a 100% pin compatible replacement that meets your needs, or re-spin the board (the necessary changes to layout should be minimal, so ST claims).

 

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.
MM..1
Chief II

You complete miss with hw replacement, start with place back 103R8 and optimize your code to level 3.

Next switch HAL to LL for RCC, GPIO ...

How much memory you require? F103 exist with many flash sizes 

STM32F103R8 - Mainstream Performance line, Arm Cortex-M3 MCU with 64 Kbytes of Flash memory, 72 MHz CPU, motor control, USB and CAN - STMicroelectronics

STM32F103RD - Mainstream Performance line, Arm Cortex-M3 MCU with 384 Kbytes of Flash memory, 72 MHz CPU, motor control, USB and CAN - STMicroelectronics

And for replace MCU you start new schematics and PCB.

btw F103 ....up to 512K flash :

AScha3_0-1719669217459.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Chris21_0-1719844512557.png


F103RG has up to 1 MB flash, 96 KB SRAM.