• 求助 | Help Embedded IDE ARM
  • cubemx生成的makefile工程可以在Ubuntu编译,但是用EIDE编译出来的固件,和原来makefile 的固件不一样。

应该是我哪些配置没有做好。

{
  "name": "STM32L051K8",
  "type": "ARM",
  "dependenceList": [],
  "srcDirs": [
    ".eide/deps",
    "Core",
    "Drivers"
  ],
  "virtualFolder": {
    "name": "<virtual_root>",
    "files": [],
    "folders": []
  },
  "outDir": "build",
  "deviceName": null,
  "packDir": null,
  "miscInfo": {
    "uid": "894fb7446df4fe6808755d24380f92e2"
  },
  "targets": {
    "Debug": {
      "excludeList": [],
      "toolchain": "GCC",
      "compileConfig": {
        "cpuType": "Cortex-M0+",
        "floatingPointHardware": "none",
        "scatterFilePath": "./STM32L051K8Ux_FLASH.ld",
        "useCustomScatterFile": true,
        "storageLayout": {
          "RAM": [],
          "ROM": []
        },
        "options": "null"
      },
      "uploader": "OpenOCD",
      "uploadConfig": {
        "bin": "",
        "target": "stm32l0",
        "interface": "cmsis-dap",
        "baseAddr": "0x08000000"
      },
      "uploadConfigMap": {
        "JLink": {
          "bin": "",
          "baseAddr": "",
          "cpuInfo": {
            "vendor": "null",
            "cpuName": "null"
          },
          "proType": 1,
          "speed": 8000,
          "otherCmds": ""
        }
      },
      "custom_dep": {
        "name": "default",
        "incList": [
          ".eide/deps",
          "Core/Inc",
          "Drivers/STM32L0xx_HAL_Driver/Inc",
          "Drivers/CMSIS/Include",
          "Drivers/CMSIS/Device/ST/STM32L0xx/Include",
          "Drivers/STM32L0xx_HAL_Driver/Inc/Legacy"
        ],
        "libList": [],
        "sourceDirList": [],
        "defineList": [
          "USE_HAL_DRIVER",
          "STM32L051xx"
        ]
      }
    }
  },
  "version": "3.3"
}

芯片是stm32l051
环境是Ubuntu22
工具链:arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi
直接用cubemx生成的工程,我可以用makefile脚本,在终端里面输入make编译
但是用EIDE配置,可以编译,编译出来的固件大小不正确,里面的内容很明显是错误的。

[ INFO ] start building at 2024-06-08 10:37:34

[ TOOL ] arm-none-eabi-gcc (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009

[ INFO ] file statistics (rebuild mode)

+---------+-----------+-----------+---------------+--------+
| C Files | Cpp Files | Asm Files | Lib/Obj Files | Totals |
+---------+-----------+-----------+---------------+--------+
| 20      | 0         | 0         | 0             | 20     |
+---------+-----------+-----------+---------------+--------+

[ INFO ] start compilation (jobs: 8) ...

>> [  5%] CC 'Core/Src/stm32l0xx_it.c'
>> [ 10%] CC 'Core/Src/stm32l0xx_hal_msp.c'
>> [ 15%] CC 'Core/Src/system_stm32l0xx.c'
>> [ 20%] CC 'Core/Src/main.c'
>> [ 25%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_exti.c'
>> [ 30%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_cortex.c'
>> [ 35%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal.c'
>> [ 40%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_dma.c'
>> [ 45%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash_ramfunc.c'
>> [ 50%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_i2c_ex.c'
>> [ 55%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_gpio.c'
>> [ 60%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash.c'
>> [ 65%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_pwr_ex.c'
>> [ 70%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_pwr.c'
>> [ 75%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash_ex.c'
>> [ 80%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_tim.c'
>> [ 85%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_tim_ex.c'
>> [ 90%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_rcc_ex.c'
>> [ 95%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_rcc.c'
>> [100%] CC 'Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_i2c.c'

[ INFO ] start linking ...

/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-closer.o): in function `_close_r':
closer.c:(.text._close_r+0xc): warning: _close is not implemented and will always fail
/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-lseekr.o): in function `_lseek_r':
lseekr.c:(.text._lseek_r+0x10): warning: _lseek is not implemented and will always fail
/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-readr.o): in function `_read_r':
readr.c:(.text._read_r+0x10): warning: _read is not implemented and will always fail
/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-writer.o): in function `_write_r':
writer.c:(.text._write_r+0x10): warning: _write is not implemented and will always fail
/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol Reset_Handler; defaulting to 08000000
/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: warning: ./build/Debug/STM32L051K8.elf has a LOAD segment with RWX permissions
Memory region         Used Size  Region Size  %age Used
             RAM:        1568 B         8 KB     19.14%
           FLASH:         184 B        64 KB      0.28%

[ INFO ] start outputting files ...

>> output hex file              [done]

file path: "build/Debug/STM32L051K8.hex"

>> output bin file              [done]

file path: "build/Debug/STM32L051K8.bin"

[ DONE ] build successfully !, elapsed time 0:0:0

 *  终端将被任务重用,按任意键关闭。 
lxf@lxf-Inspiron-15-5510:~/cortex-m/STM32L051K8$ make clean
rm -fR build
lxf@lxf-Inspiron-15-5510:~/cortex-m/STM32L051K8$ make
mkdir build
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -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
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_it.d" -Wa,-a,-ad,-alms=build/stm32l0xx_it.lst Core/Src/stm32l0xx_it.c -o build/stm32l0xx_it.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_msp.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_msp.lst Core/Src/stm32l0xx_hal_msp.c -o build/stm32l0xx_hal_msp.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_tim.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_tim.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_tim.c -o build/stm32l0xx_hal_tim.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_tim_ex.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_tim_ex.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_tim_ex.c -o build/stm32l0xx_hal_tim_ex.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal.c -o build/stm32l0xx_hal.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_i2c.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_i2c.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_i2c.c -o build/stm32l0xx_hal_i2c.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_i2c_ex.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_i2c_ex.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_i2c_ex.c -o build/stm32l0xx_hal_i2c_ex.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_rcc.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_rcc.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_rcc.c -o build/stm32l0xx_hal_rcc.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_rcc_ex.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_rcc_ex.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_rcc_ex.c -o build/stm32l0xx_hal_rcc_ex.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_flash_ramfunc.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_flash_ramfunc.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash_ramfunc.c -o build/stm32l0xx_hal_flash_ramfunc.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_flash.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_flash.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash.c -o build/stm32l0xx_hal_flash.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_flash_ex.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_flash_ex.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash_ex.c -o build/stm32l0xx_hal_flash_ex.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_gpio.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_gpio.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_gpio.c -o build/stm32l0xx_hal_gpio.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_dma.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_dma.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_dma.c -o build/stm32l0xx_hal_dma.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_pwr.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_pwr.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_pwr.c -o build/stm32l0xx_hal_pwr.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_pwr_ex.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_pwr_ex.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_pwr_ex.c -o build/stm32l0xx_hal_pwr_ex.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_cortex.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_cortex.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_cortex.c -o build/stm32l0xx_hal_cortex.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32l0xx_hal_exti.d" -Wa,-a,-ad,-alms=build/stm32l0xx_hal_exti.lst Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_exti.c -o build/stm32l0xx_hal_exti.o
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/system_stm32l0xx.d" -Wa,-a,-ad,-alms=build/system_stm32l0xx.lst Core/Src/system_stm32l0xx.c -o build/system_stm32l0xx.o
arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m0plus -mthumb   -DUSE_HAL_DRIVER -DSTM32L051xx -ICore/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc -IDrivers/STM32L0xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32L0xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/startup_stm32l051xx.d" startup_stm32l051xx.s -o build/startup_stm32l051xx.o
arm-none-eabi-gcc build/main.o build/stm32l0xx_it.o build/stm32l0xx_hal_msp.o build/stm32l0xx_hal_tim.o build/stm32l0xx_hal_tim_ex.o build/stm32l0xx_hal.o build/stm32l0xx_hal_i2c.o build/stm32l0xx_hal_i2c_ex.o build/stm32l0xx_hal_rcc.o build/stm32l0xx_hal_rcc_ex.o build/stm32l0xx_hal_flash_ramfunc.o build/stm32l0xx_hal_flash.o build/stm32l0xx_hal_flash_ex.o build/stm32l0xx_hal_gpio.o build/stm32l0xx_hal_dma.o build/stm32l0xx_hal_pwr.o build/stm32l0xx_hal_pwr_ex.o build/stm32l0xx_hal_cortex.o build/stm32l0xx_hal_exti.o build/system_stm32l0xx.o build/startup_stm32l051xx.o  -mcpu=cortex-m0plus -mthumb   -specs=nano.specs -TSTM32L051K8Ux_FLASH.ld  -lc -lm -lnosys  -Wl,-Map=build/STM32L051K8.map,--cref -Wl,--gc-sections -o build/STM32L051K8.elf
/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-closer.o): in function `_close_r':
closer.c:(.text._close_r+0xc): warning: _close is not implemented and will always fail
/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-lseekr.o): in function `_lseek_r':
lseekr.c:(.text._lseek_r+0x10): warning: _lseek is not implemented and will always fail
/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-readr.o): in function `_read_r':
readr.c:(.text._read_r+0x10): warning: _read is not implemented and will always fail
/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-writer.o): in function `_write_r':
writer.c:(.text._write_r+0x10): warning: _write is not implemented and will always fail
/home/lxf/toolchain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: warning: build/STM32L051K8.elf has a LOAD segment with RWX permissions
arm-none-eabi-size build/STM32L051K8.elf
   text    data     bss     dec     hex filename
   3992      20    1572    5584    15d0 build/STM32L051K8.elf
arm-none-eabi-objcopy -O ihex build/STM32L051K8.elf build/STM32L051K8.hex
arm-none-eabi-objcopy -O binary -S build/STM32L051K8.elf build/STM32L051K8.bin
stm32l051k8tar.tar
4MB

麻烦坛友帮我看一下,我是哪里配置有错误了?

    admin
    OK我明白了。原来的路径不正确,导致.s文件没有被包含。

    Write a Reply...