fix some issues and test on hw

This commit is contained in:
Robin Müller 2022-05-29 17:35:32 +02:00
parent eccf453415
commit ff3a95efa6
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
13 changed files with 94 additions and 137 deletions

@ -1 +1 @@
Subproject commit 5975bffae9358bc2b2890a35a203d940a395efef
Subproject commit b340b13929e36a3427b8d94e8b1006022f82273f

View File

@ -98,7 +98,7 @@ a lot of data that needs to be copied, this should be set high. */
#define PBUF_POOL_SIZE 4
/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
#define PBUF_POOL_BUFSIZE 1528
#define PBUF_POOL_BUFSIZE 1536
/* LWIP_SUPPORT_CUSTOM_PBUF == 1: to pass directly MAC Rx buffers to the stack
no copy is needed */
@ -232,12 +232,12 @@ The STM32H7xx allows computing and verifying the IP, UDP, TCP and ICMP checksums
*/
#define TCPIP_THREAD_NAME "TCP/IP"
#define TCPIP_THREAD_STACKSIZE 1000
#define TCPIP_THREAD_STACKSIZE 2048
#define TCPIP_MBOX_SIZE 6
#define DEFAULT_UDP_RECVMBOX_SIZE 6
#define DEFAULT_TCP_RECVMBOX_SIZE 6
#define DEFAULT_ACCEPTMBOX_SIZE 6
#define DEFAULT_THREAD_STACKSIZE 500
#define DEFAULT_THREAD_STACKSIZE 1024
#define TCPIP_THREAD_PRIO osPriorityHigh
/*

View File

@ -8,7 +8,6 @@
#if OBSW_ADD_LWIP_COMPONENTS == 1
#include "example_common/stm32h7/networking/app_ethernet.h"
#include "example_common/stm32h7/networking/ethernetif.h"
#include <app_ethernet.h>
#include <lwip/init.h>
#include <lwip/ip_addr.h>
#include <lwip/netif.h>
@ -16,13 +15,13 @@
#endif
#include <boardconfig.h>
#include <stdio.h>
#include <cstdio>
/* Forward declarations */
void MPU_Config(void);
void SystemClock_Config(void);
void BSP_Config(void);
void CPU_CACHE_Enable(void);
void MPU_Config();
void SystemClock_Config();
void BSP_Config();
void CPU_CACHE_Enable();
void MX_USART3_UART_Init(uint32_t baudRate);
/**
@ -113,7 +112,7 @@ void MX_USART3_UART_Init(uint32_t baudRate) {
* @param None
* @retval None
*/
void SystemClock_Config(void) {
void SystemClock_Config() {
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_OscInitTypeDef RCC_OscInitStruct;
HAL_StatusTypeDef ret = HAL_OK;
@ -176,7 +175,7 @@ value regarding system frequency refer to product datasheet. */
}
/*Configure the MPU attributes */
void MPU_Config(void) {
void MPU_Config() {
MPU_Region_InitTypeDef MPU_InitStruct;
/* Disable the MPU */
@ -219,7 +218,7 @@ for LwIP RAM heap which contains the Tx buffers */
}
/*CPU L1-Cache enable*/
void CPU_CACHE_Enable(void) {
void CPU_CACHE_Enable() {
/* Enable I-Cache */
SCB_EnableICache();
@ -227,7 +226,7 @@ void CPU_CACHE_Enable(void) {
SCB_EnableDCache();
}
void BSP_Config(void) {
void BSP_Config() {
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
@ -253,8 +252,8 @@ void Netif_Config(void) {
/* add the network interface */
struct netif *netif_valid =
netif_add(&gnetif, (ip4_addr_t *)&ipaddr, (ip4_addr_t *)&netmask,
(ip4_addr_t *)&gw, NULL, &ethernetif_init, &ethernet_input);
if (netif_valid == NULL) {
(ip4_addr_t *)&gw, nullptr, &ethernetif_init, &ethernet_input);
if (netif_valid == nullptr) {
printf("Error: netif initialization failed!\n\r");
return;
}

View File

@ -22,6 +22,8 @@ void assemlyDemo();
void InitMission::createTasks() {
TaskFactory *taskFactory = TaskFactory::instance();
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
static_cast<void>(taskFactory);
static_cast<void>(result);
#if OBSW_ADD_CORE_COMPONENTS == 1
/* TMTC Distribution */
PeriodicTaskIF *distributerTask =

View File

@ -1,21 +1,14 @@
#include "ObjectFactory.h"
#include "OBSWConfig.h"
#include "devices/devAddresses.h"
#include "hardware_init.h"
#include "objects/systemObjectList.h"
#include "example/core/GenericFactory.h"
#include "example/utility/TmFunnel.h"
#include "example_common/stm32h7/STM32TestTask.h"
#include "example_common/stm32h7/networking/TmTcLwIpUdpBridge.h"
#include "example_common/stm32h7/networking/UdpTcLwIpPollingTask.h"
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
#include "fsfw/monitoring/MonitoringMessageContent.h"
#include "fsfw/storagemanager/PoolManager.h"
#include "fsfw/tmtcpacket/pus/tm.h"
#include "fsfw/tmtcservices/CommandingServiceBase.h"
#include "fsfw/tmtcservices/PusServiceBase.h"
#if OBSW_PERFORM_L3GD20H_TEST == 1
@ -66,7 +59,6 @@ void ObjectFactory::produce(void *args) {
new STM32TestTask(objects::TEST_TASK, true, true);
#if OBSW_PERFORM_L3GD20H_TEST == 1
spi::MspCfgBase *mspCfg = nullptr;
spi::TransferModes transferMode = spi::TransferModes::DMA;
if (transferMode == spi::TransferModes::POLLING) {

@ -1 +1 @@
Subproject commit d34effb278c645fb6532db56521dd4d08eb0f4a6
Subproject commit ff569dd02c5915de5804914d7bfcc1d9688befca

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tmtccli" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

11
tmtc/config/hook.py Normal file
View File

@ -0,0 +1,11 @@
from common_tmtc.config.hook_implementation import CommonFsfwHookBase
from tmtccmd.tc.definitions import TcQueueT
class FsfwHookBase(CommonFsfwHookBase):
def pack_service_queue(self, service: int, op_code: str, service_queue: TcQueueT):
from common_tmtc.pus_tc.tc_packing import common_service_queue_user
common_service_queue_user(
service=service, op_code=op_code, tc_queue=service_queue
)

View File

@ -1,56 +0,0 @@
#!/usr/bin/env python3
"""
@brief TMTC Commander entry point for command line mode.
@details
This client was developed by KSat for the SOURCE project to test the on-board software but
has evolved into a more generic tool for satellite developers to perform TMTC (Telemetry and Telecommand)
handling and testing via different communication interfaces. Currently, only the PUS standard is
implemented as a packet standard.
Run this file with the -h flag to display options.
@license
Copyright 2020 KSat e.V. Stuttgart
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@author R. Mueller
"""
import sys
from common_tmtc.config.hook_implementation import FsfwHookBase
from common_tmtc.config.definitions import PUS_APID
from common_tmtc.pus_tm.factory_hook import ccsds_tm_handler
try:
from tmtccmd.runner import run_tmtc_commander, initialize_tmtc_commander, add_ccsds_handler
from tmtccmd.ccsds.handler import CcsdsTmHandler
except ImportError as error:
run_tmtc_commander = None
initialize_tmtc_commander = None
print(error)
print("Python tmtccmd submodule could not be imported")
print("Install with \"cd tmtccmd && python3 -m pip install -e .\" for interactive installation")
sys.exit(0)
def main():
hook_obj = FsfwHookBase()
initialize_tmtc_commander(hook_object=hook_obj)
ccsds_handler = CcsdsTmHandler()
ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50)
add_ccsds_handler(ccsds_handler)
run_tmtc_commander(use_gui=False, app_name="TMTC Commander FSFW")
if __name__ == "__main__":
main()

View File

@ -1,56 +0,0 @@
#!/usr/bin/env python3
"""
@brief TMTC Commander entry point for command line mode.
@details
This client was developed by KSat for the SOURCE project to test the on-board software but
has evolved into a more generic tool for satellite developers to perform TMTC (Telemetry and Telecommand)
handling and testing via different communication interfaces. Currently, only the PUS standard is
implemented as a packet standard.
Run this file with the -h flag to display options.
@license
Copyright 2020 KSat e.V. Stuttgart
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@author R. Mueller
"""
import sys
from common_tmtc.config.hook_implementation import FsfwHookBase
from common_tmtc.config.definitions import PUS_APID
from common_tmtc.pus_tm.factory_hook import ccsds_tm_handler
try:
from tmtccmd.runner import run_tmtc_commander, initialize_tmtc_commander, add_ccsds_handler
from tmtccmd.ccsds.handler import CcsdsTmHandler
except ImportError as error:
run_tmtc_commander = None
initialize_tmtc_commander = None
print(error)
print("Python tmtccmd submodule could not be imported")
print("Install with \"cd tmtccmd && python3 -m pip install -e .\" for interactive installation")
sys.exit(0)
def main():
hook_obj = FsfwHookBase()
initialize_tmtc_commander(hook_object=hook_obj)
ccsds_handler = CcsdsTmHandler()
ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50)
add_ccsds_handler(ccsds_handler)
run_tmtc_commander(use_gui=True, app_name="TMTC Commander FSFW")
if __name__ == "__main__":
main()

6
tmtc/tmtc_conf.json Normal file
View File

@ -0,0 +1,6 @@
{
"com_if": "udp",
"tcpip_udp_ip_addr": "169.254.1.38",
"tcpip_udp_port": 7,
"tcpip_udp_recv_max_size": 1500
}

23
tmtc/tmtccli.py Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""TMTC commander for FSFW Example"""
from common_tmtc.tmtcc import (
tmtcc_post_args,
tmtcc_pre_args,
create_default_args_parser,
add_default_tmtccmd_args,
parse_default_input_arguments,
)
from config.hook import FsfwHookBase
def main():
tmtcc_pre_args()
hook_obj = FsfwHookBase(json_cfg_path="tmtc_conf.json")
arg_parser = create_default_args_parser()
add_default_tmtccmd_args(arg_parser)
args = parse_default_input_arguments(arg_parser, hook_obj)
tmtcc_post_args(hook_obj=hook_obj, use_gui=False, args=args)
if __name__ == "__main__":
main()

12
tmtc/tmtcgui.py Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env python3
"""TMTC commander for the FSFW Example"""
from common_tmtc.tmtcc import tmtcc_post_args, tmtcc_pre_args
def main():
hook_obj = tmtcc_pre_args()
tmtcc_post_args(hook_obj=hook_obj, use_gui=True, args=None)
if __name__ == "__main__":
main()