Usage of Fw::Buffer with UART always throw fatal error #4309
Unanswered
poonamdeoghare
asked this question in
Q&A
Replies: 1 comment
-
|
Converted to discussion. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry for the very long Post.
I’m trying to use an RTEMS/GR740 build to communicate with a one of my component over UART. The component is a straightforward ActiveComponentBase that uses the byte-stream driver and the buffer manager for TX/RX. Despite moving the initial handshake into the scheduler so it only runs once and guarding buffers with Fw::Buffer::NO_CONTEXT, the application still aborts immediately on startup with the buffer-manager fatal (Assert: "/root/aFATAL 16897 handFATAL occurred in task ID: 0x0a010001). Because the fatal fires before schedIn_handler gets a tick, I never see my component logging or send/receive.
What I expected ---------- My understanding may be wrong
xAxisUartReady_handler sets a flag when the GR740 UART driver indicates it’s ready. --- Getting this
The first call to schedIn_handler detects that flag,and perform the action mentioned in the handler --- Not happening
xAxisUartRecv_handler logs whatever comes back and returns the buffer to the manager.---- Not happening
What is Happening My understanding may be wrong
On deployment- Assert: "/root/aFATAL 16897 hand FATAL occurred in task ID: 0x0a010001
The task crashes right after xAxisUartReady_handler, so schedIn_handler never runs and neither send nor receive prints appear.
Because the component dies, the UART pipeline is never exercised beyond the initial ready notification.
My Code Snippet:-
Component.fpp
@ UART port for the stage
output port xAxisUart: Drv.ByteStreamSend
topology.fpp
connections XeryonComm {
xeryonController.xAxisUart -> xeryonUartInst.$send
xeryonUartInst.$recv -> xeryonController.xAxisUartRecv
xeryonUartInst.ready -> xeryonController.xAxisUartReady
}
topology.cpp
// Initialize and start the UART driver for Xeryon
bool xeryonuartsuccess = xeryonUartInst.open(BaseAddress::XERYON_X_UART , "XERYON_X_UART", // Device name
Drv::GR740UartDriver::BAUD_9600, // 9600 baud (adjust as needed for xeryon)
Drv::GR740UartDriver::NO_FLOW, // No flow control
Drv::GR740UartDriver::PARITY_NONE, // No parity
1024 // Buffer allocation size
);
void XeryonXYZ ::
xAxisUartReady_handler(FwIndexType portNum)
{
Fw::Logger::log("---Ready Xeryon xAxisUartReady_handler------\n");
m_connected = true;
m_handshakeInitiated = false;}
void XeryonXYZ ::
xAxisUartRecv_handler(
FwIndexType portNum,
Fw::Buffer& recvBuffer,
const Drv::RecvStatus& recvStatus
)
{
Fw::Logger::log("---Xeryon xAxisUartRecv_handler \n");
if (recvStatus == Drv::RecvStatus::RECV_OK) {
Os::ScopeLock lock(m_mutex);
}-----------------------------------
void XeryonXYZ::sendUartData(const char* data) {
if (data == nullptr) {
// return;
Fw::Logger::log("---Data is Null\n");
}
}
void XeryonXYZ ::
schedIn_handler(
FwIndexType portNum,
U32 context
)
{
Fw::Logger::log("---------schedIn_handler Xeryon ------\n");
sendUartData("INFO=?\n");
}-----------------------------------
Given the wiring and code above, is there anything else I should check on the F´ side that would cause the buffer manager to assert immediately (event 16897/invalid buffer ID) during startup? What else is going wrong. Please suggest or guide me to send and receive the UART data. Thanking you in advance .
Beta Was this translation helpful? Give feedback.
All reactions