编译器问题:
topeet@ubuntu:~/rtthread-test$ make
mkdir build
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb -DUSE_HAL_DRIVER -DSTM32G0B1xx -IRT-Thread -ICore/Inc -IDrivers/STM32G0xx_HAL_Driver/Inc -IDrivers/STM32G0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32G0xx/Include -IDrivers/CMSIS/Include -IMiddlewares/Third_Party/RealThread_RTOS/include/ -IMiddlewares/Third_Party/RealThread_RTOS/bsp/_template/cubemx_config -IMiddlewares/Third_Party/RealThread_RTOS/finsh/ -IMiddlewares/Third_Party/RealThread_RTOS/components/finsh -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/main.d" -Wa,-a,-ad,-alms=build/main.lst Core/Src/main.c -o build/main.o
/bin/sh: 1: arm-none-eabi-gcc: not found
Makefile:196: recipe for target 'build/main.o' failed
make: *** [build/main.o] Error 127
解决:
sudo apt install gcc-arm-none-eabi
参考:software installation - Installing arm-none-eabi-gcc - Unix & Linux Stack Exchange
make编译报错问题:
board.c里面报了很多关于串口的变量没定义问题,如下:
解决:看样子是没有包含串口头文件
#include "stm32g030xx.h"
#include "stm32g0xx_hal.h"
#include "stm32g0xx_hal_uart.h"