Skip to content

Commit

Permalink
Merge pull request #85 from spacelab-ufsc/dev
Browse files Browse the repository at this point in the history
Defining the project licenses
  • Loading branch information
mgm8 authored May 10, 2024
2 parents d2cad3f + 814b178 commit 4bdd2c7
Show file tree
Hide file tree
Showing 210 changed files with 24,320 additions and 81 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

## Overview

TODO
The SLCam ("SpaceLab Camera") is a camera payload designed to be used in nanosatellite missions. The main object is to take pictures of the Earth from space. It's the first project from SpaceLab using cameras in payloads.

## Repository Organization

Expand All @@ -49,6 +49,10 @@ TODO
* mechanical: Mechanical project (sources and outputs).
* software: Software to communicate with the camera (sources).

## License

This project is open-source under three different licenses: GNU General Public License v3.0 for firmware sources, CERN Open Hardware License v2.0 for hardware and mechanical files, and CC BY-SA 4.0 for the documentation. Some third-part files and libraries are subjected to their specific terms and licenses.

## Releases

The SLCam software and hardware releases are synchronized in order to garantee compatibility. Then, using diferent versions might lead to unpredictable behavior. Refer to the [documentation](https://github.com/spacelab-ufsc/slcam/tree/main/doc) for compatibility notes.
Expand Down
427 changes: 427 additions & 0 deletions docs/pdr/LICENSE

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions firmware/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ cppcheck-addon-ctu-file-list
*.a
*.bin
*.elf
*.map
31 changes: 17 additions & 14 deletions firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ ifndef BUILD_DIR
endif

PARTNUMBER=stm32f103c8t6
OPENCM3_FAMILY=STM32F1

CC=arm-none-eabi-gcc
CPP=arm-none-eabi-g++
AS=arm-none-eabi-as
LD=arm-none-eabi-ld
LD=arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy
OBJDUMP=arm-none-eabi-objdump
READELF=arm-none-eabi-readelf
Expand All @@ -20,11 +21,12 @@ GDB=arm-none-eabi-gdb
FLASH=st-flash

INC=.
CFLAGS=--static -nostartfiles -g3 -Os -fno-common -ffunction-sections -fdata-sections -I. -mcpu=cortex-m3 -mthumb -msoft-float
CFLAGS=--static -nostartfiles -g3 -Os -fno-common -ffunction-sections -fdata-sections -I. -mcpu=cortex-m3 -mthumb -msoft-float -Iconfig/ -Ios/include/ -Ios/portable/GCC/ARM_CM3/ -D$(OPENCM3_FAMILY)
LDFLAGS=--specs=nano.specs -Wl,--gc-sections,-Map,$(TARGET).map,-T$(PARTNUMBER).ld

.PHONY: all
all: libopencm3_stm32f1.a crt.o main.o
$(LD) -T$(PARTNUMBER).ld $(BUILD_DIR)/*.o -o $(BUILD_DIR)/$(TARGET).elf -L$(BUILD_DIR)/ -lopencm3_stm32f1
all: libopencm3_stm32f1.a libs_rule drivers_rule os_rule system_rule tasks_rule crt.o main.o
$(LD) $(LDFLAGS) $(BUILD_DIR)/*.o -o $(BUILD_DIR)/$(TARGET).elf -L$(BUILD_DIR)/ -lopencm3_stm32f1 -lm
$(OBJCOPY) -O binary $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).bin
$(SIZE) $(BUILD_DIR)/$(TARGET).elf

Expand All @@ -34,10 +36,11 @@ flash:

.PHONY: clean
clean:
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/*.a $(BUILD_DIR)/*.elf $(BUILD_DIR)/*.bin
$(MAKE) clean -C hal
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/*.a $(BUILD_DIR)/*.elf $(BUILD_DIR)/*.bin $(BUILD_DIR)/*.map

main.o: main.c
$(CC) -c $(CFLAGS) -Ihal/include/ -DSTM32F1 $< -o $(BUILD_DIR)/$@
$(CC) -c $(CFLAGS) $< -o $(BUILD_DIR)/$@

crt.o: crt.s
$(AS) -o $@ $<
Expand All @@ -49,17 +52,17 @@ libopencm3_stm32f1.a: hal/Makefile
devices: devices/Makefile
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C devices

drivers: drivers/Makefile
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C drivers
drivers_rule: drivers/Makefile
$(MAKE) BUILD_DIR=$(BUILD_DIR) OPENCM3_FAMILY=$(OPENCM3_FAMILY) -C drivers

libs: libs/Makefile
libs_rule: libs/Makefile
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C libs

os: os/Makefile
os_rule: os/Makefile
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C os

system: system/Makefile
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C system
system_rule: system/Makefile
$(MAKE) BUILD_DIR=$(BUILD_DIR) OPENCM3_FAMILY=$(OPENCM3_FAMILY) -C system

tasks: tasks/Makefile
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C tasks
tasks_rule: tasks/Makefile
$(MAKE) BUILD_DIR=$(BUILD_DIR) OPENCM3_FAMILY=$(OPENCM3_FAMILY) -C tasks
62 changes: 60 additions & 2 deletions firmware/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,66 @@
# Firmware
<h1 align="center">
SLCAM FIRMWARE PROJECT
<br>
</h1>

<h4 align="center">Firmware project of the SLCam module.</h4>

<p align="center">
<a href="https://github.com/spacelab-ufsc/spacelab#versioning">
<img src="https://img.shields.io/badge/status-in%20development-red?style=for-the-badge">
</a>
<a href="https://github.com/spacelab-ufsc/slcam/releases">
<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/spacelab-ufsc/slcam?style=for-the-badge">
</a>
<a href="https://github.com/spacelab-ufsc/slcam/releases">
<img alt="GitHub commits since latest release (by date)" src="https://img.shields.io/github/commits-since/spacelab-ufsc/slcam/latest?style=for-the-badge">
</a>
<a href="https://github.com/spacelab-ufsc/slcam/commits/main">
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/spacelab-ufsc/slcam?style=for-the-badge">
</a>
<a href="https://github.com/spacelab-ufsc/slcam/issues">
<img alt="GitHub issues" src="https://img.shields.io/github/issues/spacelab-ufsc/slcam?style=for-the-badge">
</a>
<a href="https://github.com/spacelab-ufsc/slcam/graphs/contributors">
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/spacelab-ufsc/slcam?color=yellow&style=for-the-badge">
</a>
<a href="#license">
<img src="https://img.shields.io/badge/license-GPL3-yellow?style=for-the-badge">
</a>
</p>

<p align="center">
<a href="#overview">Overview</a> •
<a href="#dependencies">Dependencies</a> •
<a href="#compiling">Compiling and building</a> •
<a href="#flashing">Flashing</a> •
<a href="#license">License</a>
</p>

## Overview

The product tree of the firmware can be seen below:

<p align="center">
<img width="100%" src="https://github.com/spacelab-ufsc/slcam/blob/dev_firmware/firmware/doc/product-tree-fw.png">
</p>

## Dependencies

* arm-none-eabi tools
- st-link tools

### Installation on Ubuntu

```
sudo apt install gcc-arm-none-eabi stlink-tools
```

### Installation on Fedora

```
sudo dnf install gcc-arm-linux-gnu stlink
```

## Compiling and building

Expand All @@ -14,4 +72,4 @@

## License

The firmware of this project is licensed under GPLv3 license.
This repository containing firmware files is licensed under GPLv3 license.
12 changes: 6 additions & 6 deletions firmware/config/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( 32000000UL )
#define configLFXT_CLOCK_HZ ( 32768L )
#define configCPU_CLOCK_HZ ( 72000000UL )
#define configSYSTICK_CLOCK_HZ ( configCPU_CLOCK_HZ / 8U )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 75 * 1024 ) )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17U * 1024U ) )
#define configMAX_TASK_NAME_LEN ( 20 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
Expand Down Expand Up @@ -123,8 +123,8 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }

/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */
#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
#define xPortSysTickHandler SysTick_Handler
#define vPortSVCHandler sv_call_handler
#define xPortPendSVHandler pend_sv_handler
#define xPortSysTickHandler sys_tick_handler

#endif /* FREERTOS_CONFIG_H */
45 changes: 45 additions & 0 deletions firmware/config/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* config.h
*
* Copyright The SLCam Contributors.
*
* This file is part of SLCam.
*
* SLCam 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.
*
* SLCam 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 SLCam. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* \brief Configuration parameters definition.
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.2.7
*
* \date 2024/01/13
*
* \defgroup config Configuration
* \{
*/

#ifndef CONFIG_H_
#define CONFIG_H_

/* Tasks */
#define CONFIG_TASK_HEARTBEAT_ENABLED 1
#define CONFIG_STARTUP_ENABLED 1

#endif /* CONFIG_H_ */

/** \} End of config group */
53 changes: 53 additions & 0 deletions firmware/config/errno.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* errno.h
*
* Copyright The SLCam Contributors.
*
* This file is part of SLCam.
*
* SLCam 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.
*
* SLCam 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 SLCam. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* \brief Errors definition.
*
* \author Miguel Boing <miguelboing13@gmail.com>
*
* \version 0.1.3
*
* \date 2023/02/16
*
* \defgroup errno Error Codes
* \{
*/

#ifndef ERRNO_H
#define ERRNO_H

/* No error ocurred */
#define ERRNO_SUCCESS 0x00U /** No errors found */

/* Driver Level errors */
#define ERRNO_DRIVER_NO_PORT 0x11U /** No port found */
#define ERRNO_DRIVER_NO_PARAMETER 0x12U /** Invalid parameter value */
#define ERRNO_DRIVER_FAILED 0x13U /** Failed to execute HAL function */

/* Device Level errors */
#define ERRNO_DEVICE_FAILED_CONFIG 0x21U /** Failed to configure driver */
#define ERRNO_DEVICE_FAILED_COM 0x22U /** Failed to communicate */

#endif /*ERRNO_H */

/** \} End of errno group */
1 change: 1 addition & 0 deletions firmware/doc/product-tree-fw.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="Electron" modified="2023-07-29T00:03:03.938Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/20.3.0 Chrome/104.0.5112.114 Electron/20.1.3 Safari/537.36" etag="8b7f1caCGSfaGqh31Htp" version="20.3.0" type="device"><diagram id="0qJPchqlG3AJ2SKAlhdZ" name="Page-1">7V1bd5pKFP41eWwXMHJ7TLVpcpo0abW5PHVRnSorKC7Eqv31B4+guLeKUmZmh2NWHmREHD++vWffZnPBmsP5p8gbD+7CHg8uDK03v2CtC8PQG4ZxsfzXeovViGOz1UA/8nvpSZuBtv+Hp4NaOjr1e3yydWIchkHsj7cHu+FoxLvx1pgXReFs+7RfYbD9rWOvz9FAu+sFePTJ78WD1ShjmrZ545r7/UH61clb7uqdoZednZ46GXi9cJYbYh8vWDMKw3j1ajhv8mCJXgbM6nNXe95dzyzio/iYD8w+R+9azWG78/3l8c/13Hz82v/nXXqV314wTX9xK/J/82iSzjleZEhE4XTU48tr6Rfsw2z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oGcH6zLj1TuBqueyUeYBOod4RET8DVCz7JbdBgOf12qg50sJe35OxS7yoQqtfLLK/xl5kU/B59NU7h/eCdee53IoB0rlxuGdQOFV5daP44Bfqd++j9CSGkrYiRaxPQWnLUdHLS2HlE9hGSmx+jlU9Va2cf3GqMkWF0Gd61HJX9We9s7bRmyPADVW0zKYdM0GrC7bOkDXgSXDBPUOQKyu2m/fedvONf8F+79o8XrdXy9TsWUdAWSNrmuMVRc7w7BB1cXOO8UAe8MtL/aSEQrFbrixvHITj0ywby+8hZLdINbrprqmnNqeXpnCm3JW/uxnr3n5+PIQ/LB+xHPdM0eDLx8fsxBOvkNf8/ILY/MqBBVJ5Q5yHR3mk/rwtZ1Y4YCIUjkFslZZCG8/T5SJMwx+ly0vhRE7W1DaCAbs/rLBbnIYhWGcPz2RuMFd2OPLM/4F</diagram></mxfile>
Binary file added firmware/doc/product-tree-fw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions firmware/drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ ifndef BUILD_DIR
BUILD_DIR=$(CURDIR)
endif

ifndef OPENCM3_FAMILY
OPENCM3_FAMILY=STM32F1
endif

.PHONY: all
all:
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C ov2640
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C w25qxxx
# $(MAKE) BUILD_DIR=$(BUILD_DIR) -C ov2640
# $(MAKE) BUILD_DIR=$(BUILD_DIR) -C w25qxxx
$(MAKE) BUILD_DIR=$(BUILD_DIR) OPENCM3_FAMILY=$(OPENCM3_FAMILY) -C can
$(MAKE) BUILD_DIR=$(BUILD_DIR) OPENCM3_FAMILY=$(OPENCM3_FAMILY) -C uart

.PHONY: clean
clean:
Expand Down
31 changes: 31 additions & 0 deletions firmware/drivers/can/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
TARGET=can

ifndef BUILD_DIR
BUILD_DIR=$(CURDIR)
endif

ifndef OPENCM3_FAMILY
OPENCM3_FAMILY=STM32F1
endif

CC=arm-none-eabi-gcc
CPP=arm-none-eabi-g++
AS=arm-none-eabi-as
LD=arm-none-eabi-ld
OBJCOPY=arm-none-eabi-objcopy
OBJDUMP=arm-none-eabi-objdump
READELF=arm-none-eabi-readelf
NM=arm-none-eabi-nm
SIZE=arm-none-eabi-size
GDB=arm-none-eabi-gdb

LIBS= -I../../ -I../../hal/include/
CFLAGS=-c -mcpu=cortex-m3 -mthumb -O0 $(LIBS) -D$(OPENCM3_FAMILY)

.PHONY: all
all:
$(CC) $(CFLAGS) $(TARGET).c -o $(BUILD_DIR)/$(TARGET).o

.PHONY: clean
clean:
rm $(BUILD_DIR)/*.o
Loading

0 comments on commit 4bdd2c7

Please sign in to comment.