FreeCalypso > hg > freecalypso-sw
annotate nuc-fw/serial/debug.c @ 137:5fe5559003b7
RV bring-up: RVT "system time" heartbeat messages now get printed every 20 s!
The problem was a slight Nucleus API incompatibility between what the RVF code
from TCS211 expected and what our FreeNucleus implements: in the TCS211
version of Nucleus it was OK to pass 0 for the initial_time parameter to
NU_Create_Timer(), but our version flags such usage as an error.
RVF used 0 as the dummy initial_time value when initializing the legacy RV
timers with NU_DISABLE_TIMER. Implemented fix: using a dummy value of 1
instead.
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 11 Nov 2013 09:56:23 +0000 |
parents | 3b5c3f3646fb |
children |
rev | line source |
---|---|
136
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * This module is a FreeCalypso addition for very low-level debugging. |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 * The functions implemented in this module produce "forced" serial output |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 * on the RVTMUX UART without going through the normal RV trace mechanism. |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 * Calls to these FC debug functions should be added during difficult |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 * debug sessions, but should never remain in stable checked-in code: |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 * these functions are too disruptive to be used in "production" fw images. |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 */ |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 #include "../include/config.h" |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 #include "../include/sys_types.h" |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 #include "serialswitch.h" |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 #include <string.h> |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 freecalypso_raw_dbgout(char *string) |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 { |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 char *p; |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 int l, cc; |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 p = string; |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 l = strlen(p); |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 while (l) { |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 cc = SER_tr_WriteNBytes(SER_LAYER_1, p, l); |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 p += cc; |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 l -= cc; |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 } |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 } |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 freecalypso_lldbg_intinfo() |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 { |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 char strbuf[128]; |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 extern unsigned IQ_TimerCount2; |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 extern unsigned TMD_System_Clock; |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 extern unsigned INT_Check_IRQ_Mask(); |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 sprintf(strbuf, "*CPSR=%08x, IQ_TimerCount2=%u, TMD_System_Clock=%u", |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 INT_Check_IRQ_Mask(), IQ_TimerCount2, TMD_System_Clock); |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 freecalypso_raw_dbgout(strbuf); |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 } |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 freecalypso_nucidle_dbghook() |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 { |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 freecalypso_raw_dbgout("*In Nucleus idle loop"); |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 freecalypso_lldbg_intinfo(); |
3b5c3f3646fb
RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 } |