Skip to content

Commit

Permalink
Add support for UHF SDR & OpenLST
Browse files Browse the repository at this point in the history
  • Loading branch information
bcwaldon committed Sep 27, 2024
1 parent 091c821 commit 71bf486
Show file tree
Hide file tree
Showing 767 changed files with 164,220 additions and 16,861 deletions.
6 changes: 3 additions & 3 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1885,15 +1885,15 @@ ENABLE_PREPROCESSING = YES
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

MACRO_EXPANSION = NO
MACRO_EXPANSION = YES

# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

EXPAND_ONLY_PREDEF = NO
EXPAND_ONLY_PREDEF = YES

# If the SEARCH_INCLUDES tag is set to YES the includes files in the
# INCLUDE_PATH will be searched if a #include is found.
Expand Down Expand Up @@ -1925,7 +1925,7 @@ INCLUDE_FILE_PATTERNS = *.c *.cpp *.h
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED =
PREDEFINED = __attribute__((packed))=

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# @copyright Copyright 2022 Antaris, Inc.
# @copyright Copyright 2024 Antaris, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,6 +42,10 @@ INCLUDES =

SUBDIR += drivers
SUBDIR += exo_os
SUBDIR += exo_services
SUBDIR += exo_lib
SUBDIR += exo_stack
SUBDIR += exo_fw

##############################################################################

Expand Down Expand Up @@ -95,7 +99,7 @@ all: top_obj_dirs $(OBJS)
ifneq ($(SUBDIR),)
$(HIDE)$(MAKE) subdir_all
endif
$(HIDE)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $(TOP_DIR)/$(OBJ_DIR)/*.o -o $(TARGET).$(EXT)
$(HIDE)$(CC) $(CFLAGS) $(LDFLAGS) $(TOP_DIR)/$(OBJ_DIR)/*.o -o $(TARGET).$(EXT) $(LIBS)
$(SIZE) -A -d $(TARGET).$(EXT)

# Command to delete intermediate object files
Expand Down
145 changes: 69 additions & 76 deletions Makefile.def
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,31 @@
ENVIRONMENT=1

#############################################################
# 65Z - refers to STM32F765ZI development board
# 69N - refers to STM32F769NI discovery development board
# 65N - refers to Target hardware STM32F765NIH6 (Core Board)
# STM32_DISCO_F769NI - refers to STM32F769NI discovery development board
# GEN1 - refers to Target hardware STM32F765NIH6 (Core Board)

BOARD=65N
BOARD=GEN1

#############################################################
# 4 - print from UART 4 in Coreboard
# 5 - print from UART 5 in Coreboard
# 0 - Disable GS Backdoor sock
# 1 - Enable GS Backdoor sock

ENABLE_BACKDOOR_SOCKET =1

##############################################################
#0 - Which enables USB/Ethernet via UDP with LibCSP
#1 - Which enables USB/Ethernet via TCP with LibCSP

# This is used to select UDP/TCP protocol to be used between GS and OBC while connected with
# Ethernet or USB. This should be UDP while connected to S-Band module.

GS_OBC_TCP=1

#############################################################
# 1 - print from UART 5 in Coreboard
# 0 - Disable print in Coreboard

PRINT_ENB=4
PRINT_ENB=0

#############################################################
# 0 - Watchdog timer disable
Expand All @@ -38,35 +51,7 @@ BOOTLOADER=0
# When CAN_BYPASS_SOCK_ENB=0,This will not impact any common functionality
# When CAN_BYPASS_SOCK_ENB= , this decides which IP (USB/Ethernet) to be listern
# Default to all USB, as we must need to support via USB for PS TC TM Interface
GS_OBC_VIA_USB=1
##############################################################
#0 - Which enables PS via USB
#1 - Which enables PS via Ethernet

# This is not a common use case, only need if PS sim is running via ethernet
PS_OBC_VIA_ETH=0
##############################################################
# Core board acts as sim mode address to connect with disco brd simulator when enabled, disabled needs real s_band module setup
CORE_BRD_S_BAND_SIM_SETUP=0

# Enabled only for disco board and it will act like ethernet to can convertor only. so OBC func may not work when enabled.
DISCO_BRD_ETH_CAN_SIM_SETUP=0

# Enabled only for bypassing CAN interface and seng data through socket(ETH) interface from core board or EVB board
CAN_BYPASS_SOCK_ENB=0

#############################################################

# 1 - Turn on HRM by default during power on
# 0 - HRM is not truned on by default during power on

EPS_HRM_ON_DFLT=1
#############################################################

# 1 - Turn on Payload server and GPS by default during power on
# 0 - Payload server and GPS is not truned on by default during power on

EPS_PS_ON_DFLT=0
GS_OBC_VIA_USB=0
#############################################################

# 1 - Heat sink will not be turned on
Expand All @@ -84,6 +69,16 @@ SCANF_ENB =1

IGNORE_OPT =0
#############################################################
# 1 - Enable UHF Bypass
# 0 - Enable UHF hardware in linux via UART

UHF_HW_BYPASS =0
#############################################################
# 0 - Disable ethernet speed to 10MHz
# 1 - Enable ethernet speed to 10MHz

ETH_10MHZ_EN=0
#############################################################

# Clear All previous CFLAGS settings
CFLAGS :=
Expand All @@ -107,7 +102,7 @@ OPT = -O2
endif

PROJ_NAME = antaris_exo_core
TARGET = antaris_exo_core
TARGET = bin/antaris_exo_core

MKDIR = mkdir -p
RM = rm -rf
Expand Down Expand Up @@ -144,14 +139,6 @@ ifeq ($(WDT_ENB),1)
CFLAGS += -DWDT_ENABLE
endif

ifeq ($(EPS_HRM_ON_DFLT),1)
CFLAGS += -DEPS_HRM_ON_DFLT
endif

ifeq ($(EPS_PS_ON_DFLT),1)
CFLAGS += -DEPS_PS_ON_DFLT
endif

ifeq ($(HEAT_SINK_DISABLE),1)
CFLAGS += -DHEAT_SINK_DISABLE
endif
Expand All @@ -160,18 +147,16 @@ ifeq ($(BOOTLOADER),1)
CFLAGS += -DBTLR_ON
endif

ifeq ($(CAN_BYPASS_SOCK_ENB),1)
CFLAGS += -DCAN_BYPASS
endif

ifeq ($(GS_OBC_VIA_USB),1)
CFLAGS += -DGSOBC_USB_EN
endif

ifeq ($(PS_OBC_VIA_ETH),1)
CFLAGS += -DPSOBC_ETH_EN
ifeq ($(BOARD),STM32_DISCO_F769NI)
CFLAGS += -DCOMMS_UART6_ENB
endif
ifeq ($(ETH_10MHZ_EN),1)
CFLAGS += -DETH_10MHZ_EN
endif


ifeq ($(ENVIRONMENT),1)
CFLAGS += -DUSB_IP_ADDR0=190
Expand All @@ -184,41 +169,37 @@ ifeq ($(ENVIRONMENT),1)
CFLAGS += -DETH_IP_ADDR2=1
CFLAGS += -DETH_IP_ADDR3=111

CFLAGS += -DPS_SRVR_PORT=6565
CFLAGS += -DETH_MAC_ADDR0=0x00
CFLAGS += -DETH_MAC_ADDR1=0x80
CFLAGS += -DETH_MAC_ADDR2=0xE1
CFLAGS += -DETH_MAC_ADDR3=0x00
CFLAGS += -DETH_MAC_ADDR4=0x00
CFLAGS += -DETH_MAC_ADDR5=0x00

CFLAGS += -DUSB_MAC_ADDR0=0x00U
CFLAGS += -DUSB_MAC_ADDR1=0x02U
CFLAGS += -DUSB_MAC_ADDR2=0x02U
CFLAGS += -DUSB_MAC_ADDR3=0x03U
CFLAGS += -DUSB_MAC_ADDR4=0x00U
CFLAGS += -DUSB_MAC_ADDR5=0x00U

CFLAGS += -DGS_SRVR_PORT=6767
endif


ifeq ($(BOARD),65Z)
# Additional compilation flags that could be enabled
CFLAGS += -g3 $(OPT) -Wall $(MCU) -DDEBUG -DUSE_HAL_DRIVER -DSTM32F765xx \
-DCMSIS_RTOS_V2 -DFT_OBC -DFT_SAT -I$(TOP_DIR)/includes -I$(TOP_DIR) -DCSP_FREERTOS=1 \
-Wno-implicit-function-declaration

else ifeq ($(BOARD),69N)
ifeq ($(BOARD),STM32_DISCO_F769NI)
#Additional compilation flags that could be enabled
CFLAGS += -g3 $(OPT) -Wall $(MCU) -DDEBUG -DUSE_HAL_DRIVER -DSTM32F769xx \
-DCMSIS_RTOS_V2 -DFT_OBC -DFT_SAT -I$(TOP_DIR)/includes -I$(TOP_DIR) -DCSP_FREERTOS=1 \
-Wno-implicit-function-declaration

ifeq ($(DISCO_BRD_ETH_CAN_SIM_SETUP),1)
CFLAGS += -DS_BAND_SIM
endif

else ifeq ($(BOARD),65N)
else ifeq ($(BOARD),GEN1)

CFLAGS += -g3 $(OPT) -Wall $(MCU) -DDEBUG -DUSE_HAL_DRIVER -DSTM32F765xx -DCOREBOARD \
-DCMSIS_RTOS_V2 -DFT_OBC -DFT_SAT -I$(TOP_DIR)/includes -I$(TOP_DIR) -DCSP_FREERTOS=1 \
-Wno-implicit-function-declaration

ifeq ($(CORE_BRD_S_BAND_SIM_SETUP),1)
CFLAGS += -DS_BAND_SIM_CB
endif


ifeq ($(PRINT_ENB),4)
CFLAGS += -DPRINT_UART_4
else ifeq ($(PRINT_ENB),5)
ifeq ($(PRINT_ENB),1)
CFLAGS += -DPRINT_UART_5
endif
endif
Expand All @@ -243,6 +224,9 @@ LDFLAGS = $(MCU) -specs=nano.specs -specs=nosys.specs -T$(LDSCRIPT) -Wl,-Map=$(T
-L exo_lib/security/mbedtls/library/obj/\

else
ifeq ($(UHF_HW_BYPASS),1)
CFLAGS += -DUHF_HW_BYPASS
endif

# Target file name and extension type
EXT = exe
Expand All @@ -256,8 +240,7 @@ SIZE = size
LD = ld

# Additional compilation flags that could be enabled
CFLAGS += -g3 $(OPT) -lpthread -Wall -DDEBUG -DLINUX_TEMP_PORT -DFT_OBC -DFT_SAT -I$(TOP_DIR)/includes -I$(TOP_DIR) -DCSP_POSIX=1 -std=gnu99
CFLAGS += -DCAN_BYPASS
CFLAGS += -g3 $(OPT) -lpthread -ljansson -Wall -DDEBUG -DLINUX_TEMP_PORT -DFT_OBC -DFT_SAT -I$(TOP_DIR)/includes -I$(TOP_DIR) -DCSP_POSIX=1 -std=gnu99

ifeq ($(SCANF_ENB),1)
CFLAGS += -DSCANF_ENB
Expand All @@ -269,13 +252,23 @@ LDFLAGS = -L exo_lib/exo_ipcc/\
-L exo_lib/security/hmac/obj/\
-L exo_lib/security/mbedtls/library/obj/

LIBS = -lc -lm
LIBS = -lc -lm -ljansson

ifneq ($(SINGLE_MAKE),1)
LIBS += -lipcc_lib -lcrc -lhmac -lmbedcrypto
endif

endif
ifeq ($(ENABLE_BACKDOOR_SOCKET),1)
CFLAGS += -DBACKDOOR_SOCK_ENB
endif

ifeq ($(GS_OBC_TCP),1)
CFLAGS += -DGSOBC_TCP_EN
else
CFLAGS += -UGSOBC_TCP_EN
endif


MAKE = make -k $(MAKE_FLAGS)

Expand Down
41 changes: 32 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SatOS-HAL

This repository contains the SatOS(TM) hardware abstraction layer (HAL), which has been developed by [Antaris, Inc](https://antaris.space).
This repository contains the SatOS(TM) hardware abstraction layer (HAL) and UHF specific SDR interfaces, which has been developed by [Antaris, Inc](https://antaris.space).
This abstracts individual satellite components for use by SatOS flight software.

Please engage with the maintainers here through issues and pull requests.
Expand All @@ -12,6 +12,31 @@ It is provided without any guarantee or warranty, and you may use it at your own
Some other open source components have been used within this project. Their licenses are embedded within this repo
alongside the open source code.

## UHF SDR Support

This repository includes full SW support for satellite communications via UHF SDR modules.
This may be used to interface any OBC with any UHF radio, provided the necessary abstraction layer is implemented.
Key features include:
* Periodic UHF beacon transmission
* Periodic UHF health metric retrieval and transmission
* APIs for beacon content/period customization
* Extensible TC & TM framework
* Back door socket (used to facilitate development)

Onboard computer (OBC) support is available for:
* STM32 dev kit (discovery board
* [Antaris Core OBC](https://github.com/antaris-inc/Satellite-Design-Library?tab=readme-ov-file#core-board-gen-1)
* Generic x86 Platform

Tested operating systems include FreeRTOS, CentOS and Ubuntu.

Please find comprehensive documentation here: [SatOS UHF SDR Guide](./docs/SatOS UHF User Guide.pdf).

### OpenLST

The [OpenLST SDR](https://github.com/openlst/openlst) is fully supported here is completey open source (software and hardware).
This flight qualified system is highly recommended for anyone considering a UHF radio for their satellite mission.

## Documentation

Docs are automatically built from the source and published using Github Pages.
Expand All @@ -24,17 +49,15 @@ On an Ubuntu 22.04 machine, you can easily `apt install doxygen` then `doxygen D

The build process is supported on Ubuntu 22.04 x86_64:

1. Download the appropriate ARM toolchain from https://developer.arm.com/downloads/-/gnu-rm. Specific toolchain in use
is `arm-none-eabi-gcc` at version `9-2020-q2-update`.
1. First, install system dependencies: `apt install bzip2 make g++ libjansson-dev`

2. Unpack the ARM toolchain into /usr/share: tar -C /usr/share gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
2. Download the appropriate ARM toolchain from https://developer.arm.com/downloads/-/gnu-rm. Specific toolchain in use
is `arm-none-eabi-gcc` at version `9-2020-q2-update`.

3. Add the downloaded toolchain to your PATH:
3. Unpack the ARM toolchain into /usr/share: `tar -C /usr/share -xf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2`

```
export PATH=/usr/share/gcc-arm-none-eabi-9-2020-q2-update/bin/:$PATH
```
4. Add the downloaded toolchain to your PATH: `export PATH=/usr/share/gcc-arm-none-eabi-9-2020-q2-update/bin/:$PATH`

4. Run `make all`
5. Run `make all`

Note that this is documented in the CI process artifacts, so they are also good references.
13 changes: 13 additions & 0 deletions bin/obc_soc_cfg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"subsystem":[
{
"name":"OBC<->UHF",
"ip_address":"127.0.0.1",
"port":9130
},
{
"name":"LNX_UART_COM_PORT",
"com_port":"/dev/ttyUSB0"
}
]
}
Binary file added bin/uhf_tc_tm_sample_app_bk
Binary file not shown.
Binary file added bin/uhf_tc_tm_sample_app_gs
Binary file not shown.
5 changes: 3 additions & 2 deletions drivers/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# @copyright Copyright 2022 Antaris, Inc.
# @copyright Copyright 2024 Antaris, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,11 +42,12 @@ SUBDIR += exo_hal_driver_fw
ifeq ($(ENVIRONMENT),1)
SUBDIR += io_drivers
SUBDIR += ahw_drivers
SUBDIR += bsp
endif

ifeq ($(ENVIRONMENT),0)
#SUBDIR += io_drivers
SUBDIR += ahw_drivers
SUBDIR += bsp/linux
endif

##############################################################################
Expand Down
Loading

0 comments on commit 71bf486

Please sign in to comment.