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

Bus error states cannot be read from interface #32

Open
mac-can opened this issue May 29, 2024 · 1 comment
Open

Bus error states cannot be read from interface #32

mac-can opened this issue May 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mac-can
Copy link
Owner

mac-can commented May 29, 2024

The bus error states 'Bus Off', 'Warning Level Reached' and 'Bus Error' (eror code capturing) cannot be read from the interface. The device request 'TouCAN get CAN interface ERROR' (0x24) always returns the value 0 (no HAL error) as error code. As a consequence, bus error states are not displayed in the status register (C can_status() or C++ GetStatus()), even if bus errors are present.

The following testcases are failing:

  • TC04.15: Read an error frame with flag STS set
  • TC09.8: Get CAN controller status if in bus off state
  • TC09.9: Get CAN controller status if warning level reached
  • TC09.10: Get CAN controller status if errors on bus (LEC)
@mac-can mac-can added the bug Something isn't working label May 29, 2024
mac-can added a commit that referenced this issue Jun 3, 2024
Relates to [MACCAN-200]
@rusoku
Copy link

rusoku commented Jul 4, 2024

TouCAN get CAN interface ERROR' (0x24) is for STM32 library can interface state.

typedef enum
{
  HAL_CAN_STATE_RESET             = 0x00U,  /*!< CAN not yet initialized or disabled */
  HAL_CAN_STATE_READY             = 0x01U,  /*!< CAN initialized and ready for use   */
  HAL_CAN_STATE_LISTENING         = 0x02U,  /*!< CAN receive process is ongoing      */
  HAL_CAN_STATE_SLEEP_PENDING     = 0x03U,  /*!< CAN sleep request is pending        */
  HAL_CAN_STATE_SLEEP_ACTIVE      = 0x04U,  /*!< CAN sleep mode is active            */
  HAL_CAN_STATE_ERROR             = 0x05U   /*!< CAN error state                     */

} HAL_CAN_StateTypeDef;

To read a bus error states need to use TouCAN_GET_CAN_ERROR_STATUS (0x0D)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants