eldarkg / emdr1986x-std-per-lib

Milandr MCU 1986x Standard Peripherals Library. Mirror:
https://code.launchpad.net/~eldar/emdr1986x-std-per-lib/+git/emdr1986x-std-per-lib
47 stars 28 forks source link

Readme doesn't mention assembler flags #23

Closed Amomum closed 7 years ago

Amomum commented 7 years ago

Since startup_MDR32F9Qx.s uses preprocessor, it should be assembled not with as but with gcc, for example, like this:

-x assembler-with-cpp -mcpu=cortex-m3 -mthumb -DSTARTUP_CLEAR_BSS -DSTART=main -c

And because readme now recommends adding -nostartfiles (and that's actually is a problem on its own), I had to add -D__START=main; otherwise I got an error undefined reference to_start'`.

eldarkg commented 7 years ago

@Amomum

Since startup_MDR32F9Qx.s uses preprocessor, it should be assembled not with as but with gcc, for example, like this:

-x assembler-with-cpp -mcpu=cortex-m3 -mthumb -DSTARTUP_CLEAR_BSS -DSTART=main -c

See example: SRC = ... startup_MDR32F9Qx.S And then compiled with

arm-none-eabi-gcc ${CFLAGS} -DUSE_MDR1986VE9x -D__STARTUP_CLEAR_BSS -D__START=main -I${INC} -c ${src} -o ${src}.o

and gcc transfers defines (-D) to as automatically. You can check this.

And because readme now recommends adding -nostartfiles (and that's actually is a problem on its own), I had to add -D__START=main; otherwise I got an error undefined reference to_start'`.

It is only one example, it isn't rule for using.