eldarkg / emdr1986x-std-per-lib

Milandr MCU 1986x Standard Peripherals Library. Mirror:

Home Page:https://code.launchpad.net/~eldar/emdr1986x-std-per-lib/+git/emdr1986x-std-per-lib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Readme doesn't mention assembler flags

Amomum opened this issue · comments

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 -D__STARTUP_CLEAR_BSS -D__START=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'`.

@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 -D__STARTUP_CLEAR_BSS -D__START=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.