UBOOT Hello World Unrecognized Instruction

Discussion in 'General Programming Discussion' started by gabriel, Oct 1, 2015.

  1. gabriel

    gabriel New Member

    Joined:
    Jul 24, 2015
    Messages:
    4
    Likes Received:
    0
    Hello Everyone

    I am trying to program bare metal over the UDOO. With this in mind I compiled UBOOT with its Hello World example code. After get UBOOT running, my surprise is that it crushes when I try to execute the hello_world.bin. Here it is the error message:

    ======================================================
    U-Boot 2015.10-rc1-dirty (Oct 01 2015 - 09:02:12 +0000)

    CPU: Freescale i.MX6Q rev1.2 996 MHz (running at 792 MHz)
    Reset cause: POR
    Board: Udoo
    DRAM: 1 GiB
    MMC: FSL_SDHC: 0
    *** Warning - bad CRC, using default environment

    In: serial
    Out: serial
    Err: serial
    Net: using phy at 6
    FEC [PRIME]
    Hit any key to stop autoboot: 0
    => load mmc 0 0x20000000 hello_world.bin
    562 bytes read in 27 ms (19.5 KiB/s)
    => go 0x20000000
    ## Starting application at 0x20000000 ...
    undefined instruction
    pc : [<20000014>] lr : [<4ff813b4>]
    reloc pc : [<e7884014>] lr : [<178053b4>]
    sp : 4fd79da8 ip : 00000030 fp : 4fd7e2c8
    r10: 00000002 r9 : 4fd79f00 r8 : 4ffb8dc8
    r7 : 4fd7a758 r6 : 20000000 r5 : 00000002 r4 : 4fd7a75c
    r3 : 20000000 r2 : 4fd7a75c r1 : 4fd7a75c r0 : 00000001
    Flags: nZCv IRQs off FIQs off Mode SVC_32
    Resetting CPU ...

    resetting ...​

    ======================================================
    The assembly code is the following:
    examples/standalone/hello_world: file format elf32-littlearm


    Disassembly of section .text:

    20000000 <hello_world>:
    20000000: b570 push {r4, r5, r6, lr}
    20000002: 4605 mov r5, r0
    20000004: 4608 mov r0, r1
    20000006: 460e mov r6, r1
    20000008: f000 f8c0 bl 2000018c <app_startup>
    2000000c: 2108 movs r1, #8
    2000000e: 4816 ldr r0, [pc, #88] ; (20000068 <hello_world+0x68>)
    20000010: 2400 movs r4, #0
    20000012: f000 f84d bl 200000b0 <printf>
    20000016: f000 f837 bl 20000088 <dummy>
    2000001a: 4601 mov r1, r0
    2000001c: 4813 ldr r0, [pc, #76] ; (2000006c <hello_world+0x6c>)​
    ======================================================

    I checked what is in memory to be sure that it is not a problem coping the file:

    => mm 0x20000010
    20000010: f0002400 ?
    20000014: f000f84d ?
    20000018: 4601f837 ?
    ======================================================

    I have checked the ISA of the ARMv7 and the instruction ( f000 f8c0) seems to be valid.
    Everything is compiled with the arm-none-eabi-gcc, and UBOOT seems to run correctly, so I suppose that it is not a problem of the compiler.

    Anyone has any idea what is happening?
    Thanks for your time
     

Share This Page