Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAN Drivers #14

Open
2 of 8 tasks
AndronikosKostas opened this issue Nov 4, 2024 · 0 comments
Open
2 of 8 tasks

CAN Drivers #14

AndronikosKostas opened this issue Nov 4, 2024 · 0 comments
Assignees
Labels
driver Work that need to be done on the drivers code High Priority
Milestone

Comments

@AndronikosKostas
Copy link
Member

AndronikosKostas commented Nov 4, 2024

Files

Frame.hpp
CANDriver.hpp
TPProtocol.hpp

CANDriver.cpp
TPProtocol.cpp

CANGatekeeper.cpp
CANGatekeeper.hpp

Chore Tasks

  • Integrate the CAN files on the new repo (there are not all the ECSS functions enabled yet)

CubeMX tasks

  • FDCAN modules share the same message RAM, so find how many words are needed for the FDCAN1 to work properly. Use this number as an offset for the FDCAN2. Check here. We used 56 as an offset for FDCAN2 (I don't know why).
  • Check the clock calibration (we had it disabled)
  • Check/understand parameters like Nominal Sync Jump width, Data prescaler.

Main Tasks

  • Check functions like HAL_FDCAN_ErrorCallback(), HAL_FDCAN_ActivateNotification((&hcan, CAN_IT_RX_FIFO0_MSG_PENDING | CAN_IT_ERROR)...The last currently enables only the FDCAN_IE_RF0NE , FDCAN_IE_RF1NE flags...we should have more here.
  • The portYIELD_FROM_ISR(xHigherPriorityTaskWoken); inside the callback should be inside the else only...but outside the if

Validation Tasks

  • We should test the old code of COMMS with the updated code of the OBC
    Findings: The FIFO 1 does not work nor in the old repo.

Other Tasks

  • Separate the receive and transmit tasks (maybe create a mutex for that)

References

Note: On a CAN bus, a frame is the basic unit of messaging. For a classic CAN bus, a frame consists of an 11-bit identifier along with an 8-byte message payload. For CAN FD, a frame is labeled with a 29-bit identifier and carries a 64-byte message payload.

* @example @code
     * uint32_t id = 0x4; // Specify the sending Node ID.
     * etl::vector<uint8_t, 8> data = {0,1,2,3,4,5,6,7}; // Specify an array of data, up to 64 bytes.
     * CAN::Frame message = {id, data}; // Create a CAN::Frame object.
     * CAN::Driver::send(message, Application::Main); // Use the included send function to send a message on the Main bus.
     * @endcode

CAN-TP Protocol
https://controllerstech.com/stm32-fdcan-in-loopback-mode/
STM32 CAN Application Note
bit timing parameters
sos

@AndronikosKostas AndronikosKostas added the driver Work that need to be done on the drivers code label Nov 4, 2024
@AndronikosKostas AndronikosKostas added this to the COMMS Drivers milestone Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driver Work that need to be done on the drivers code High Priority
Projects
None yet
Development

No branches or pull requests

2 participants