README.md 6.11 KB
Newer Older
Konrad Grochowski's avatar
Konrad Grochowski committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
MSP430 Demo-Sat project
=======================

The Demo-Sat project is a CubeSat mock based on [MSP430FR5969 LaunchPad Development Kit](https://www.ti.com/tool/MSP-EXP430FR5969).
The software was modelled, developed and deployed using [TASTE](https://taste.tools) toolchain.


Features
------------------------------------------------

In order to mimic a Cubesat platform running a basic experiment,
the following functionality was selected:
 * Mode management
 * Power supply monitoring
 * Thermal management
 * Command and Control interface based on PUS-C standard
 * Payload management (using PUS 2 service)

The payload consists of OLED Display to demonstrate on-off and register load commands.

### Modes

![Modes](./doc/img/modes.png)

 * Idle Mode – thermal management is enabled, payload is disabled
 * Operational Mode – thermal management is enabled, payload is enabled.
 * Safe Mode – thermal management is disabled, payload is disabled

SW starts in Idle Mode, Observation Mode / Idle Mode can be changed on TC,
Safe Mode is entered on TC or autonomously on power drop.

### Services

 * PUS 1 - Request Verification
   - TM\[1,3\] - Successful Start of Execution Verification Report
   - TM\[1,4\] - Failed Start of Execution Verification Report
 * PUS 2 - Device Access
   - TC\[2,1\] - Distribute On/Off Device Commands
   - TC\[2,2\] - Distribute Register Load Commands
 * PUS 3 - Housekeeping
   - TM\[3,25\] - Housekeeping Parameter Report
 * PUS 222 - Mission Specific
   - TC\[222,1\] - Switch Mode
   - TC\[222,11\] - Set Safe Threshold Voltage
   - TC\[222,21\] - Set Thermal Control Parameters

The services were tailored using [PUS-C Gen](https://indico.esa.int/event/252/contributions/3826/attachments/3040/3692/10_-_Formal_Approach_to_Information_Modelling_PUS-C_and_SRDB.pdf) tool.
ASN.1/ACN models generated from prepared PUS-C population were imported into TASTE project.
Tool's population can be found in `pus-c/` directory.


Model overview
------------------------------------------------

Model was created completely in TASTE. It's source files can be found in `demo-sat/` directory.

### Deployment view
![Deployment View](./doc/img/deployment-view.png)

### Interface view
![Interface View](./doc/img/interface-view.png)


Running software
------------------------------------------------

### Installation on TASTE VM

0. Prerequisites:

TASTE VM machine with installed: 
 - `add-ons/install-msp430-gcc.sh`
 - `add-ons/install-freertos.sh`

 MSP430 device connected and available in TASTE VM (command `ls /dev/ttyACM*` should print `/dev/ttyACM0 /dev/ttyACM1`)

1. Create directory `projects`:

```bash
cd
mkdir -p projects
```

2. Download *msp430-demo-sat* repository:

**TODO** fix link if project to be moved

```bash
git clone https://gitrepos.estec.esa.int/hcorg/msp430-demo-sat.git
```

### Building

1. Change directory:

```bash
Rafal Babski's avatar
Rafal Babski committed
97
cd ~/projects/msp430-demo-sat/demo-sat
Konrad Grochowski's avatar
Konrad Grochowski committed
98
99
100
101
102
103
104
105
106
107
108
109
110
```

2. Build project:
```bash
make
```

After successful compilation the project is ready to run.

### Running project

1. Run linux partition:
```bash
Rafal Babski's avatar
Rafal Babski committed
111
cd ~/projects/msp430-demo-sat/demo-sat/work/binaries/
Konrad Grochowski's avatar
Konrad Grochowski committed
112
113
114
115
116
117
118
119
120
121
122
./run_x86_partition_partition
```

2. Run gdb_agent_console in new terminal window:
```bash
cd /opt/msp430-gcc
./bin/gdb_agent_console msp430.dat
```

3. Run msp430 partition in new terminal window:
```bash
Rafal Babski's avatar
Rafal Babski committed
123
124
cd ~/projects/msp430-demo-dat/demo-sat/work/binaries/
msp430-elf-gdb ./msp430fr5969_partition
Konrad Grochowski's avatar
Konrad Grochowski committed
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
```

In the GDB command line interface:
```
target extended-remote :55000
monitor reset
load
continue
```

In case of any problem with msp430, try following steps:
* after command `load` try type `si` (step one instruction)
* if the output address is `0x00000000 in ?? ()` or similar type `load` again.

Here's example gdb session:

```
GNU gdb (Mitto Systems Limited - msp430-gcc 8.3.0.16) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=msp430-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from work/binaries/msp430_partition...done.
(gdb) target extended-remote :55000
Remote debugging using :55000
0x00005326 in __crt0_start ()
(gdb) monitor reset
CPU has been reset
(gdb) load
Loading section .rodata, size 0x526 lma 0x4400
Loading section .rodata2, size 0x48 lma 0x4928
Loading section .persistent, size 0x8bc lma 0x4970
Loading section .data, size 0xf8 lma 0x522c
Loading section .upper.data, size 0x2 lma 0x5324
Loading section .text, size 0xaa6e lma 0x5326
Loading section __interrupt_vector_46, size 0x2 lma 0xffea
Loading section __interrupt_vector_47, size 0x2 lma 0xffec
Loading section __interrupt_vector_49, size 0x2 lma 0xfff0
Loading section __reset_vector, size 0x2 lma 0xfffe
Start address 0x5326, load size 47514
Transfer rate: 9 KB/sec, 3959 bytes/write.
(gdb) si
0x00000000 in ?? ()
(gdb) load
Loading section .rodata, size 0x526 lma 0x4400
Loading section .rodata2, size 0x48 lma 0x4928
Loading section .persistent, size 0x8bc lma 0x4970
Loading section .data, size 0xf8 lma 0x522c
Loading section .upper.data, size 0x2 lma 0x5324
Loading section .text, size 0xaa6e lma 0x5326
Loading section __interrupt_vector_46, size 0x2 lma 0xffea
Loading section __interrupt_vector_47, size 0x2 lma 0xffec
Loading section __interrupt_vector_49, size 0x2 lma 0xfff0
Loading section __reset_vector, size 0x2 lma 0xfffe
Start address 0x5326, load size 47514
Transfer rate: 9 KB/sec, 3959 bytes/write.
(gdb) si
0x0000532a in __crt0_init_bss ()
(gdb) continue
Continuing.
```


See also
------------------------------------------------
 * [Demonstration scenarios](./doc/demonstration.md)
 * [Hardware documentation](./doc/hardware.md)
 * [Test scenarios](./doc/test-scenarios.md)