added Assembly to FreeRTOS

This commit is contained in:
Robin Müller 2021-05-31 16:37:06 +02:00
parent 6732303eb9
commit a87fd50742
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
5 changed files with 70 additions and 30 deletions

View File

@ -1,23 +1,29 @@
#include "InitMission.h"
#include "OBSWConfig.h"
#include <OBSWConfig.h>
#include "objects/systemObjectList.h"
#include "pollingsequence/pollingSequenceFactory.h"
#include <freertos/FreeRTOS.h>
#include "mission/utility/TaskCreation.h"
#include "mission/assemblies/TestAssembly.h"
#include <objects/systemObjectList.h>
#include <mission/utility/TaskCreation.h>
#include <pollingsequence/pollingSequenceFactory.h>
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
#include <fsfw/tasks/PeriodicTaskIF.h>
#include <fsfw/tasks/TaskFactory.h>
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
#include "fsfw/tasks/FixedTimeslotTaskIF.h"
#include "fsfw/tasks/PeriodicTaskIF.h"
#include "fsfw/tasks/TaskFactory.h"
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
#include "fsfw/modes/HasModesIF.h"
#include "fsfw/modes/ModeMessage.h"
#include "freertos/FreeRTOS.h"
void InitMission::createTasks() {
TaskFactory* taskFactory = TaskFactory::instance();
#if OBSW_ADD_CORE_COMPONENTS == 1
/* TMTC Distribution */
PeriodicTaskIF* distributerTask = TaskFactory::instance()->createPeriodicTask(
PeriodicTaskIF* distributerTask = taskFactory->createPeriodicTask(
"DIST", 5, 1024 * 2, 0.2, nullptr);
ReturnValue_t result = distributerTask->addComponent(objects::CCSDS_DISTRIBUTOR);
if(result!=HasReturnvaluesIF::RETURN_OK) {
@ -128,6 +134,15 @@ void InitMission::createTasks() {
sif::printError("InitMission::createTasks: Test PST initialization faiedl!\n");
#endif
}
PeriodicTaskIF* assemblyTask = taskFactory->createPeriodicTask("ASS_TASK", 3,
1024, 2.0, nullptr);
if(assemblyTask == nullptr){
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
}
result = assemblyTask->addComponent(objects::TEST_ASSEMBLY);
if(result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
}
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
PeriodicTaskIF* testTask = TaskFactory::instance()->createPeriodicTask(
@ -164,6 +179,7 @@ void InitMission::createTasks() {
#if OBSW_ADD_DEVICE_HANDLER_DEMO == 1
testDevicesTask->startTask();
assemblyTask->startTask();
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
testTask->startTask();
@ -177,5 +193,29 @@ void InitMission::createTasks() {
static_cast<unsigned long>(xPortGetFreeHeapSize()));
sif::printInfo("Tasks started..\n");
#endif
#if OBSW_ADD_DEVICE_HANDLER_DEMO
HasModesIF* assembly = objectManager->get<HasModesIF>(objects::TEST_ASSEMBLY);
if (assembly == nullptr){
return;
}
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Waiting 5 Seconds and then command Test Assembly to Normal, Dual" << std::endl;
#else
sif::printInfo("Waiting 5 Seconds and then command Test Assembly to Normal, Dual \n");
#endif
TaskFactory::delayTask(5000);
CommandMessage modeMessage;
ModeMessage::setModeMessage(&modeMessage, ModeMessage::CMD_MODE_COMMAND,
DeviceHandlerIF::MODE_NORMAL, TestAssembly::submodes::DUAL);
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Commanding Test Assembly to Normal, Dual" << std::endl;
#else
sif::printInfo("Commanding Test Assembly to Normal, Dual \n");
#endif
MessageQueueSenderIF::sendMessage(assembly->getCommandQueue(), &modeMessage,
MessageQueueIF::NO_QUEUE);
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO */
}

View File

@ -1,20 +1,20 @@
#include <hardware_init.h>
#include <lwip/init.h>
#include <boardconfig.h>
#include <OBSWVersion.h>
#include "hardware_init.h"
#include "lwip/init.h"
#include "boardconfig.h"
#include "OBSWVersion.h"
#include <common/utility/utility.h>
#include "common/utility/utility.h"
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw/tasks/TaskFactory.h>
#include "fsfw/objectmanager/ObjectManager.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/tasks/TaskFactory.h"
#include <bsp_stm32_freertos/core/InitMission.h>
#include <bsp_stm32_freertos/core/ObjectFactory.h>
#include "bsp_stm32_freertos/core/InitMission.h"
#include "bsp_stm32_freertos/core/ObjectFactory.h"
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <cmsis_os.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "cmsis_os.h"
#include <cstdio>
#if FSFW_CPP_OSTREAM_ENABLED == 1

2
fsfw

@ -1 +1 @@
Subproject commit 567699954c0e91f0a5ebd692f3e27ab51d94d1f3
Subproject commit 54e60f4ddc88a8e108588c5a8b69ae744686a295

View File

@ -47,11 +47,11 @@
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build-Debug-STM32H743-FreeRTOS/fsfw_example"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="fsfw_example"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="fsfw_example_public"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.base.450259316.1933681494.615695818.863590432"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/fsfw_example"/>
<listEntry value="/fsfw_example_public"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
@ -59,6 +59,6 @@
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;&gt;&#13;&#10; &lt;memoryBlockExpression address=&quot;604291484&quot; label=&quot;*((((this)-&amp;gt;hkBuffer))+0)@100&quot;/&gt;&#13;&#10;&lt;/memoryBlockExpressionList&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;&gt;&#10; &lt;memoryBlockExpression address=&quot;604291484&quot; label=&quot;*((((this)-&amp;gt;hkBuffer))+0)@100&quot;/&gt;&#10;&lt;/memoryBlockExpressionList&gt;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>

View File

@ -100,8 +100,8 @@ void ObjectFactory::produceGenericObjects() {
new TestEchoComIF(objects::TEST_ECHO_COM_IF);
new TestDevice(objects::TEST_DEVICE_HANDLER_0, objects::TEST_ECHO_COM_IF, testCookie,
testdevice::DeviceIndex::DEVICE_0, enableInfoPrintout);
testCookie = new DummyCookie(
static_cast<address_t>(testdevice::DeviceIndex::DEVICE_1), expectedMaxReplyLen);
testCookie = new DummyCookie(static_cast<address_t>(testdevice::DeviceIndex::DEVICE_1),
expectedMaxReplyLen);
new TestDevice(objects::TEST_DEVICE_HANDLER_1, objects::TEST_ECHO_COM_IF, testCookie,
testdevice::DeviceIndex::DEVICE_1, enableInfoPrintout);