История изменений
Исправление trex6, (текущая версия) :
$ arm-none-eabi-objdump -h ./test1.elf
./test1.elf: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .ARM.attributes 00000025 00000000 00000000 00000034 2**0
CONTENTS, READONLY
1 .comment 0000002a 00000000 00000000 00000059 2**0
CONTENTS, READONLY
2 .stack 00000100 00000000 00000000 00000088 2**3
CONTENTS
3 .heap 00001000 00000000 00000000 00000188 2**3
CONTENTS
4 .debug_abbrev 0000005d 00000000 00000000 00001188 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_info 000000cb 00000000 00000000 000011e5 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_line 000000b8 00000000 00000000 000012b0 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_macinfo 000021b8 00000000 00000000 00001368 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_loc 00000038 00000000 00000000 00003520 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_pubnames 0000001b 00000000 00000000 00003558 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_aranges 00000048 00000000 00000000 00003578 2**3
CONTENTS, READONLY, DEBUGGING
11 .debug_ranges 00000030 00000000 00000000 000035c0 2**3
CONTENTS, READONLY, DEBUGGING
12 .debug_str 00000044 00000000 00000000 000035f0 2**0
CONTENTS, READONLY, DEBUGGING
13 .debug_frame 0000002c 00000000 00000000 00003634 2**2
CONTENTS, READONLY, DEBUGGING
В openocd
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
undefined debug reason 6 - target needs reset
Info : JTAG tap: lpc1788.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Warn : Only resetting the Cortex-M3 core, use a reset-init event handler to reset any peripherals
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x000000f8 msp: 0x10004860
Линкую вот так:
arm-none-eabi-gcc -T"lpc17xx.ld" -Xlinker --gc-sections -Wl,-Map,"test1.map" -mcpu=cortex-m3 -mthumb -g3 -o "test1.elf" ./main.o ./startup/gcc/startup_LPC177x_8x.o
Компилирую (точнее Eclipse компилирует) вот так:
arm-none-eabi-gcc -x assembler-with-cpp -Wall -Wa,-adhlns="startup/gcc/startup_LPC177x_8x.o.lst" -c -fmessage-length=0 -MMD -MP -MF"startup/gcc/startup_LPC177x_8x.d" -MT"startup/gcc/startup_LPC177x_8x.d" -mcpu=cortex-m3 -mthumb -g3 -o "startup/gcc/startup_LPC177x_8x.o" "../startup/gcc/startup_LPC177x_8x.S"
arm-none-eabi-gcc -O0 -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="main.o.lst" -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -mcpu=cortex-m3 -mthumb -g3 -o "main.o" "../main.c"
Eclipse при линковке почему-то не указывает ни одного *.o файла, я их ручками дописал.
Исходная версия trex6, :
$ arm-none-eabi-objdump -h ./test1.elf
./test1.elf: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .ARM.attributes 00000025 00000000 00000000 00000034 2**0
CONTENTS, READONLY
1 .comment 0000002a 00000000 00000000 00000059 2**0
CONTENTS, READONLY
2 .stack 00000100 00000000 00000000 00000088 2**3
CONTENTS
3 .heap 00001000 00000000 00000000 00000188 2**3
CONTENTS
4 .debug_abbrev 0000005d 00000000 00000000 00001188 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_info 000000cb 00000000 00000000 000011e5 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_line 000000b8 00000000 00000000 000012b0 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_macinfo 000021b8 00000000 00000000 00001368 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_loc 00000038 00000000 00000000 00003520 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_pubnames 0000001b 00000000 00000000 00003558 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_aranges 00000048 00000000 00000000 00003578 2**3
CONTENTS, READONLY, DEBUGGING
11 .debug_ranges 00000030 00000000 00000000 000035c0 2**3
CONTENTS, READONLY, DEBUGGING
12 .debug_str 00000044 00000000 00000000 000035f0 2**0
CONTENTS, READONLY, DEBUGGING
13 .debug_frame 0000002c 00000000 00000000 00003634 2**2
CONTENTS, READONLY, DEBUGGING
В openocd
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
undefined debug reason 6 - target needs reset
Info : JTAG tap: lpc1788.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Warn : Only resetting the Cortex-M3 core, use a reset-init event handler to reset any peripherals
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x000000f8 msp: 0x10004860
Линкую вот так:
arm-none-eabi-gcc -T"lpc17xx.ld" -Xlinker --gc-sections -Wl,-Map,"test1.map" -mcpu=cortex-m3 -mthumb -g3 -o "test1.elf" ./main.o ./startup/gcc/startup_LPC177x_8x.o
Компилирую вот так:
arm-none-eabi-gcc -x assembler-with-cpp -Wall -Wa,-adhlns="startup/gcc/startup_LPC177x_8x.o.lst" -c -fmessage-length=0 -MMD -MP -MF"startup/gcc/startup_LPC177x_8x.d" -MT"startup/gcc/startup_LPC177x_8x.d" -mcpu=cortex-m3 -mthumb -g3 -o "startup/gcc/startup_LPC177x_8x.o" "../startup/gcc/startup_LPC177x_8x.S"
arm-none-eabi-gcc -O0 -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="main.o.lst" -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -mcpu=cortex-m3 -mthumb -g3 -o "main.o" "../main.c"