Скачал проект для микроконтроллеров Миландра, то все собралось без проблем...не было ошибок и предупреждений...
По тому же скрипту (там как раз cortex-m3) собираю для stm32 и получаю кучу ошибок (вчера самостоятельно писал по мануалам qbs без использования модуля срр и получал те же ошибки) ???.
Уже не знаю куда копать...перечитал уже все статьи по этой теме (у всех получается) и использую их скрипты переделанные под свою структуру проекта и постоянно, то прошивка не работает в камне, либо ошибки...
Вот qbs-скрипт (без использования модуля срр):
Код:
import qbs
Project {
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;
}
}
}
}
Ошибки которые вылазят:
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_irq(void)
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_irq(void)
error: unknown type name '__STATIC_INLINE'
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void)
и в том же роде