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 cd ~/projects/msp430-demo-sat/demo-sat ``` 2. Build project: ```bash make ``` After successful compilation the project is ready to run. ### Running project 1. Run linux partition: ```bash cd ~/projects/msp430-demo-sat/demo-sat/work/binaries/ ./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 cd ~/projects/msp430-demo-dat/demo-sat/work/binaries/ msp430-elf-gdb ./msp430fr5969_partition ``` 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 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: . Find the GDB manual and other documentation resources online at: . 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)