How to Program the STM32 "Blue Pill" with Arduino IDE

Post here first, or if you can't find a relevant section!
Post Reply
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

How to Program the STM32 "Blue Pill" with Arduino IDE

Post by myksj1105 »

http://dan.drown.org/stm32duino/package ... index.json
https://github.com/stm32duino/BoardMana ... index.json

1. How to connect hardware
-Serial(FTDI) :
https://maker.pro/arduino/tutorial/how- ... rduino-ide
- RX-A9, TX-A10

Case 1. first core method
- Board : STM32F1 Boards - Generic STM32F103C6
- Upload : Serial
- Run 'blink' example program: It works well. (The program will be uploaded.)
- but. 'EEPROM' did not work.

Case 2. second core method
-Board : BluePill F103C6(32K)
- Upload : STM32CubeProgrammer(Serial)
- Unable to upload.

I'm curious about 2 things.
Q1) Doesn't 'EEPROM' of 'STM32F103C6' work?
Q2) I want to know how to upload a program in 'second core method'.
by fpiSTM » Thu Jun 22, 2023 10:20 am
myksj1105 wrote: Thu Jun 22, 2023 5:29 am @fpiSTM

hello. thank you for the reply.
STM32F103C8

Q1) Does the chip above not have 'EEPROM'?
- I actually tried to write and read the EEPROM to the corresponding chip.
It works fine.
Q2) If there is no EEPROM, how does it work?
As said by @GonzoG, the STM32F1 series does not have real EEPROM. The library provided within the STM32 core do EPPROM emulation using the FLASH.
Go to full post
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

Re: How to Program the STM32 "Blue Pill" with Arduino IDE

Post by myksj1105 »

STM32F103C8T6 EEPROM Very well work.
program, USB Booting good!
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 26
Location: Prudnik, Poland

Re: How to Program the STM32 "Blue Pill" with Arduino IDE

Post by GonzoG »

STM32 MCUs do not have EEPROM.
To have non-volatile memory, virtual EEPROM is created in flash memory. Because every MCU has different memory it virtual EEPROM needs to be configured for each MCU. You're using Roger's/Steave's core, so it's limited to only few MCUs and it may be missing necessary config for virtual EEPROM for F103C6.

As to upload with STM32 core, what error do you get ??
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

Re: How to Program the STM32 "Blue Pill" with Arduino IDE

Post by myksj1105 »

GonzoG wrote: Tue Jun 20, 2023 10:20 am STM32 MCUs do not have EEPROM.
To have non-volatile memory, virtual EEPROM is created in flash memory. Because every MCU has different memory it virtual EEPROM needs to be configured for each MCU. You're using Roger's/Steave's core, so it's limited to only few MCUs and it may be missing necessary config for virtual EEPROM for F103C6.

As to upload with STM32 core, what error do you get ??


STM32F103C6 : EEPROM not work
STM32F103C8 : EEPROM nice work

I don't know why, but 'STM32F103C8T6' works fine. EEPROM works fine.
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: How to Program the STM32 "Blue Pill" with Arduino IDE

Post by fpiSTM »

GonzoG wrote: Tue Jun 20, 2023 10:20 am STM32 MCUs do not have EEPROM.
It is not totally true ;)
2 series have a real EEPROM:
https://www.st.com/en/microcontrollers- ... eries.html: embedded EEPROM memory
https://www.st.com/en/microcontrollers- ... eries.html: 16 Kbytes of true embedded EEPROM
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

Re: How to Program the STM32 "Blue Pill" with Arduino IDE

Post by myksj1105 »

@fpiSTM

hello. thank you for the reply.
STM32F103C8

Q1) Does the chip above not have 'EEPROM'?
- I actually tried to write and read the EEPROM to the corresponding chip.
It works fine.
Q2) If there is no EEPROM, how does it work?
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: How to Program the STM32 "Blue Pill" with Arduino IDE

Post by fpiSTM »

myksj1105 wrote: Thu Jun 22, 2023 5:29 am @fpiSTM

hello. thank you for the reply.
STM32F103C8

Q1) Does the chip above not have 'EEPROM'?
- I actually tried to write and read the EEPROM to the corresponding chip.
It works fine.
Q2) If there is no EEPROM, how does it work?
As said by @GonzoG, the STM32F1 series does not have real EEPROM. The library provided within the STM32 core do EPPROM emulation using the FLASH.
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

Re: How to Program the STM32 "Blue Pill" with Arduino IDE

Post by myksj1105 »

@GonzoG @fpiSTM

Nice to meet you geniuses. I really appreciate your answer.

1. In conclusion, EEPROM works well.
2. Actually, there is no 'EEPROM', but is it true that it is remembered for life in the same way as above? Or is it only remembered for a certain period of time?
3. In conclusion, what is the difference between 'EEPROM' used in Arduino and 'EEPROM' used in 'STM32Duino' now?
(Will users notice a difference?)
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 26
Location: Prudnik, Poland

Re: How to Program the STM32 "Blue Pill" with Arduino IDE

Post by GonzoG »

It's saved into flash memory until it's rewritten. If you flash a big program that will need almost whole memory and without virtual EEPROM it may overwrite data saved in virtual EEPROM.

Also:
1. Flash memory has limited (more then EEPROM) erase/write cycles. If you'll write lots of data or very often you will destroy this part of MCU flash.
2. there are only 256B of virtual flash available on F103 blue pills.
3. Virtual EEPROM uses 2kB of flash.
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

Re: How to Program the STM32 "Blue Pill" with Arduino IDE

Post by myksj1105 »

@GonzoG @GonzoG

Thank you. understand.
Thank you very much.
Post Reply

Return to “General discussion”