Cortex-m4 Error: lo register required

Asked by Clive Stubbings

Hi,

I'm trying to build some cortex-m4 code with the gcc-arm-none-eabi-4_7-2012q4 binary.
arm-none-eabi-gcc seems to be compiling OK, but I can't assemble a '.s' file.

This is pure assembler (not gcc output), but it does assemble with the freescale codewarrior assembler.

Options to arm-none-eabi-as are

-mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -EL

But I get a load of errors like

Error: lo register required -- `stmdb r0!,{r4-r11}'

Am I missing something obvious?

Thanks
Clive

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Terry Guo
Solved:
Last query:
Last reply:
Revision history for this message
Best Terry Guo (terry.guo) said :
#1

For .s file, the assembler needs the directives in the .s files rather than the options in command line. Can you please add following two lines in the beginning of your .s file:

.thumb
.syntax unified

They do work for for me, as you can see from my screen paste:

terguo01@terry-pc01:launchpad-questions$ /work/terguo01/releases/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-as -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -EL m4.s
terguo01@terry-pc01:launchpad-questions$ /work/terguo01/releases/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-objdump -d a.out

a.out: file format elf32-littlearm

Disassembly of section .text:

00000000 <.text>:
   0: e920 0ff0 stmdb r0!, {r4, r5, r6, r7, r8, r9, sl, fp}
terguo01@terry-pc01:launchpad-questions$ cat m4.s
.thumb
.syntax unified

stmdb r0!, {r4-r11}
terguo01@terry-pc01:launchpad-questions$

So far I don't have codewarrior, but assemblers can work differently because they may be configured differently.

Revision history for this message
Clive Stubbings (cas12) said :
#2

Thanks Terry Guo, that solved my question.