cpp.commonCompilerFlags:[ "-mcpu=cortex-m4", "-mthumb", "-mfpu=fpv4-sp-d16", "-mfloat-abi=softfp"] cpp.linkerFlags: [ "-mcpu=cortex-m4", "-mthumb", "-mfpu=fpv4-sp-d16", "-mfloat-abi=softfp",]
In function `zero_loop':<artificial>:(.text+0x4e0): undefined reference to `_sidata'<artificial>:(.text+0x4e4): undefined reference to `_sdata'<artificial>:(.text+0x4e8): undefined reference to `_edata'
In function `Default_Handler':<artificial>:(.text+0x4f4): undefined reference to `_sbss'<artificial>:(.text+0x4f8): undefined reference to `_ebss'
import qbsProject{ name: "qbs" Product { type: "application" Depends { name: "cpp" } cpp.executableSuffix: ".elf" cpp.defines: "STM32F10X_LD_VL" cpp.positionIndependentCode: false cpp.debugInformation: true cpp.commonCompilerFlags: [ "-mthumb", "-mcpu=cortex-m3", "-msoft-float", "-mfpu=vfp", "-O0", "-fdata-sections", "-ffunction-sections", "-fno-inline",// "-std=c++11", "-flto" ] cpp.linkerFlags: [ "-flto", "-mthumb", "-mcpu=cortex-m3", "-msoft-float", "-mfpu=vfp", "-specs=nano.specs", "-Wl,--start-group", "-T" + path + "/src/linker/stm32f100c4_flash.ld", "-lnosys", "-lc", "-lstdc++", "-lm" ] cpp.includePaths: [ "src", "src/cmsis", "src/inc", "src/linker", "src/startup" ] files: [ "*.cpp", "src/cmsis/*.c", "src/cmsis/*.h", "src/inc/*.c", "src/inc/*.h", "src/startup/*.c" ] Properties { condition: qbs.buildVariant === "debug" cpp.defines: outer.concat(["DEBUG=1"]) } Group { qbs.install: true fileTagsFilter: "application" } }}
Group { name: "linker scripts" files: ["linkerscript1", "linkerscript2"] fileTags: ["linkerscript"] }
import qbsProject { name: "simple" Product { name: "micro" type: "hex" Group { name: "sources" files: ["*.c", "*.h", "*.S"] fileTags: ['c'] } Rule { inputs: ["c"] Artifact { fileTags: ['obj'] filePath: input.fileName + '.o' } prepare: { var args = []; args.push("-mcpu=cortex-m3") args.push("-mthumb") args.push("-g") args.push("-ffunction-sections") args.push("-O0") args.push("-Wall") args.push("-Wunused") args.push("-DM3") args.push('-c'); args.push(input.filePath); args.push('-o'); args.push(output.filePath); var compilerPath = "c:/development/gcc-arm/bin/arm-none-eabi-gcc.exe" var cmd = new Command(compilerPath, args); cmd.description = 'compiling ' + input.fileName; cmd.highlight = 'compiler'; cmd.silent = false; return cmd; } } Rule{ multiplex: true inputs: ['obj'] Artifact{ fileTags:['elf'] filePath: project.name + '.elf' } prepare:{ var args = [] args.push("-mcpu=cortex-m3") args.push("-mthumb") args.push("-g") args.push("-nostartfiles") args.push("-O0") args.push("-Wl,--gc-sections") for(i in inputs['obj']) args.push(inputs["obj"][i].filePath); args.push("-Td:/work/workspace/uc/qbs_c/stm32f10x_flash.ld") args.push('-o'); args.push(output.filePath); var compilerPath = "c:/development/gcc-arm/bin/arm-none-eabi-gcc.exe" var cmd = new Command(compilerPath,args); cmd.description = "linking"+project.name return cmd; } } Rule{ inputs: ['elf'] Artifact{ fileTags:['hex'] filePath: project.name + '.hex' } prepare:{ var args = [] args.push("-O") args.push("ihex") args.push(input.filePath) args.push(output.filePath) var hexcreator = "c:/development/gcc-arm/bin/arm-none-eabi-objcopy.exe" var cmd = new Command(hexcreator,args); cmd.description = 'create_hex'+project.name return cmd; } } }}
inputs: ['elf'] Artifact{ fileTags:['hex'] filePath: project.name + '.hex' }
arm-none-eabi-objcopy -Obinary name.elf name.bin
// cpp.linkerScripts: [// //"../TrueSTUDIO/F1032/libs.ld",// ]#на строку Group { name: "linker scripts" files: ["../STM32L152RB_FLASH.ld",] fileTags: ["linkerscript"] }