@maxgerhardt @normandunbar Thanks for your prompt response!! I’ve find the error is cause by my careless that not#include "stm32f1xx_hal_gpio.h"
in my lib key.h
.
But the fact I can unskillfully solve that by add the key.h
to the include
, and i use the debug skills(learned from your reply) by running platformio.exe run -v
PLATFORM: ST STM32 (15.4.1) > STM32F103ZE (64k RAM. 512k Flash)
HARDWARE: STM32F103ZET6 72MHz, 64KB RAM, 512KB Flash
DEBUG: Current (stlink) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES:
- toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 2 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Encoder (License: Unknown, Path: D:\file_sum\hardware\learn\stm32f103zet6\radar_model_test\Lib\Encoder)
Building in release mode
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\dma.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -Iinclude -ICore\Src -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\dma.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\gpio.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -Iinclude -ICore\Src -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\gpio.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\main.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -Iinclude -ICore\Src -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\main.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\stm32f1xx_hal_msp.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -Iinclude--ICore\Src -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\stm32f1xx_hal_msp.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\stm32f1xx_it.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -Iinclude -ICore\Src -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\stm32f1xx_it.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\syscalls.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -Iinclude -ICore\Src -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\syscalls.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\system_stm32f1xx.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -Iinclude -ICore\Src -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\system_stm32f1xx.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\tim.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -Iinclude -ICore\Src -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\tim.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\usart.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -Iinclude -ICore\Src -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\usart.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\libe5c\Encoder\encoder.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Lib\Encoder\encoder.c
arm-none-eabi-gcc-ar rc .pio\build\genericSTM32F103ZE\libe5c\libEncoder.a .pio\build\genericSTM32F103ZE\libe5c\Encoder\encoder.o
arm-none-eabi-gcc-ranlib .pio\build\genericSTM32F103ZE\libe5c\libEncoder.a
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\firmware.elf -T ./STM32F103ZETx_FLASH.ld -Os -Wl,--gc-sections,--relax -mthumb -mcpu=cortex-m3 .pio\build\genericSTM32F103ZE\src\dma.o .pio\build\genericSTM32F103ZE\src\gpio.o .pio\build\genericSTM32F103ZE\src\main.o .pio\build\genericSTM32F103ZE\src\stm32f1xx_hal_msp.o .pio\build\genericSTM32F103ZE\src\stm32f1xx_it.o .pio\build\genericSTM32F103ZE\src\syscalls.o .pio\build\genericSTM32F103ZE\src\system_stm32f1xx.o .pio\build\genericSTM32F103ZE\src\tim.o .pio\build\genericSTM32F103ZE\src\usart.o -LC:\Users\57626\.platformio\platforms\ststm32\ldscripts -L.pio\build\genericSTM32F103ZE -Wl,--start-group .pio\build\genericSTM32F103ZE\libe5c\libEncoder.a -lc -lgcc -lm -lstdc++ -Wl,--end-group
c:/users/57626/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol Reset_Handler; defaulting to 08000000
MethodWrapper(["checkprogsize"], [".pio\build\genericSTM32F103ZE\firmware.elf"])
I found that it doesn’t compile the key.c that maybe it solve the problem falsely?
Then I just add the correct stm32f1xx_hal_gpio.h
file to the key.h
and put it in the Lib dir. And the debug info as following
PLATFORM: ST STM32 (15.4.1) > STM32F103ZE (64k RAM. 512k Flash)
HARDWARE: STM32F103ZET6 72MHz, 64KB RAM, 512KB Flash
DEBUG: Current (stlink) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES:
- toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 2 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Encoder (License: Unknown, Path: D:\file_sum\hardware\learn\stm32f103zet6\radar_model_test\Lib\Encoder)
|-- Key (License: Unknown, Path: D:\file_sum\hardware\learn\stm32f103zet6\radar_model_test\Lib\Key)
Building in release mode
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\dma.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -Iinclude -ICore\Src -ILib\Key -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\dma.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\gpio.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -Iinclude -ICore\Src -ILib\Key -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\gpio.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\main.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -Iinclude -ICore\Src -ILib\Key -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\main.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\stm32f1xx_hal_msp.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -Iinclude -ICore\Src -ILib\Key -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\stm32f1xx_hal_msp.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\stm32f1xx_it.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -Iinclude -ICore\Src -ILib\Key -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\stm32f1xx_it.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\syscalls.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -Iinclude -ICore\Src -ILib\Key -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\syscalls.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\system_stm32f1xx.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -Iinclude -ICore\Src -ILib\Key -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\system_stm32f1xx.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\tim.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -Iinclude -ICore\Src -ILib\Key -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\tim.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\src\usart.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -Iinclude -ICore\Src -ILib\Key -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Core\Src\usart.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\libe5c\Encoder\encoder.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -ILib\Encoder -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Lib\Encoder\encoder.c
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\lib7c0\Key\key.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60105 -DSTM32F103xE -DSTM32F1 -DSTM32F103xx -ILib\Key -ICore\Inc -IDrivers\STM32F1xx_HAL_Driver\Inc -IDrivers\CMSIS\Include -IDrivers\CMSIS\Device\ST\STM32F1xx\Include -IDrivers\STM32F1xx_HAL_Driver\Inc\Legacy Lib\Key\key.c
arm-none-eabi-gcc-ar rc .pio\build\genericSTM32F103ZE\libe5c\libEncoder.a .pio\build\genericSTM32F103ZE\libe5c\Encoder\encoder.o
arm-none-eabi-gcc-ar rc .pio\build\genericSTM32F103ZE\lib7c0\libKey.a .pio\build\genericSTM32F103ZE\lib7c0\Key\key.o
arm-none-eabi-gcc-ranlib .pio\build\genericSTM32F103ZE\libe5c\libEncoder.a
arm-none-eabi-gcc-ranlib .pio\build\genericSTM32F103ZE\lib7c0\libKey.a
arm-none-eabi-gcc -o .pio\build\genericSTM32F103ZE\firmware.elf -T ./STM32F103ZETx_FLASH.ld -Os -Wl,--gc-sections,--relax -mthumb -mcpu=cortex-m3 .pio\build\genericSTM32F103ZE\src\dma.o .pio\build\genericSTM32F103ZE\src\gpio.o .pio\build\genericSTM32F103ZE\src\main.o .pio\build\genericSTM32F103ZE\src\stm32f1xx_hal_msp.o .pio\build\genericSTM32F103ZE\src\stm32f1xx_it.o .pio\build\genericSTM32F103ZE\src\syscalls.o .pio\build\genericSTM32F103ZE\src\system_stm32f1xx.o .pio\build\genericSTM32F103ZE\src\tim.o .pio\build\genericSTM32F103ZE\src\usart.o -LC:\Users\57626\.platformio\platforms\ststm32\ldscripts -L.pio\build\genericSTM32F103ZE -Wl,--start-group .pio\build\genericSTM32F103ZE\libe5c\libEncoder.a .pio\build\genericSTM32F103ZE\lib7c0\libKey.a -lc -lgcc -lm -lstdc++ -Wl,--end-group
c:/users/57626/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol Reset_Handler; defaulting to 08000000
MethodWrapper(["checkprogsize"], [".pio\build\genericSTM32F103ZE\firmware.elf"])
I can see it compile the key.c successfully!
thanks for your reply again! and maybe there still have problem when dowloading to the board, because the program seems not work
mybe it’s the problem about warning said warning: cannot find entry symbol Reset_Handler; defaulting to 08000000
?
I just want to build project from stm32cubemx and use the hal_library from it instead the lib that platformio support(I can successfully use my program by add framework = stm32cube
to my platformio.ini
but I know it’s use the lib that platformio support).
Following some solution I’ve add the board_build.ldscript = ./STM32F103ZETx_FLASH.ld
to my platformio.ini
. But it still doesn’t work.
but there seems another file startup_stm32f103xe.s
in my root dir which seems importent and I doesn’t add it to my platformio.ini
could you guys advice me on this?
I’m still looking Using STM32CubeMX and PlatformIO - #57 by rwx for solution but it so long and mess…