Skip to content

Commit

Permalink
Merge pull request #232 from arkedge/develop
Browse files Browse the repository at this point in the history
Update main (v4.1.0) on 2023-12-11
  • Loading branch information
meltingrabbit authored Dec 11, 2023
2 parents 059c679 + 7bd7a80 commit c1a33f9
Show file tree
Hide file tree
Showing 98 changed files with 1,093 additions and 701 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_with_s2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
# renovate: datasource=github-releases depName=ut-issl/s2e-core
S2E_CORE_VERSION: v7.0.1
S2E_CORE_VERSION: v7.1.0

jobs:
build_s2e_win:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/deploy-reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy C2A Reference

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

concurrency:
group: "pages"

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: install deps
run: |
sudo apt-get update -y
sudo apt install -y doxygen graphviz
- uses: actions/[email protected]

- name: C2A setup
run: ./setup.sh

- name: Build Doxygen
run: doxygen

- uses: actions/[email protected]
with:
path: docs/html

deploy:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

permissions:
pages: write
id-token: write
runs-on: ubuntu-22.04
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]
7 changes: 5 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ jobs:
- name: cache dependencies
uses: Swatinem/[email protected]

- name: setup c2a-core
run: ./setup.sh

- name: reviewdog / clippy
uses: sksat/[email protected]
with:
reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }}
clippy_flags: --all-features
clippy_flags: --workspace --all-features

- name: format
run: cargo fmt --all -- --check

- name: unit test
run: cargo test
run: cargo test --workspace
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ tlmcmddb*.json
# Added by cargo
/target
/Cargo.lock

# Doxygen
doxygen.log
docs/html/
137 changes: 124 additions & 13 deletions CHANGELOG.md

Large diffs are not rendered by default.

21 changes: 18 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ option(C2A_USE_ALL_CORE_APPS "Use C2A-core all Applications" ON)
option(C2A_USE_ALL_CORE_TEST_APPS "Use C2A-core all Test Applications" ON)
option(C2A_USE_ALL_CORE_LIB "Use C2A-core all library" ON)

## C2A CCSDS select
# See alse; /docs/core/ccsds.md
option(C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL "Use C2A-core CCSDS AOS SPACE DATA LINK PROTOCOL implementation" OFF)
option(C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL "Use C2A-core CCSDS TC SPACE DATA LINK PROTOCOL implementation" OFF)

option(C2A_USE_SIMPLE_LIBC "Use C2A-core hosted simple libc (c2a-core/library/libc) implementation" OFF)

set(C2A_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down Expand Up @@ -53,9 +58,9 @@ set(C2A_SRCS
tlm_cmd/packet_list.c
tlm_cmd/telemetry_frame.c
tlm_cmd/telemetry_generator.c
tlm_cmd/ccsds/cmd_space_packet.c
tlm_cmd/ccsds/space_packet.c
tlm_cmd/ccsds/tlm_space_packet.c
tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.c
tlm_cmd/ccsds/space_packet_protocol/space_packet.c
tlm_cmd/ccsds/space_packet_protocol/tlm_space_packet.c
)

if(C2A_USE_STDINT_WRAPPER)
Expand Down Expand Up @@ -99,4 +104,14 @@ if(C2A_USE_ALL_CORE_LIB)
target_sources(${PROJECT_NAME} PUBLIC $<TARGET_OBJECTS:C2A_CORE_LIB>)
endif()

if(C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL)
add_subdirectory(tlm_cmd/ccsds/aos_space_data_link_protocol)
target_sources(${PROJECT_NAME} PUBLIC $<TARGET_OBJECTS:C2A_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL>)
endif()

if(C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL)
add_subdirectory(tlm_cmd/ccsds/tc_space_data_link_protocol)
target_sources(${PROJECT_NAME} PUBLIC $<TARGET_OBJECTS:C2A_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL>)
endif()

include(common.cmake)
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "4.0.1"
version = "4.1.0"

[workspace]
resolver = "2"
Expand Down Expand Up @@ -32,8 +32,6 @@ name = "c2a-core"
version.workspace = true
edition = "2021"

links = "c2a-core"

description = "Core of Command Centric Architecture"
readme = "README.md"
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions examples/mobc/Doxyfile → Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = ../../../../docs/c2a-core
OUTPUT_DIRECTORY = docs/

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down Expand Up @@ -918,7 +918,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE =
EXCLUDE = library/stdint_wrapper/

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down Expand Up @@ -2220,7 +2220,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.

INCLUDE_PATH =
INCLUDE_PATH = examples/mobc/src/

# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
Expand Down
6 changes: 3 additions & 3 deletions applications/memory_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ CCP_CmdRet Cmd_MEM_DUMP_REGION_SEQ(const CommonCmdPacket* packet)
if (num_dumps >= 8)
{
// パケット生成回数の上限は8回とする。
// 32kbpsでのDL時に8VCDU/secで1秒分の通信量。
// 32kbpsでのDL時に8AOSTF/secで1秒分の通信量。
// これを超える場合は複数回コマンドを送信して対応する。
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER);
}
Expand All @@ -132,7 +132,7 @@ CCP_CmdRet Cmd_MEM_DUMP_REGION_RND(const CommonCmdPacket* packet)
if (num_dumps >= 8)
{
// パケット生成回数の上限は8回とする。
// 32kbpsでのDL時に8VCDU/secで1秒分の通信量。
// 32kbpsでのDL時に8AOSTF/secで1秒分の通信量。
// これを超える場合は複数回コマンドを送信して対応する。
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER);
}
Expand Down Expand Up @@ -170,7 +170,7 @@ CCP_CmdRet Cmd_MEM_DUMP_SINGLE(const CommonCmdPacket* packet)
if (num_dumps >= 8)
{
// パケット生成回数の上限は8回とする。
// 32kbpsでのDL時に8VCDU/secで1秒分の通信量。
// 32kbpsでのDL時に8AOSTF/secで1秒分の通信量。
// これを超える場合は複数回コマンドを送信して対応する。
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER);
}
Expand Down
13 changes: 11 additions & 2 deletions applications/timeline_command_dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ CCP_CmdRet Cmd_TLCD_DEPLOY_BLOCK(const CommonCmdPacket* packet)
TLCD_ID id = (TLCD_ID)CCP_get_param_from_packet(packet, 0, uint8_t);
bct_id_t block_no = CCP_get_param_from_packet(packet, 1, bct_id_t);
PL_ACK ack;
const uint32_t note = ((0x000000ff & id) << 24) | (0x00ffffff & block_no);

if (CCP_get_param_len(packet) != (1 + SIZE_OF_BCT_ID_T))
{
Expand All @@ -276,12 +277,20 @@ CCP_CmdRet Cmd_TLCD_DEPLOY_BLOCK(const CommonCmdPacket* packet)

ack = PL_deploy_block_cmd(&(PH_tl_cmd_list[id]), block_no, TMGR_get_master_total_cycle());

if (ack != PL_SUCCESS)
if (ack == PL_BC_LIST_CLEARED)
{
EL_record_event((EL_GROUP)EL_CORE_GROUP_TLCD_DEPLOY_BLOCK,
(uint32_t)PL_BC_LIST_CLEARED,
EL_ERROR_LEVEL_HIGH,
note);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_CONTEXT, (uint32_t)ack);
}
else if (ack != PL_SUCCESS)
{
EL_record_event((EL_GROUP)EL_CORE_GROUP_TLCD_DEPLOY_BLOCK,
(uint32_t)ack,
EL_ERROR_LEVEL_LOW,
(uint32_t)( ((0x000000ff & id) << 24) | (0x00ffffff & block_no) ));
note);
if (ack == PL_BC_TIME_ADJUSTED)
{
return CCP_make_cmd_ret(CCP_EXEC_SUCCESS, (uint32_t)ack);
Expand Down
2 changes: 0 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use semver::Version;
use clang::{token::TokenKind::Punctuation, Clang, Index};

fn main() {
println!("cargo:source_dir={}", env!("CARGO_MANIFEST_DIR"));

let ver = env!("CARGO_PKG_VERSION");
let ver = Version::parse(ver).unwrap();
dbg!(&ver);
Expand Down
4 changes: 2 additions & 2 deletions c2a_core_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ void C2A_core_main(void);
// これらの番号は,リリース時に手動で合わせる
// 詳細: docs/general/release.md
#define C2A_CORE_VER_MAJOR (4)
#define C2A_CORE_VER_MINOR (0)
#define C2A_CORE_VER_PATCH (1)
#define C2A_CORE_VER_MINOR (1)
#define C2A_CORE_VER_PATCH (0)
#define C2A_CORE_VER_PRE ("")

#endif
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ C2A に関する説明の棲み分けは,次のようになっています.
1. Core Layer
1. Overview
1. [Communication](./core/communication.md)
1. [CCSDS](./core/ccsds.md)
1. [Tips](./core/tips.md)
1. Component Driver
1. [Overview](./component_driver/overview.md)
Expand Down
24 changes: 24 additions & 0 deletions docs/core/ccsds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CCSDS

## 概要
C2A Core に実装された CCSDS (Consultative Committee for Space Data Systems) によって規定される宇宙データシステムの標準規格 Space Communications Protocols についてまとめる.
CCSDS 技術仕様文書は [ブルーブック(Blue Books):全85文書](https://stage.tksc.jaxa.jp/ccsds/docs/doc_blue.html) を参照すること.


## Space Packet Protocol
[`tlm_cmd/ccsds/space_packet_protocol`](/tlm_cmd/ccsds/space_packet_protocol/) に配置される.

[Core/Communication.md#c2a-標準-space-packet-定義](./communication.md#c2a-標準-space-packet-定義) などを参照のこと.


## AOS Space Data Link Protocol / TC Space Data Link Protocol
[`tlm_cmd/ccsds/aos_space_data_link_protocol`](/tlm_cmd/ccsds/aos_space_data_link_protocol/), [`tlm_cmd/ccsds/tc_space_data_link_protocol`](/tlm_cmd/ccsds/tc_space_data_link_protocol/) に配置される.

基本的には,地上局と通信する無線機 (STX や SRX) に接続される OBC (MOBC など) 向けのコードとなる.

AOS Space Data Link Protocol や TC Space Data Link Protocol は,様々な設計パラメタがあるが,ここでのコードは,ある特定の設計パラメタにおける実装であることに注意すること.
したがって,現時点では汎用性の低いコードが配置されている.
(今後,適切にリファクタリングする予定.)

また,本コードをコンパイル対象に加えると,少なくない RAM を static に確保してしまうため,デフォルトではコンパイル対象には含まれない.
コンパイル対象に含める場合は, FIXME: で設定すること.
6 changes: 3 additions & 3 deletions docs/core/communication.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ https://github.com/arkedge/c2a-core/blob/45d78a05c339c285b5aa0c2fcbf57c1b105137e
- BC: GS から MOBC に届き, MOBC で BC 登録されずに,そのまま AOBC へ配送される.配送時, Destination Type は自分宛 (TO_ME) に上書きされ, AOBC で BC として登録 & 実行される.
- 地上局 SW での実装まとめ
- MOBC 宛
- APID: APID_MOBC_CMD
- APID: APID_CMD_TO_MOBC
- CCP_DEST_TYPE: CCP_DEST_TYPE_TO_ME
- AOBC 宛(AOBC 直送)
- APID: APID_AOBC_CMD
- APID: APID_CMD_TO_AOBC
- CCP_DEST_TYPE: CCP_DEST_TYPE_TO_AOBC
- AOBC 宛(MOBC でキューに入り,実行時に AOBC に転送)
- APID: APID_AOBC_CMD
- APID: APID_CMD_TO_AOBC
- CCP_DEST_TYPE: CCP_DEST_TYPE_TO_ME


Expand Down
Loading

0 comments on commit c1a33f9

Please sign in to comment.