Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem with compiling #8

Open
atimin opened this issue Aug 11, 2014 · 1 comment
Open

A problem with compiling #8

atimin opened this issue Aug 11, 2014 · 1 comment

Comments

@atimin
Copy link

atimin commented Aug 11, 2014

I tried to compile the sources for Cortex-M4.
It's my first attempts and I really confused... I started with `make menuconfig' where I disabled MMU-options and chose STMicro STM32 processor. Then I lunched 'make' and got these errors.

arch/arm/kernel/entry-common.S: Assembler messages:
arch/arm/kernel/entry-common.S:29: Error: lo register required -- `ldr r1,[tsk,#0]'
arch/arm/kernel/entry-common.S:30: Error: unshifted register required -- `tst r1,#0x000000ff'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- `ldr lr,[sp,#36]'
arch/arm/kernel/entry-common.S:36: Error: only lo regs allowed with immediate -- `cmp lr,#0xfffffffd'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- `ldmia sp,{r4-r11}'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- `ldr lr,[sp,#64]'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- `ldmia sp,{r0-r3,r12}'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- `ldr r12,[sp,#32]'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- `add r11,sp,#44'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- `ldmia r11,{r1-r7}'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- `stmia r12,{r0-r7}'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- `ldmia sp,{r4-r11}'
arch/arm/kernel/entry-common.S:51: Error: unshifted register required -- `tst r1,#(1<<1)'
arch/arm/kernel/entry-common.S:53: Error: unshifted register required -- `tst r1,#(1<<0)|(1<<2)'
arch/arm/kernel/entry-common.S:68: Error: lo register required -- `ldr r1,[tsk,#0]'
arch/arm/kernel/entry-common.S:69: Error: unshifted register required -- `tst r1,#0x000000ff'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- `ldr lr,[sp,#36]'
arch/arm/kernel/entry-common.S:75: Error: only lo regs allowed with immediate -- `cmp lr,#0xfffffffd'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- `ldmia sp,{r4-r11}'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- `ldr lr,[sp,#64]'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- `ldmia sp,{r0-r3,r12}'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- `ldr r12,[sp,#32]'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- `add r11,sp,#40'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- `ldmia r11,{r0-r7}'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- `stmia r12,{r0-r7}'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- `ldmia sp,{r4-r11}'
arch/arm/kernel/entry-common.S:83: Error: lo register required -- `lsr tsk,tsk,#13'
arch/arm/kernel/entry-common.S:83: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov tsk,tsk,lsl#13'
arch/arm/kernel/entry-common.S:84: Error: lo register required -- `ldr r1,[tsk,#0]'
arch/arm/kernel/entry-common.S:85: Error: only lo regs allowed with immediate -- `mov why,#1'
arch/arm/kernel/entry-common.S:86: Error: unshifted register required -- `tst r1,#(1<<8)'
arch/arm/kernel/entry-common.S:128: Error: lo register required -- `stmdb sp!,{r0-r3,lr}'
arch/arm/kernel/entry-common.S:134: Error: lo register required -- `ldmia sp!,{r0-r3,ip,lr}'
arch/arm/kernel/entry-common.S:143: Error: lo register required -- `ldmia sp!,{r0-r3,ip,lr}'
arch/arm/kernel/entry-common.S:147: Error: lo register required -- `stmdb sp!,{r0-r3,lr}'
arch/arm/kernel/entry-common.S:153: Error: lo register required -- `ldr lr,[fp,#-4]'
arch/arm/kernel/entry-common.S:154: Error: lo register required -- `ldmia sp!,{r0-r3,pc}'
arch/arm/kernel/entry-common.S:157: Error: lo register required -- `ldr r1,[fp,#-4]'
arch/arm/kernel/entry-common.S:162: Error: lo register required -- `ldr lr,[fp,#-4]'
arch/arm/kernel/entry-common.S:163: Error: lo register required -- `ldmia sp!,{r0-r3,pc}'
arch/arm/kernel/entry-common.S:194: Error: only lo regs allowed with immediate -- `cmp lr,#0xfffffffd'
arch/arm/kernel/entry-common.S:194: Error: lo register required -- `add r12,sp,#32'
arch/arm/kernel/entry-common.S:194: Error: lo register required -- `stmdb sp!,{r4-r12,lr}'
arch/arm/kernel/entry-common.S:194: Error: lo register required -- `stmia sp,{r4-r12,lr}'
arch/arm/kernel/entry-common.S:194: Error: lo register required -- `ldmia r12,{r0-r3,r6,r8-r10}'
arch/arm/kernel/entry-common.S:194: Error: lo register required -- `add r12,sp,#40'
arch/arm/kernel/entry-common.S:194: Error: lo register required -- `stmia r12,{r0-r3,r6,r8-r10}'
arch/arm/kernel/entry-common.S:207: Error: only lo regs allowed with immediate -- `mov fp,#0'
arch/arm/kernel/entry-common.S:246: Error: unshifted register required -- `tst r8,#0x01000000'
arch/arm/kernel/entry-common.S:247: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:248: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:267: Error: lo register required -- `lsr tsk,tsk,#13'
arch/arm/kernel/entry-common.S:267: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov tsk,tsk,lsl#13'
arch/arm/kernel/entry-common.S:269: Error: lo register required -- `ldr ip,[tsk,#0]'
arch/arm/kernel/entry-common.S:282: Error: unshifted register required -- `bic scno,scno,#0xff000000'
arch/arm/kernel/entry-common.S:283: Error: unshifted register required -- `eor scno,scno,#0'
arch/arm/kernel/entry-common.S:286: Error: lo register required -- `stmdb sp!,{r4,r5}'
arch/arm/kernel/entry-common.S:287: Error: unshifted register required -- `tst ip,#(1<<8)'
arch/arm/kernel/entry-common.S:292: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:295: Error: only lo regs allowed with immediate -- `mov why,#0'
arch/arm/kernel/entry-common.S:297: Error: unshifted register required -- `eor r0,scno,#0'
arch/arm/kernel/entry-common.S:316: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:317: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:365: Error: unshifted register required -- `bic scno,r0,#0x900000'
arch/arm/kernel/entry-common.S:367: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:368: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:369: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:370: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:371: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:372: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:373: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:393: Error: lo register required -- `add ip,sp,#8'
arch/arm/kernel/entry-common.S:394: Error: lo register required -- `str ip,[sp,#4]'
arch/arm/kernel/entry-common.S:414: Error: instruction not supported in Thumb16 mode -- `teq r1,#88'
arch/arm/kernel/entry-common.S:415: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:420: Error: instruction not supported in Thumb16 mode -- `teq r1,#88'
arch/arm/kernel/entry-common.S:421: Error: Thumb does not support conditional execution

I use CodeSourcery G++ Lite toochain. Host Ubuntu 14.04.
Thanks a lot for your help.

@sposelenov-emcraft
Copy link
Contributor

Aleksey,

  • Emcraft kernel tree on GitHub doesn't include configuration files for
    STM32. Only customers of our products receive sample projects with the
    kernel configuration files for the given BSP.
    However it's not so hard to figure out what options need to be enabled.
    Git history provides sufficient information on that.
  • We recommend to use CodeSourcery arm-2010q1 for building. The
    download link is available on the Emcraft Site.

Regards,

Sergei Poselenov,
Emcraft Systems

On Mon, 2014-08-11 at 09:57 -0700, Aleksey Timin wrote:

I tried to compile the sources for Cortex-M4.
It's my first attempts and I really confused... I started with `make
menuconfig' where I disabled MMU-options and chose STMicro STM32
processor. Then I lunched 'make' and got these errors.

arch/arm/kernel/entry-common.S: Assembler messages:
arch/arm/kernel/entry-common.S:29: Error: lo register required -- ldr r1,[tsk,#0]' arch/arm/kernel/entry-common.S:30: Error: unshifted register required --tst r1,#0x000000ff'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- ldr lr,[sp,#36]' arch/arm/kernel/entry-common.S:36: Error: only lo regs allowed with immediate --cmp lr,#0xfffffffd'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- ldmia sp,{r4-r11}' arch/arm/kernel/entry-common.S:36: Error: lo register required --ldr lr,[sp,#64]'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- ldmia sp,{r0-r3,r12}' arch/arm/kernel/entry-common.S:36: Error: lo register required --ldr r12,[sp,#32]'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- add r11,sp,#44' arch/arm/kernel/entry-common.S:36: Error: lo register required --ldmia r11,{r1-r7}'
arch/arm/kernel/entry-common.S:36: Error: lo register required -- stmia r12,{r0-r7}' arch/arm/kernel/entry-common.S:36: Error: lo register required --ldmia sp,{r4-r11}'
arch/arm/kernel/entry-common.S:51: Error: unshifted register required -- tst r1,#(1<<1)' arch/arm/kernel/entry-common.S:53: Error: unshifted register required --tst r1,#(1<<0)|(1<<2)'
arch/arm/kernel/entry-common.S:68: Error: lo register required -- ldr r1,[tsk,#0]' arch/arm/kernel/entry-common.S:69: Error: unshifted register required --tst r1,#0x000000ff'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- ldr lr,[sp,#36]' arch/arm/kernel/entry-common.S:75: Error: only lo regs allowed with immediate --cmp lr,#0xfffffffd'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- ldmia sp,{r4-r11}' arch/arm/kernel/entry-common.S:75: Error: lo register required --ldr lr,[sp,#64]'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- ldmia sp,{r0-r3,r12}' arch/arm/kernel/entry-common.S:75: Error: lo register required --ldr r12,[sp,#32]'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- add r11,sp,#40' arch/arm/kernel/entry-common.S:75: Error: lo register required --ldmia r11,{r0-r7}'
arch/arm/kernel/entry-common.S:75: Error: lo register required -- stmia r12,{r0-r7}' arch/arm/kernel/entry-common.S:75: Error: lo register required --ldmia sp,{r4-r11}'
arch/arm/kernel/entry-common.S:83: Error: lo register required -- lsr tsk,tsk,#13' arch/arm/kernel/entry-common.S:83: Error: shifts in CMP/MOV instructions are only supported in unified syntax --mov tsk,tsk,lsl#13'
arch/arm/kernel/entry-common.S:84: Error: lo register required -- ldr r1,[tsk,#0]' arch/arm/kernel/entry-common.S:85: Error: only lo regs allowed with immediate --mov why,#1'
arch/arm/kernel/entry-common.S:86: Error: unshifted register required -- tst r1,#(1<<8)' arch/arm/kernel/entry-common.S:128: Error: lo register required --stmdb sp!,{r0-r3,lr}'
arch/arm/kernel/entry-common.S:134: Error: lo register required -- ldmia sp!,{r0-r3,ip,lr}' arch/arm/kernel/entry-common.S:143: Error: lo register required --ldmia sp!,{r0-r3,ip,lr}'
arch/arm/kernel/entry-common.S:147: Error: lo register required -- stmdb sp!,{r0-r3,lr}' arch/arm/kernel/entry-common.S:153: Error: lo register required --ldr lr,[fp,#-4]'
arch/arm/kernel/entry-common.S:154: Error: lo register required -- ldmia sp!,{r0-r3,pc}' arch/arm/kernel/entry-common.S:157: Error: lo register required --ldr r1,[fp,#-4]'
arch/arm/kernel/entry-common.S:162: Error: lo register required -- ldr lr,[fp,#-4]' arch/arm/kernel/entry-common.S:163: Error: lo register required --ldmia sp!,{r0-r3,pc}'
arch/arm/kernel/entry-common.S:194: Error: only lo regs allowed with immediate -- cmp lr,#0xfffffffd' arch/arm/kernel/entry-common.S:194: Error: lo register required --add r12,sp,#32'
arch/arm/kernel/entry-common.S:194: Error: lo register required -- stmdb sp!,{r4-r12,lr}' arch/arm/kernel/entry-common.S:194: Error: lo register required --stmia sp,{r4-r12,lr}'
arch/arm/kernel/entry-common.S:194: Error: lo register required -- ldmia r12,{r0-r3,r6,r8-r10}' arch/arm/kernel/entry-common.S:194: Error: lo register required --add r12,sp,#40'
arch/arm/kernel/entry-common.S:194: Error: lo register required -- stmia r12,{r0-r3,r6,r8-r10}' arch/arm/kernel/entry-common.S:207: Error: only lo regs allowed with immediate --mov fp,#0'
arch/arm/kernel/entry-common.S:246: Error: unshifted register required -- tst r8,#0x01000000' arch/arm/kernel/entry-common.S:247: Error: Thumb does not support conditional execution arch/arm/kernel/entry-common.S:248: Error: Thumb does not support conditional execution arch/arm/kernel/entry-common.S:267: Error: lo register required --lsr tsk,tsk,#13'
arch/arm/kernel/entry-common.S:267: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- mov tsk,tsk,lsl#13' arch/arm/kernel/entry-common.S:269: Error: lo register required --ldr ip,[tsk,#0]'
arch/arm/kernel/entry-common.S:282: Error: unshifted register required -- bic scno,scno,#0xff000000' arch/arm/kernel/entry-common.S:283: Error: unshifted register required --eor scno,scno,#0'
arch/arm/kernel/entry-common.S:286: Error: lo register required -- stmdb sp!,{r4,r5}' arch/arm/kernel/entry-common.S:287: Error: unshifted register required --tst ip,#(1<<8)'
arch/arm/kernel/entry-common.S:292: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:295: Error: only lo regs allowed with immediate -- mov why,#0' arch/arm/kernel/entry-common.S:297: Error: unshifted register required --eor r0,scno,#0'
arch/arm/kernel/entry-common.S:316: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:317: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:365: Error: unshifted register required -- bic scno,r0,#0x900000' arch/arm/kernel/entry-common.S:367: Error: Thumb does not support conditional execution arch/arm/kernel/entry-common.S:368: Error: Thumb does not support conditional execution arch/arm/kernel/entry-common.S:369: Error: Thumb does not support conditional execution arch/arm/kernel/entry-common.S:370: Error: Thumb does not support conditional execution arch/arm/kernel/entry-common.S:371: Error: Thumb does not support conditional execution arch/arm/kernel/entry-common.S:372: Error: Thumb does not support conditional execution arch/arm/kernel/entry-common.S:373: Error: Thumb does not support conditional execution arch/arm/kernel/entry-common.S:393: Error: lo register required --add ip,sp,#8'
arch/arm/kernel/entry-common.S:394: Error: lo register required -- str ip,[sp,#4]' arch/arm/kernel/entry-common.S:414: Error: instruction not supported in Thumb16 mode --teq r1,#88'
arch/arm/kernel/entry-common.S:415: Error: Thumb does not support conditional execution
arch/arm/kernel/entry-common.S:420: Error: instruction not supported in Thumb16 mode -- `teq r1,#88'
arch/arm/kernel/entry-common.S:421: Error: Thumb does not support conditional execution

I use CodeSourcery G++ Lite toochain. Host Ubuntu 14.04.
Thanks a lot for your help.


Reply to this email directly or view it on GitHub.

winfred-lu added a commit to uclinux-cortexm/uclinux that referenced this issue Dec 11, 2014
In extract_buf(), hash will be copied to out.
Compiler optimizes memcpy() aggresively and does not test the unaligned
destination address. Specify aligned attributes to workaound it.

crash log:
KERNEL: fault at 0x080872a0 [pc=0x080872a0, sp=0x9004bdb8]
Illegal unaligned access

Pid: 1, comm:              swapper
CPU: 0    Not tainted  (2.6.33-arm1 #70)
pc : [<080872a0>]    lr : [<00000000>]    psr: 2100000b
sp : 9004bdb8  ip : 00000000  fp : 00000000
Code dump at pc [080872a0]:
60696028 a801812b f7f02114 b066fbe7
r10: 00000000  r9 : 9004a008  r8 : 90017ba0
r7 : 00000000  r6 : 90013950  r5 : 9004bf66  r4 : 00000020
r3 : 00005f10  r2 : 6183a03c  r1 : 31f8a394  r0 : 8ddee099
Flags: nzCv  IRQs on  FIQs on  Mode UK11_26  ISA unknown  Segment kernel
Kernel panic - not syncing:

disassembly:
08087230 <extract_buf>:
...
 8087238:       460d            mov     r5, r1
...
 80872a0:       6028            str     r0, [r5, #0]
 80872a2:       6069            str     r1, [r5, #4]
 80872a4:       812b            strh    r3, [r5, EmcraftSystems#8]
...

Signed-off-by: Jim Huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants