How to create an STM32 program using Arduino (trouble)

Post here all questions related to LibMaple core if you can't find a relevant section!
Post Reply
gpmfactory
Posts: 2
Joined: Wed Nov 22, 2023 2:51 pm

How to create an STM32 program using Arduino (trouble)

Post by gpmfactory »

※I am Japanese. This sentence was created using Google Translate
OS:Win11(x64)
IDE used: Arduino 2.2.1
STM32 board at hand: "STM32F103C8T6"
This is a cheap item I bought on Amazon. I think it's a compatible product. Is this the type called "Blue Pill"?

I have initialized the board using the "Flash Loader Demo" published by STM32.
I don't know how to rewrite and run the board's program from this state.
I need help. thank you.

<<<Results of verification with Arduino>>>

Code: Select all

FQBN: stm32duino:STM32F1:genericSTM32F103C
Using board 'genericSTM32F103C' from platform in folder: C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26
Using core 'maple' from platform in folder: C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26

loading library from d:\Developers\_VSCode\libraries\Arduino_STM32-master: invalid library: no header files found
loading library from d:\Developers\_VSCode\libraries\HoodLoader2-master: invalid library: no header files found
loading library from d:\Developers\_VSCode\libraries\USB_Digitizer_forLeonardo: invalid library: no header files found
Detecting libraries used...
C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOC -DERROR_LED_PIN=13 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10607 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/include -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/stm32f1/include -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/usb/stm32f1 -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/usb/usb_lib -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\cores\maple -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\variants\generic_stm32f103c C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\sketch\stm32.ino.cpp -o nul
Generating function prototypes...
C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOC -DERROR_LED_PIN=13 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10607 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/include -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/stm32f1/include -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/usb/stm32f1 -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/usb/usb_lib -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\cores\maple -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\variants\generic_stm32f103c C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\sketch\stm32.ino.cpp -o C:\Users\kazuaki matsumoto\AppData\Local\Temp\2861830982\sketch_merged.cpp
C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\kazuaki matsumoto\AppData\Local\Temp\2861830982\sketch_merged.cpp
スケッチをコンパイルしています...
"C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -Wall -DDEBUG_LEVEL=DEBUG_FAULT -std=gnu++11 -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOC -DERROR_LED_PIN=13 -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10607 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/include" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/stm32f1/include" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/usb/stm32f1" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/usb/usb_lib" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\cores\\maple" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\variants\\generic_stm32f103c" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\sketch\\stm32.ino.cpp" -o "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\sketch\\stm32.ino.cpp.o"
Compiling libraries...
Compiling core...
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\wirish\start_c.c.o
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\wirish\start.S.o
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\wirish\syscalls.c.o
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\board.cpp.o
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\wirish\boards_setup.cpp.o
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\wirish\boards.cpp.o
Using precompiled core: C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\cores\a04aef0645dbcc17df720a3f52cd035c\core.a
Linking everything together...
"C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -Os -Wl,--gc-sections --specs=nano.specs -mcpu=cortex-m3 "-TC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\variants\\generic_stm32f103c/ld/bootloader_20.ld" "-Wl,-Map,C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09/stm32.ino.map" "-LC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\variants\\generic_stm32f103c/ld" -o "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09/stm32.ino.elf" "-LC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\sketch\\stm32.ino.cpp.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\board.cpp.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\wirish\\boards.cpp.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\wirish\\boards_setup.cpp.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\wirish\\start.S.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\wirish\\start_c.c.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\wirish\\syscalls.c.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\cores\\a04aef0645dbcc17df720a3f52cd035c\\core.a" -Wl,--end-group
"C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-objcopy" -O binary "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09/stm32.ino.elf" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09/stm32.ino.bin"

"C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-size" -A "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09/stm32.ino.elf"
最大65536バイトのフラッシュメモリのうち、スケッチが13844バイト(21%)を使っています。
最大20480バイトのRAMのうち、グローバル変数が2064バイト(10%)を使っていて、ローカル変数で18416バイト使うことができます。
<<<Display when writing(The last line is garbled and unreadable)>>>

Code: Select all

FQBN: stm32duino:STM32F1:genericSTM32F103C
Using board 'genericSTM32F103C' from platform in folder: C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26
Using core 'maple' from platform in folder: C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26

loading library from d:\Developers\_VSCode\libraries\Arduino_STM32-master: invalid library: no header files found
loading library from d:\Developers\_VSCode\libraries\HoodLoader2-master: invalid library: no header files found
loading library from d:\Developers\_VSCode\libraries\USB_Digitizer_forLeonardo: invalid library: no header files found
Detecting libraries used...
C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOC -DERROR_LED_PIN=13 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10607 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/include -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/stm32f1/include -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/usb/stm32f1 -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/usb/usb_lib -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\cores\maple -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\variants\generic_stm32f103c C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\sketch\stm32.ino.cpp -o nul
Generating function prototypes...
C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOC -DERROR_LED_PIN=13 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10607 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/include -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/stm32f1/include -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/usb/stm32f1 -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\system/libmaple/usb/usb_lib -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\cores\maple -IC:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26\variants\generic_stm32f103c C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\sketch\stm32.ino.cpp -o C:\Users\kazuaki matsumoto\AppData\Local\Temp\474980194\sketch_merged.cpp
C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\kazuaki matsumoto\AppData\Local\Temp\474980194\sketch_merged.cpp
スケッチをコンパイルしています...
"C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -Wall -DDEBUG_LEVEL=DEBUG_FAULT -std=gnu++11 -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOC -DERROR_LED_PIN=13 -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10607 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/include" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/stm32f1/include" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/usb/stm32f1" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/usb/usb_lib" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\cores\\maple" "-IC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\variants\\generic_stm32f103c" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\sketch\\stm32.ino.cpp" -o "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\sketch\\stm32.ino.cpp.o"
Compiling libraries...
Compiling core...
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\wirish\start.S.o
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\wirish\start_c.c.o
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\wirish\syscalls.c.o
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\board.cpp.o
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\wirish\boards.cpp.o
以前コンパイルされたファイルを使用中:C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09\core\wirish\boards_setup.cpp.o
Using precompiled core: C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\cores\a04aef0645dbcc17df720a3f52cd035c\core.a
Linking everything together...
"C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -Os -Wl,--gc-sections --specs=nano.specs -mcpu=cortex-m3 "-TC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\variants\\generic_stm32f103c/ld/bootloader_20.ld" "-Wl,-Map,C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09/stm32.ino.map" "-LC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\variants\\generic_stm32f103c/ld" -o "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09/stm32.ino.elf" "-LC:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\sketch\\stm32.ino.cpp.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\board.cpp.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\wirish\\boards.cpp.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\wirish\\boards_setup.cpp.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\wirish\\start.S.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\wirish\\start_c.c.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09\\core\\wirish\\syscalls.c.o" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\cores\\a04aef0645dbcc17df720a3f52cd035c\\core.a" -Wl,--end-group
"C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-objcopy" -O binary "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09/stm32.ino.elf" "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09/stm32.ino.bin"

"C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-size" -A "C:\\Users\\kazuaki matsumoto\\AppData\\Local\\Temp\\arduino\\sketches\\E783984086222D8D51659A9982737D09/stm32.ino.elf"
最大65536バイトのフラッシュメモリのうち、スケッチが13844バイト(21%)を使っています。
最大20480バイトのRAMのうち、グローバル変数が2064バイト(10%)を使っていて、ローカル変数で18416バイト使うことができます。
"C:\Users\kazuaki matsumoto\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2022.9.26/win/maple_upload.bat" COM10 2 1EAF:0003 "C:\Users\kazuaki matsumoto\AppData\Local\Temp\arduino\sketches\E783984086222D8D51659A9982737D09/stm32.ino.bin" "C:\Program Files\Arduino\Arduino IDE\resources\app\lib\backend\resources"
'C:\Users\kazuaki' �́A�����R�}���h�܂��͊O���R�}���h�A
����”\�ȃv���O�����܂��̓o�b�` �t�@�C���Ƃ��ĔF������Ă��܂���B
Failed uploading: uploading error: exit status 1
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: How to create an STM32 program using Arduino (trouble)

Post by ag123 »

Try using this core instead, deemed the 'official' STM core

https://github.com/stm32duino/Arduino_C ... ng-Started
https://github.com/stm32duino/Arduino_Core_STM32
https://github.com/stm32duino/Arduino_Core_STM32/wiki

and to program that board stm32f103c8, you would need a st-link dongle e.g.
https://www.adafruit.com/product/2548
https://www.st.com/en/development-tools/st-link-v2.html
https://octopart.com/search?q=st-link+v ... SD&specs=0
or a usb-uart (serial) dongle


there are better boards e.g. Nucleo STM32F401RE / STM32F411RE - these are from ST on the core Readme.md
https://github.com/stm32duino/Arduino_Core_STM32

Adafruit Feather STM32F405 Express (512k sram 1M flash 168 mhz large number of pheriperials on chip)
https://www.adafruit.com/product/4382
https://learn.adafruit.com/adafruit-stm ... er-express

stm32f4x1 (e.g. stm32f401cc 64k ram 256k flash, stm32f411ce 96k ram, 512k flash)
https://github.com/WeActStudio/WeActStu ... iSTM32F4x1

the stm32f4xx family is recommended for beginners as they tend to have more sram, more flash than some of the smaller chips, and fast has FPU and 'ART accelerator' (on chip cache),
https://www.st.com/en/microcontrollers- ... 401cc.html
e.g. a stm32f401cc 84mhz runs faster than a stm32f103c8 72mhz, even if you run them at the same frequency, because 'ART accelerator' (on chip cache) can speed up flash memory access from like few wait states say 4 to 0 wait states, if the codes is in cache.

some of these can be found in the online markets searching for stm32f401 as keyword
e.g. aliexpress
https://www.aliexpress.com/w/wholesale-stm32f401.html
ebay
https://www.ebay.com/sch/i.html?_from=R ... 1&_sacat=0
amazon
https://www.amazon.com/s/ref=nb_sb_noss ... =stm32f401

but that the github link above for WeAct studio and here has schematics / board layout etc
https://github.com/WeActStudio/WeActStu ... iSTM32F4x1
hence, buy from them would likely get a board matching their schematics

I don't read japanese, hope google translate works:
http://translate.google.com/translate?s ... 522#p13522
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: How to create an STM32 program using Arduino (trouble)

Post by ag123 »

for the (old) libmaple (roger's) core
use this repository for the core
https://github.com/rogerclarkmelbourne/Arduino_STM32
there is a wiki here
https://github.com/rogerclarkmelbourne/ ... STM32/wiki

but you still need the st-link v2 dongle to program the board / chip.
it is likely 'harder' to setup and would (mainly) only work in arduino ide 1.8.x

this core make smaller firmware and run faster, but needs more experience, know-how to setup and use.

for experienced users and in Linux, there is a makefile for it
viewtopic.php?t=37
gpmfactory
Posts: 2
Joined: Wed Nov 22, 2023 2:51 pm

Re: How to create an STM32 program using Arduino (trouble)

Post by gpmfactory »

Reply Thank you everyone.
When I updated the IDE to 1.8.18 (I heard there was a problem with the Windows store version), the console display changed only once.
However, the program written on the board could not be rewritten.
Since then, the USB port is no longer recognized.

I have the following dongles.
- Clone of ST-Link v2
- FTDI FT232RL
I've never had success programming a board with either.

I've been doing some research myself, and it seems that some people are rewriting their programs using a combination of "Win10" and "IDE 2.2.1".
On the other hand, I don't see anyone developing on Win11. Is it not compatible with development on Win11 yet?

For now, I'll report on the current situation.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: How to create an STM32 program using Arduino (trouble)

Post by ag123 »

if you use st-link (and only with st-link) , there is a method called connect under reset.
i.e. press reset on stm32f103 board, and try to flash using st-link v2
accordingly, it is one way to override write/copy protection if indeed the device is locked.

Normally to do those things I use Opencd from linux and is like such
https://forum.sparkfun.com/viewtopic.php?t=35249

if you don't do Openocd, try holding reset (stm32 board) while flashing the sketch / firmware

On Windows, try to install one of ST software for programming the board
e.g. stm32cube programmer or
https://www.st.com/en/development-tools ... s-software
https://www.st.com/en/development-tools ... eprog.html
https://www.st.com/en/development-tools ... nk009.html
Those software can be used to program the board if you have the bin file.

to get the bin file from the Arduino IDE menu, select Sketch > export compiled binary, the bin file (firmware) should be in your sketch folder.
User avatar
Bakisha
Posts: 139
Joined: Fri Dec 20, 2019 6:50 pm
Answers: 5
Contact:

Re: How to create an STM32 program using Arduino (trouble)

Post by Bakisha »

Post Reply

Return to “General discussion”