-
Issue SummaryI am building a ground station to satellite simulation with two Raspberry Pi 5s using F Prime. I keep getting a consistent System Architecture
The ProblemExpected: Commands flow from laptop → ground station → satellite → LED blinks # Satellite Output:
Listening for single client at 0.0.0.0:50002
Accepted client at 0.0.0.0:50002
Assert: "BufferSendPortAc.cpp:154"
Assertion `0' failed.
Aborted What I've Tried
Component OverviewGroundStationManageractive component GroundStationManager {
async command SEND_CUSTOM_COMMAND(customCommand: string size 80)
# SUSPECTED ISSUE: These ports are defined but NOT connected
output port satelliteOut: Fw.BufferSend
async input port satelliteIn: Fw.BufferSend
} SatelliteManageractive component SatelliteManager {
async command GROUND_COMMAND(groundCmd: string size 80)
output port ledBlink: Fw.Cmd # Connected to LED component
} LED Componentactive component Led {
async command BLINK_LED()
async input port ledTrigger: Fw.Cmd # Receives from SatelliteManager
output port gpioSet: Drv.GpioWrite # Connected to GPIO driver
} Key Topology ConnectionsSatelliteDeployment (TcpServer)connections Uplink {
comm.$recv -> uplink.framedIn
uplink.comOut -> cmdDisp.seqCmdBuff
cmdDisp.seqCmdStatus -> uplink.cmdResponseIn
}
connections SatelliteConnections {
satelliteManager.ledBlink -> led.ledTrigger # Connected
led.gpioSet -> gpioDriver.gpioWrite # Connected
} GroundStationDeployment (TcpClient)connections SatelliteComm {
downlink.framedOut -> comm.$send
comm.$recv -> uplink.framedIn
uplink.comOut -> cmdDisp.seqCmdBuff
}
# MISSING: No connections for groundStationManager.satelliteOut/In Specific Questions
Error Timeline
Environment
RepositorySource Code: https://github.com/TeraLink-1/TeraLink-Link/tree/Mustafa
Looking For
Any help debugging this BufferSend assertion would be hugely appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Can you open BufferSendPortAc.cpp:154 (should be under build-fprime.../F-Prime/...) and look at the specific code/assertion that triggers this? It's sometimes telling. If not, I'd run a debugger and look at the call stack when the assertion occurs. |
Beta Was this translation helpful? Give feedback.
-
Here are the contents of // ======================================================================
// \title BufferSendPortAc.cpp
// \author Generated by fpp-to-cpp
// \brief cpp file for BufferSend port
// ======================================================================
#include "F-Prime/Fw/Buffer/BufferSendPortAc.hpp"
#include "Fw/Types/Assert.hpp"
#include "Fw/Types/ExternalString.hpp"
namespace Fw {
namespace {
// ----------------------------------------------------------------------
// Port buffer class
// ----------------------------------------------------------------------
class BufferSendPortBuffer : public Fw::SerializeBufferBase {
public:
Fw::Serializable::SizeType getBuffCapacity() const {
return InputBufferSendPort::SERIALIZED_SIZE;
}
U8* getBuffAddr() {
return m_buff;
}
const U8* getBuffAddr() const {
return m_buff;
}
private:
U8 m_buff[InputBufferSendPort::SERIALIZED_SIZE];
};
}
// ----------------------------------------------------------------------
// Input Port Member functions
// ----------------------------------------------------------------------
InputBufferSendPort ::
InputBufferSendPort() :
Fw::InputPortBase(),
m_func(nullptr)
{
}
void InputBufferSendPort ::
init()
{
Fw::InputPortBase::init();
}
void InputBufferSendPort ::
addCallComp(
Fw::PassiveComponentBase* callComp,
CompFuncPtr funcPtr
)
{
FW_ASSERT(callComp != nullptr);
FW_ASSERT(funcPtr != nullptr);
this->m_comp = callComp;
this->m_func = funcPtr;
this->m_connObj = callComp;
}
void InputBufferSendPort ::
invoke(Fw::Buffer& fwBuffer)
{
#if FW_PORT_TRACING == 1
this->trace();
#endif
FW_ASSERT(this->m_comp != nullptr);
FW_ASSERT(this->m_func != nullptr);
return this->m_func(this->m_comp, this->m_portNum, fwBuffer);
}
#if FW_PORT_SERIALIZATION == 1
Fw::SerializeStatus InputBufferSendPort ::
invokeSerial(Fw::SerializeBufferBase& _buffer)
{
Fw::SerializeStatus _status;
#if FW_PORT_TRACING == 1
this->trace();
#endif
FW_ASSERT(this->m_comp != nullptr);
FW_ASSERT(this->m_func != nullptr);
Fw::Buffer fwBuffer;
_status = _buffer.deserialize(fwBuffer);
if (_status != Fw::FW_SERIALIZE_OK) {
return _status;
}
this->m_func(this->m_comp, this->m_portNum, fwBuffer);
return Fw::FW_SERIALIZE_OK;
}
#endif
// ----------------------------------------------------------------------
// Output Port Member functions
// ----------------------------------------------------------------------
OutputBufferSendPort ::
OutputBufferSendPort() :
Fw::OutputPortBase(),
m_port(nullptr)
{
}
void OutputBufferSendPort ::
init()
{
Fw::OutputPortBase::init();
}
void OutputBufferSendPort ::
addCallPort(InputBufferSendPort* callPort)
{
FW_ASSERT(callPort != nullptr);
this->m_port = callPort;
this->m_connObj = callPort;
#if FW_PORT_SERIALIZATION == 1
this->m_serPort = nullptr;
#endif
}
void OutputBufferSendPort ::
invoke(Fw::Buffer& fwBuffer) const
{
#if FW_PORT_TRACING == 1
this->trace();
#endif
#if FW_PORT_SERIALIZATION
FW_ASSERT((this->m_port != nullptr) || (this->m_serPort != nullptr));
if (this->m_port != nullptr) {
this->m_port->invoke(fwBuffer);
}
else {
Fw::SerializeStatus _status;
BufferSendPortBuffer _buffer;
_status = _buffer.serialize(fwBuffer);
FW_ASSERT(_status == Fw::FW_SERIALIZE_OK, static_cast(_status));
_status = this->m_serPort->invokeSerial(_buffer);
FW_ASSERT(_status == Fw::FW_SERIALIZE_OK, static_cast(_status));
}
#else
FW_ASSERT(this->m_port != nullptr);
this->m_port->invoke(fwBuffer);
#endif
}
} I've never dealt with manipulating the auto generated cpp files fprime generates, so any assistance would be greatly appreciated |
Beta Was this translation helpful? Give feedback.
The issue as you've mentioned seems to be that you have unconnected ports that are being invoked. You need to either connect them or prevent them from being invoked.