Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions FprimeZephyrReference/ReferenceDeployment/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <zephyr/sys/printk.h>

const struct device* serial = DEVICE_DT_GET(DT_NODELABEL(cdc_acm_uart0));
const struct device* lora = DEVICE_DT_GET(DT_NODELABEL(lora0));

int main(int argc, char* argv[]) {
// ** DO NOT REMOVE **//
Expand All @@ -22,6 +23,7 @@ int main(int argc, char* argv[]) {
Os::init();
// Object for communicating state to the topology
ReferenceDeployment::TopologyState inputs;
inputs.loraDevice = lora;
inputs.uartDevice = serial;
inputs.baudRate = 115200;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ telemetry packets ReferenceDeploymentPackets {
ReferenceDeployment.lis2mdlManager.MagneticField
}

packet LoRa id 7 group 4 {
lora.LastRssi
lora.LastSnr
}


} omit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ void setupTopology(const TopologyState& state) {
startTasks(state);

// Uplink is configured for receive so a socket task is started
comDriver.configure(state.uartDevice, state.baudRate);
// We dont need UART, as we are sending coms directly to lora
// comDriver.configure(state.uartDevice, state.baudRate);
lora.start(state.loraDevice);
}

void startRateGroups() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ namespace ReferenceDeployment {
*/
struct TopologyState {
const device* uartDevice; //!< UART device path for communication
const device* loraDevice; //!< LoRa device path for communication
U32 baudRate; //!< Baud rate for UART communication
CdhCore::SubtopologyState cdhCore; //!< Subtopology state for CdhCore
ComCcsds::SubtopologyState comCcsds; //!< Subtopology state for ComCcsds
Expand Down
2 changes: 2 additions & 0 deletions FprimeZephyrReference/ReferenceDeployment/Top/instances.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,6 @@ module ReferenceDeployment {
instance prmDb: Components.NullPrmDb base id 0x10024000

instance comDelay: Components.ComDelay base id 0x10025000

instance lora: Zephyr.LoRa base id 0x10026000
}
19 changes: 9 additions & 10 deletions FprimeZephyrReference/ReferenceDeployment/Top/topology.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module ReferenceDeployment {
instance rateGroup1Hz
instance rateGroupDriver
instance timer
instance comDriver
instance lora
instance gpioDriver
instance gpioBurnwire0
instance gpioBurnwire1
Expand Down Expand Up @@ -73,16 +73,16 @@ module ReferenceDeployment {

connections Communications {
# ComDriver buffer allocations
comDriver.allocate -> ComCcsds.commsBufferManager.bufferGetCallee
comDriver.deallocate -> ComCcsds.commsBufferManager.bufferSendIn
# comDriver.allocate -> ComCcsds.commsBufferManager.bufferGetCallee
# comDriver.deallocate -> ComCcsds.commsBufferManager.bufferSendIn

# ComDriver <-> ComStub (Uplink)
comDriver.$recv -> ComCcsds.comStub.drvReceiveIn
ComCcsds.comStub.drvReceiveReturnOut -> comDriver.recvReturnIn
# # ComDriver <-> ComStub (Uplink)
# comDriver.$recv -> ComCcsds.comStub.drvReceiveIn
# ComCcsds.comStub.drvReceiveReturnOut -> comDriver.recvReturnIn

# ComStub <-> ComDriver (Downlink)
ComCcsds.comStub.drvSendOut -> comDriver.$send
comDriver.ready -> ComCcsds.comStub.drvConnected
# # ComStub <-> ComDriver (Downlink)
# ComCcsds.comStub.drvSendOut -> comDriver.$send
# comDriver.ready -> ComCcsds.comStub.drvConnected
}

connections RateGroups {
Expand All @@ -91,7 +91,6 @@ module ReferenceDeployment {

# High rate (10Hz) rate group
rateGroupDriver.CycleOut[Ports_RateGroups.rateGroup10Hz] -> rateGroup10Hz.CycleIn
rateGroup10Hz.RateGroupMemberOut[0] -> comDriver.schedIn

# Slow rate (1Hz) rate group
rateGroupDriver.CycleOut[Ports_RateGroups.rateGroup1Hz] -> rateGroup1Hz.CycleIn
Expand Down
1 change: 1 addition & 0 deletions FprimeZephyrReference/project/config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ register_fprime_config(
"${CMAKE_CURRENT_LIST_DIR}/CdhCoreFatalHandlerConfig.fpp"
"${CMAKE_CURRENT_LIST_DIR}/ComCcsdsConfig.fpp"
"${CMAKE_CURRENT_LIST_DIR}/CommandDispatcherImplCfg.hpp"
"${CMAKE_CURRENT_LIST_DIR}/LoRaCfg.hpp"
"${CMAKE_CURRENT_LIST_DIR}/FpConfig.h"
"${CMAKE_CURRENT_LIST_DIR}/TlmPacketizerCfg.hpp"
INTERFACE
Expand Down
4 changes: 4 additions & 0 deletions FprimeZephyrReference/project/config/FpConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ extern "C" {
#define FW_FILE_CHUNK_SIZE 512 //!< Chunk size for working with files in the OSAL layer
#endif

#ifndef FW_ASSERT_COUNT_MAX
#define FW_ASSERT_COUNT_MAX 4
#endif

// *** NOTE configuration checks are in Fw/Cfg/ConfigCheck.cpp in order to have
// the type definitions in Fw/Types/BasicTypes available.
#ifdef __cplusplus
Expand Down
12 changes: 12 additions & 0 deletions FprimeZephyrReference/project/config/LoRaCfg.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef LORA_CFG_HPP
#define LORA_CFG_HPP
#include <zephyr/drivers/lora.h>
#include <Fw/FPrimeBasicTypes.hpp>
namespace LoRaConfig {
const U32 FREQUENCY = 437400000; //!< LoRa frequency in Hz
lora_signal_bandwidth BANDWIDTH = BW_125_KHZ; //!< LoRa bandwidth
const I8 TX_POWER = 14; //!< LoRa transmission power in dBm
const U16 PREAMBLE_LENGTH = 8; //!< LoRa preamble length
U8 HEADER[] = {0, 0, 0, 0}; //!< LoRa header (not used)
} // namespace LoRaConfig
#endif // LORA_CFG_HPP
2 changes: 1 addition & 1 deletion FprimeZephyrReference/project/config/TlmPacketizerCfg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <Fw/FPrimeBasicTypes.hpp>

namespace Svc {
static const FwChanIdType MAX_PACKETIZER_PACKETS = 6;
static const FwChanIdType MAX_PACKETIZER_PACKETS = 7;
static const FwChanIdType TLMPACKETIZER_NUM_TLM_HASH_SLOTS =
15; // !< Number of slots in the hash table.
// Works best when set to about twice the number of components producing telemetry
Expand Down
2 changes: 1 addition & 1 deletion lib/fprime
Submodule fprime updated 387 files
Loading