Forum Discussion
Altera_Forum
Honored Contributor
8 years agoCris72,
The objdump command that was mentioned earlier creates a raw binary file, whereas the mkimage command creates a "u-boot image file" that is readable by the "bootm" command of u-boot. The mkimage command can add some information to the executable/binary to allow the u-boot bootloader to correctly parse and load the u-boot image file that gets loaded into the memory. I would stick with the raw binary to make things less confusing. Check that the memory dump is actually dumping 4 bytes at a time, instead of 2 bytes at a time. In gdb, the first command dumps out 2-bytes (or half-word) at a time, while the 2nd dumps out 4-bytes (or full word): (gdb) x/8xh main 0x8520 <main>: 0xb580 0xb08c 0xaf02 0xf248 0x60dc 0xf2c0 0x0000 0xf241 (gdb) x/8xw main 0x8520 <main>: 0xb08cb580 0xf248af02 0xf2c060dc 0xf2410000 0x8530 <main+16>: 0xf2c00102 0xf7ff0110 0x6138ef62 0xf1b3693b (gdb) x/8i main 0x8520 <main>: push {r7, lr} 0x8522 <main+2>: sub sp,# 48 ; 0x30 0x8524 <main+4>: add r7, sp,# 8 0x8526 <main+6>: movw r0,# 34524 ; 0x86dc 0x852a <main+10>: movt r0,# 0 0x852e <main+14>: movw r1,# 4098 ; 0x1002 0x8532 <main+18>: movt r1,# 16 0x8536 <main+22>: blx 0x83fc <open@plt>