F1C100S
如何使用J-Link GDB Server和IDA Pro除錯程式
參考資訊:
1. jtag_pdf
2. whycan_jtag
3. whycan_pinout
4. jtag_allwinner_f1c100s.cfg
F1C100S JTAG腳位(和MicroSD共用腳位)
TMS | PF0, SDC0_D1 |
---|---|
TDI | PF1, SDC0_D0 |
TDO | PF3, SDC0_CMD |
TCK | PF5, SDC0_D2 |
連接J-Link
main.s
.global _start .equ GPIO_BASE, 0x01c20800 .equ PE_CFG0, (GPIO_BASE + (4 * 0x24) + 0x00) .equ PE_DATA, (GPIO_BASE + (4 * 0x24) + 0x10) .arm .text _start: b reset _undef: b . _swi: b . _pabort: b . _dabort: b . _reserved: b . _irq: b . _fiq: b . reset: ldr r0, =PE_CFG0 ldr r1, =0x00010000 str r1, [r0] ldr r0, =PE_DATA 0: eor r1, #0x10 str r1, [r0] b 0b .end
main.ld
MEMORY { ram : ORIGIN = 0, LENGTH = 32K } SECTIONS { text : { *(.text*) } > ram }
編譯
$ arm-none-eabi-as -mcpu=arm9 -o main.o main.s $ arm-none-eabi-ld -T main.ld -o main.elf main.o $ arm-none-eabi-objcopy -O binary main.elf main.bin
下載程式到RAM(loadbin c:\main.bin 0)
開啟J-Link GDB Server(Init registers記得勾選)
選擇ARM 9
Listening on TCP/IP port 2331
IDA Pro載入main.bin
按下F9,選擇Remote GDB debugger
按下F9,輸入localhost 2331
接著就可以開始除錯程式