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