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