Skip to content

Commit

Permalink
Merge pull request #123 from spacelab-ufsc/dev
Browse files Browse the repository at this point in the history
Dev: v0.3
  • Loading branch information
mgm8 committed Mar 7, 2020
2 parents ffbcff6 + 454a030 commit 2553de6
Show file tree
Hide file tree
Showing 29 changed files with 2,550 additions and 51 deletions.
62 changes: 60 additions & 2 deletions doc/chapters/firmware.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%
% firmware.tex
%
% Copyright (C) 2019 by Universidade Federal de Santa Catarina.
% Copyright (C) 2020 by Universidade Federal de Santa Catarina.
%
% OBDH 2.0 Documentation
%
Expand Down Expand Up @@ -47,6 +47,7 @@ \section{Tasks}
TTC writing & Medium & 5000 & 10000 & TBD \\
Radio periodoc reset & Low & 0 & 600000 & TBD \\
System reset & High & 0 & 36000000 & 128 \\
Read temperature & Low & 0 & 60000 & TBD \\
\bottomrule[1.5pt]
\end{tabular}
\caption{Firmware tasks.}
Expand Down Expand Up @@ -109,6 +110,10 @@ \subsection{System reset}

This task resets the microcontroller by software at every 10 hours. This can be useful to cleanup possible wrong values in variables, repeat the antenna deployment routine (limited to $n$ times), cleanup the RAM memory, etc.

\subsection{Read temperature}

This task reads the internal temperature of the microcontroller of the OBDH at every 60 seconds.

\section{Telecommands}

\begin{table}[!h]
Expand All @@ -122,9 +127,10 @@ \section{Telecommands}
Activate beacon & None & Private \\
Deactivate beacon & None & Private \\
Activate downlink & None & Private \\
Deactivate dtownlink & None & Private \\
Deactivate downlink & None & Private \\
Activate EDC & None & Private \\
Deactivate EDC & None & Private \\
Get EDC info & None & Private \\
Activate Payload X & Experiment period in seconds & Private \\
Deactivate Payload X & None & Private \\
Set system time & Time value (epoch) & Private \\
Expand All @@ -137,6 +143,58 @@ \section{Telecommands}
\label{tab:system-telecommands}
\end{table}

\subsection{Enter hibernation}

.

\subsection{Leave hibernation}

.

\subsection{Activate beacon}

.

\subsection{Deactivate beacon}

.

\subsection{Activate EDC}

.

\subsection{Deactivate EDC}

.

\subsection{Get EDC info}

This telecommand request information from the EDC payload. When received, the OBDH transmits the housekeeping and state frames of the EDC module (28 bytes). This telecommand does not requires a key.

\subsection{Activate Payload X}

.

\subsection{Deactivate Payload X}

.

\subsection{Set system time}

.

\subsection{Ping}

.

\subsection{Message broadcast}

.

\subsection{Request data}

.

\section{Operating System}

FreeRTOS 10
Expand Down
2 changes: 1 addition & 1 deletion firmware/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="app/libs/ngham" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="drivers/isis_antenna|app/libs/ngham" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
Expand Down
3 changes: 3 additions & 0 deletions firmware/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Source files
!lnk_msp430f6659.cmd

# Code Composer Studio output
.launches
.settings
Expand Down
11 changes: 11 additions & 0 deletions firmware/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
===========================================

v0.3 - 07/03/2020

- EDC driver
- Payload EDC device
- Si446x driver improvements
- Using the fault LED to signalize boot errors
- Fixing I2C driver
- General improvements and fixes

===========================================

v0.2 - 10/02/2020

- I2C driver
Expand Down
55 changes: 55 additions & 0 deletions firmware/app/tasks/read_temp.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* read_temp.h
*
* Copyright (C) 2020, SpaceLab.
*
* This file is part of OBDH 2.0.
*
* OBDH 2.0 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OBDH 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OBDH 2.0. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* \brief Read uC temperature task implementation.
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.2.16
*
* \date 02/03/2020
*
* \addtogroup read_temp
* \{
*/

#include "read_temp.h"
#include "startup.h"

xTaskHandle xTaskReadTempHandle;

void vTaskReadTemp(void *pvParameters)
{
/* Wait startup task to finish */
xEventGroupWaitBits(task_startup_status, TASK_STARTUP_DONE, pdFALSE, pdTRUE, pdMS_TO_TICKS(TASK_READ_TEMP_INIT_TIMEOUT_MS));

while(1)
{
TickType_t last_cycle = xTaskGetTickCount();


vTaskDelayUntil(&last_cycle, pdMS_TO_TICKS(TASK_READ_TEMP_PERIOD_MS));
}
}

/** \} End of watchdog_reset group */
65 changes: 65 additions & 0 deletions firmware/app/tasks/read_temp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* read_temp.c
*
* Copyright (C) 2020, SpaceLab.
*
* This file is part of OBDH 2.0.
*
* OBDH 2.0 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OBDH 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OBDH 2.0. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* \brief Read uC temperature task definition.
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.2.16
*
* \date 02/03/2020
*
* \defgroup read_temp Read temperature
* \ingroup tasks
* \{
*/

#ifndef READ_TEMP_H_
#define READ_TEMP_H_

#include <FreeRTOS.h>
#include <task.h>

#define TASK_READ_TEMP_NAME "ReadTemp" /**< Task name. */
#define TASK_READ_TEMP_STACK_SIZE 128 /**< Stack size in bytes. */
#define TASK_READ_TEMP_PRIORITY 3 /**< Task priority. */
#define TASK_READ_TEMP_PERIOD_MS (60*1000) /**< Task period in milliseconds. */
#define TASK_READ_TEMP_INIT_TIMEOUT_MS 2000 /**< Wait time to initialize the task in milliseconds. */

/**
* \brief Watchdog reset handle.
*/
extern xTaskHandle xTaskReadTempHandle;

/**
* \brief Read uC temperature task.
*
* \param[in] pvParameters is a value that will passed as the task's parameter.
*
* \return None.
*/
void vTaskReadTemp(void *pvParameters);

#endif /* READ_TEMP_H_ */

/** \} End of read_temp group */
12 changes: 11 additions & 1 deletion firmware/app/tasks/tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.1.3
* \version 0.2.16
*
* \date 02/11/2019
*
Expand All @@ -44,6 +44,7 @@
#include "heartbeat.h"
#include "system_reset.h"
#include "radio_reset.h"
#include "read_temp.h"

void create_tasks()
{
Expand Down Expand Up @@ -95,6 +96,15 @@ void create_tasks()
}
#endif // CONFIG_TASK_RADIO_RESET_ENABLED

#if CONFIG_TASK_READ_TEMP_ENABLED == 1
xTaskCreate(vTaskReadTemp, TASK_READ_TEMP_NAME, TASK_READ_TEMP_STACK_SIZE, NULL, TASK_READ_TEMP_PRIORITY, &xTaskReadTempHandle);

if (xTaskReadTempHandle == NULL)
{
/* Error creating the read tempearture task */
}
#endif /* CONFIG_TASK_READ_TEMP_ENABLED */

create_event_groups();
}

Expand Down
3 changes: 2 additions & 1 deletion firmware/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.1.3
* \version 0.2.16
*
* \date 26/10/2019
*
Expand All @@ -42,6 +42,7 @@
#define CONFIG_TASK_HEARTBEAT_ENABLED 1
#define CONFIG_TASK_SYSTEM_RESET_ENABLED 1
#define CONFIG_TASK_RADIO_RESET_ENABLED 1
#define CONFIG_TASK_READ_TEMP_ENABLED 1

#endif // CONFIG_H_

Expand Down
Loading

0 comments on commit 2553de6

Please sign in to comment.