2024-06-25 03:33 AM
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.
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.
Any comments of suggestions will be very welcome.
Thanks in advance,
Braian Bannert
2024-06-25 05:06 AM - edited 2024-07-01 01:28 AM
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:
Refer to the AN4488 "Getting started with STM32F4xxxx MCU hardware development"
2024-06-25 09:22 AM
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.
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
2024-06-25 09:27 AM
There are other variants of the STM32F103 that have much more flash / RAM.
2024-06-25 09:32 AM - edited 2024-06-25 11:20 AM
As said previously you need to check at first your HW, especially with the two application notes I provided.
2024-06-25 09:53 AM
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.
2024-06-29 04:42 AM - edited 2024-06-29 03:51 PM
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:
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).
2024-06-29 05:30 AM - edited 2024-06-29 05:40 AM
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
And for replace MCU you start new schematics and PCB.
2024-06-29 06:54 AM
btw F103 ....up to 512K flash :
2024-07-01 07:36 AM
F103RG has up to 1 MB flash, 96 KB SRAM.