Project

General

Profile

Compile-without-sercomm » History » Version 9

acassis, 02/19/2016 10:49 PM

1 8 acassis
NuttX compilation was done using CodeSourcery arm-2010.09-51-arm-none-eabi.bin, other toolchain could fail.
2
3
NuttX can be configured differently depending on what we want.
4 1 gnutoo
The possible configs are:
5 2 gnutoo
 * compal_e88/nsh_highram : for the gta02 using the osmocon for the romloader
6
 * compal_e99/nsh_highram : for the c155 using osmocon + loader.compalram.bin as a loader
7
 * compal_e99/nsh_compalram : for the c155 using osmocon to load it
8 1 gnutoo
9
nsh is the nuttx shell(nuttx can also run standalone apps without a shell).
10 3 gnutoo
11
== standalone nuttx ==
12
if you want a standalone nuttx(without linking to osmocombb for the drivers) do the following:
13
{{{
14
make clean
15
make distclean
16
}}}
17
18 5 acassis
Remove sercomm directories:
19
{{{
20
$ rm -rf drivers/sercomm
21
$ rm -rf include/nuttx/sercomm
22
}}}
23
24 6 acassis
Remove sercomm reference at drivers/Makefile:
25 5 acassis
{{{
26
-include sercomm/Make.defs
27 1 gnutoo
}}}
28
29 8 acassis
Then configure nuttx:
30
{{{
31
$ cd nuttx/tools
32
$ ./configure.sh compal_e99/nsh_highram
33
}}}
34 4 gnutoo
35 3 gnutoo
Then apply manually the following pseudo-diff in nuttx/.config :
36
{{{
37 7 acassis
-CONFIG_SERCOMM_CONSOLE=y
38
+CONFIG_SERCOMM_CONSOLE=n
39 3 gnutoo
-CONFIG_DISABLE_ENVIRON=y
40
+CONFIG_DISABLE_ENVIRON=n
41
+CONFIG_STDIO_LINE_BUFFER=y
42
}}}
43
And then remove the following lines from nuttx/Make.defs:
44
{{{
45
  OSMODIR                 = $(TOPDIR)/../../osmocom-bb
46
  EXTRA_LIBS              = $(OSMODIR)/src/target/firmware/comm/libcomm.a \
47
                            $(OSMODIR)/src/shared/libosmocore/build-target/src/.libs/libosmocore.a \
48
                            $(OSMODIR)/src/target/firmware/calypso/libcalypso.a \
49 1 gnutoo
                            $(OSMODIR)/src/target/firmware/comm/libcomm.a
50
                          # ^^^ Stupid hack! Why do I have to put it twice???
51
}}}
52 8 acassis
53
Compile NuttX:
54
{{{
55
$ cd nuttx
56
$ make
57
}}}
58
59
Load nuttx.bin into Motorola C155, because nuttx.bin is bigger than 64k, you should load chainload.compalram.bin together, use this command:
60
{{{
61
./osmocom-bb/src/host/osmocon/osmocon -p /dev/ttyUSB0 -m c155 /osmocom-bb/src/target/firmware/board/compal_e99/chainload.compalram.bin -c nuttx.bin
62
}}}
63 9 acassis
64
After loading you will receive this message:
65
{{{
66
Checksum on phone side matches, let's branch to your code
67
Branching to 0x00820000
68
Received branch ack, your code is running now!
69
}}}
70
71
Then press Ctrl+C and use a serial console, use picocom or minicom:
72
{{{
73
picocom -b 115200 /dev/ttyUSB0
74
}}}}
75
76
For minicom execute:
77
{{{
78
$ minicom -s
79
}}}
80
81
{{{
82
                                                                             
83
            +-----[configuration]------+                                     
84
            | Filenames and paths      |                                     
85
            | File transfer protocols  |                                     
86
            | Serial port setup        | <<-- Choose this option                                     
87
            | Modem and dialing        |                                     
88
            | Screen and keyboard      |
89
            | Save setup as dfl        |
90
            | Save setup as..          |
91
            | Exit                     |
92
            | Exit from Minicom        |
93
            +--------------------------+
94
}}}
95
96
Then:
97
98
{{{
99
    +-----------------------------------------------------------------------+
100
    | A -    Serial Device      : /dev/ttyUSB0                              |
101
    | B - Lockfile Location     : /var/lock                                 |
102
    | C -   Callin Program      :                                           |
103
    | D -  Callout Program      :                                           |
104
    | E -    Bps/Par/Bits       : 115200 8N1                                |
105
    | F - Hardware Flow Control : No                                        |
106
    | G - Software Flow Control : No                                        |
107
    |                                                                       |
108
    |    Change which setting?                                              |
109
    +-----------------------------------------------------------------------+
110
}}}
Add picture from clipboard (Maximum size: 48.8 MB)