Project

General

Profile

GalaxyNexusI9250SerialConsole » History » Version 6

Denis 'GNUtoo' Carikli, 11/03/2012 12:01 PM

1 1 Denis 'GNUtoo' Carikli
h1. GalaxyNexusSerialConsole
2
3
* http://redmine.replicant.us/projects/replicant/wiki/S5PC110Bootloader works as a serial cable.
4
5
When you connect the cable you get the FIQ debugger, but what if you want kgdb instead:
6
* apply that patch:
7
<pre>
8
diff --git a/arch/arm/mach-omap2/board-tuna.c b/arch/arm/mach-omap2/board-tuna.c
9
index a022a43..7098227 100644
10
--- a/arch/arm/mach-omap2/board-tuna.c
11
+++ b/arch/arm/mach-omap2/board-tuna.c
12
@@ -1001,6 +1001,8 @@ static inline void __init board_serial_init(void)
13
        omap_serial_init_port_pads(0, uart1_pads, uart1_pads_sz, NULL);
14
        omap_serial_init_port_pads(1, tuna_uart2_pads,
15
                ARRAY_SIZE(tuna_uart2_pads), &tuna_uart2_info);
16
+       omap_serial_init_port_pads(2,tuna_uart3_pads,
17
+               ARRAY_SIZE(tuna_uart3_pads), NULL);
18
        omap_serial_init_port_pads(3, tuna_uart4_pads,
19
                                   ARRAY_SIZE(tuna_uart4_pads), NULL);
20
 }
21
</pre>
22
* remove the FIQ debugger in the kernel configuration.
23
24
* change the CMDLINE trough the kernel configuration:
25
Use:
26
<pre>CONFIG_CMDLINE="console=ttyO2 androidboot.console=ttyO2 [...]"</pre>
27
Instead of:
28
<pre>CONFIG_CMDLINE="console=ttyFIQ0 androidboot.console=ttyFIQ0 [...]"</pre>
29 2 Denis 'GNUtoo' Carikli
30 3 Denis 'GNUtoo' Carikli
* Verify that you get the kernel messages.
31 2 Denis 'GNUtoo' Carikli
32 3 Denis 'GNUtoo' Carikli
* Then change the cmdline for kgdb
33 4 Denis 'GNUtoo' Carikli
<pre>
34
CONFIG_CMDLINE="kgdboc=ttyO2,115200 console=ttyO2 androidboot.console=ttyO2 [...]"
35
</pre>
36
37
Don't add kgdbwait tough because it result in that:
38
<pre>
39
(gdb) set remotebaud 115200
40
(gdb) target remote /dev/ttyUSB0
41
/dev/ttyUSB0: Device or resource busy.
42
(gdb) target remote /dev/ttyUSB0
43
Remote debugging using /dev/ttyUSB0
44
kgdb_breakpoint ()
45
    at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/kernel/debug/debug_core.c:954
46
954		arch_kgdb_breakpoint();
47
(gdb) c
48
Continuing.
49
50
Program received signal SIGSEGV, Segmentation fault.
51
__raw_spin_lock_irqsave (lock=0x288)
52
    at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/kernel/spinlock.c:112
53
112	BUILD_LOCK_OPS(spin, raw_spinlock);
54
(gdb) bt
55
#0  __raw_spin_lock_irqsave (lock=0x288)
56
    at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/kernel/spinlock.c:112
57
#1  0xc061aecc in _raw_spin_lock_irqsave (lock=0x288)
58
    at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/kernel/spinlock.c:145
59
#2  0xc0098620 in try_to_wake_up (p=0x0, state=1611595795, wake_flags=1)
60
    at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/kernel/sched.c:2681
61
#3  0xc009897c in wake_up_process (p=0x288)
62
    at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/kernel/sched.c:2785
63
#4  0xc00e2090 in proc_dohung_task_timeout_secs (table=<value optimized out>, write=<value optimized out>, 
64
    buffer=<value optimized out>, lenp=<value optimized out>, ppos=0xc782bf70)
65
    at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/kernel/hung_task.c:190
66
#5  0xc0174178 in proc_sys_call_handler (filp=<value optimized out>, buf=0x24808, count=1, ppos=0xc782bf70, 
67
    write=1) at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/fs/proc/proc_sysctl.c:158
68
#6  0xc01741b0 in proc_sys_write (filp=0x288, buf=0x600f0013 <Address 0x600f0013 out of bounds>, count=1, 
69
    ppos=0xc782a000)
70
    at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/fs/proc/proc_sysctl.c:176
71
#7  0xc0126420 in vfs_write (file=0xc73be500, buf=0x24808 "0", count=<value optimized out>, pos=0xc782bf70)
72
    at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/fs/read_write.c:377
73
#8  0xc0126590 in sys_write (fd=<value optimized out>, buf=0x24808 "0", count=1)
74
    at /home/gnutoo/embedded/android/replicant-4.0/kernel/samsung/tuna/fs/read_write.c:429
75
#9  0xc0055a00 in ?? ()
76
Cannot access memory at address 0x0
77
#10 0xc0055a00 in ?? ()
78
Cannot access memory at address 0x0
79
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
80
</pre>
81 5 Denis 'GNUtoo' Carikli
82
* disable the watchdot timer.
83
84
At the end the cmdline should look like that:
85
<pre>
86
CONFIG_CMDLINE="kgdboc=ttyO2,115200 console=ttyO2 androidboot.console=ttyO2 mem=1G vmalloc=768M omap_wdt.timer_margin=0 no_console_suspend"
87
</pre>
88 6 Denis 'GNUtoo' Carikli
89
then open a root console and do:
90
<pre>
91
echo g > /proc/sysrq-trigger
92
</pre>