Project

General

Profile

Compile-with-sercomm » History » Version 7

gnutoo, 02/19/2016 10:49 PM
sync infos with code

1 4 gnutoo
To compile nuttx-bb with sercomm, do the following steps:
2 1 gnutoo
3
 * Clone osmocom-bb and nuttx-bb, they must reside in the same directory and you shouldn't change the name of the osmocom-bb directory.
4
{{{
5
git clone git://git.osmocom.org/osmocom-bb
6
git clone git://git.osmocom.org/nuttx-bb
7
}}}
8
 * Put the gnuarm(for 64bit) or the codesourcery(for 32bit)
9
  in your path(there is a problem with gnuarm for 32bit).
10
 * Compile osmocom-bb as usual
11
{{{
12
cd osmocom-bb/src
13
make
14
cd ../../
15
}}}
16 6 gnutoo
 * Configure nuttx-bb:
17 1 gnutoo
{{{
18
cd nuttx-bb/nuttx/tools/
19 7 gnutoo
./configure.sh compal_e88/nsh_highram #for compal_e88( gta02 and Motorola W220).
20
./configure.sh compal_e99/nsh_highram #for compal_e99( motorolla c155 )
21 6 gnutoo
}}}
22
 * Modify your configuration(nuttx/.config):
23
{{{
24
-CONFIG_SERCOMM_CONSOLE=n
25
+CONFIG_SERCOMM_CONSOLE=y
26
-CONFIG_STDIO_LINE_BUFFER=y
27
}}}
28
29
 * compile nuttx-bb:
30
{{{
31 1 gnutoo
cd ../
32
make
33
}}}
34 5 gnutoo
 * nuttx.bin is ready for beeing loaded like any other firmware (Loading nuttx-bb is not different from loading osmocom-bb, refer to the pages related to osmocom-bb for informations on how to load a firmware in your phone.)
35
36
== Running ==
37
Once you loaded nuttx-bb you should see the following appearing on sercomm:
38
{{{
39
[...]
40
Preparing block 61, block checksum is 0xda 
41
handle_write_block(): 1024 bytes (1024/1024)
42
handle_write_block(): Block 61 finished
43
Received block ack from phone
44
Preparing block 62, block checksum is 0xd8 
45
handle_write_block(): 1024 bytes (1024/1024)
46
handle_write_block(): Block 62 finished
47
Received block ack from phone
48
Preparing the last block, filling 386 bytes, block checksum is 0xaf 
49
handle_write_block(): 1024 bytes (1024/1024)
50
handle_write_block(): Block 63 finished
51
Finished, sent 63 blocks in total
52
Received block ack from phone
53
Sending checksum: 0x0e 
54
Checksum on phone side matches, let's branch to your code
55
Branching to 0x00820000
56
Received branch ack, your code is running now!
57
58
NuttShell (NSH)
59
60
}}}
61
To interact with it run the loadwriter.py script that can be found in nuttx/drivers/sercomm/loadwriter.py in the nuttx sources.
62
{{{
63
sudo ./loadwriter.py 
64
>help
65
}}}
66
will produce the following output on sercomm:
67
{{{
68
nsh> help
69
Builtin Apps: 
70
and type 'help' for more NSH commands.
71
72
NSH command forms:
73
  [nice [-d <niceness>>]] <cmd> [> <file>|>> <file>] [&]
74
OR
75
  if <cmd>
76
  then
77
    [sequence of <cmd>]
78
  else
79
    [sequence of <cmd>]
80
  fi
81
Where <cmd> is one of:
82
  [ <expression> ]
83
  cat <path> [<path> [<path> ...]]
84
  cp <source-path> <dest-path>
85
  dd if=<infile> of=<outfile> [bs=<sectsize>] [count=<sectors>] [skip=<sectors>]
86
  echo [<string> [<string>...]]
87
  exec <hex-address>
88
  exit
89
  free
90
  help
91
  kill -<signal> <pid>
92
  losetup [-d <dev-path>] | [[-o <offset>] [-r] <dev-path> <file-path>]
93
  ls [-lRs] <dir-path>
94
  mb <hex-address>[=<hex-value>][ <hex-byte-count>]
95
  mkfifo <path>
96
  mh <hex-address>[=<hex-value>][ <hex-byte-count>]
97
  mw <hex-address>[=<hex-value>][ <hex-byte-count>]
98
  ps
99
  sh <script-path>
100
  sleep <sec>
101
  test <expression>
102
  usleep <usec>
103
  xd <hex-address> <byte-count>
104
nsh> 
105
}}}
Add picture from clipboard (Maximum size: 48.8 MB)