HedongGao opened a new pull request, #17682:
URL: https://github.com/apache/nuttx/pull/17682
## Summary
Due to bus reasons, the can sender may be full. However, after the bus is
restored and the hardware has sent the message, in some scenarios, due to
hardware bugs, the TXconfirm interrupt is lost, which can lead to packet
interruption.
To enhance the robustness of the Nuttx CAN protocol stack and address the
potential issues mentioned above. Improved the CAN protocol stack.
## Impact
This modification will not have an impact on normal packet sending, but it
will only trigger message sending through can_dend.done when the sender is
already full and there is no external data in the driver.
## Testing
Perform functional validation on the development board. Modify the driver
layer code so that the first 10 frames of messages sent do not handle
TXconfirmation interrupts, and subsequent TXconfirmation interrupts are handled
normally, indicating a hardware issue. Before powering on the development
board, disconnect the CAN bus connection. There are no CAN messages on the
other end device. After the bus connection, CAN messages appear.
`
int fd;
int count = 0;
struct can_msg_s txmsg;
txmsg.cm_hdr.ch_id = 0x69;
txmsg.cm_hdr.ch_dlc = 8;
txmsg.cm_hdr.ch_edl = 1;
fd = open("/dev/can0", O_RDWR | O_NONBLOCK);
while (1)
{
count = (++count)%256;
txmsg.cm_data[0] = count;
write(fd, &txmsg, sizeof(struct can_msg_s ));
}
close(fd);
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]