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

Test case "Set CAN FD bus params with field data.tseg1 set to invalid value" failed #14

Open
mac-can opened this issue Jul 6, 2022 · 0 comments
Labels
wontfix This will not be worked on

Comments

@mac-can
Copy link
Owner

mac-can commented Jul 6, 2022

Findings:
Function KvaserCAN_SetBusParamsFd accepts invalid value 33 in field data.tseg1 of parameter params (KvaserUSB_BusParamsFd_t).

Remarks:
According to CAN FD specification the valid range for data phase parameter tseg1 shall be 1 to 32.

Affected:

  • Leaf Pro HS v2
  • Hybrid Pro 2x CAN/LIN

Rootcause:
The function itself does not check the range of the data field in the structure KvaserUSB_BusParamsFd_t. The affected devices (and only the affected devices) do not response with an error when given an invalid value in field data.tseg1.

Comment:
This behavior on driver level is assessed as a minor issue, because sanity checks for CAN FD bit-rate settings are implemented on user level (CAN API V3).

Testcase:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TC17: Set CAN FD bus params with field 'data.tseg1' set to invalid value
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
expected: Not CANUSB_SUCCESS

note: this test requires a CAN FD capable device

pre:
- initialize DUT1 with configured settings

test: loop over selected invalid bus params
- sub(1): 1Mbps : 8Mbps with field 'data.tseg1' set to 33
- sub(2): 500kbps : 4Mbps with field 'data.tseg1' set to 255
- sub(3): 250kbps : 2Mbps with field 'data.tseg1' set to 255
- sub(4): 125kbps : 1Mbps with field 'data.tseg1' set to 33
-- try to set invalid bus params into DUT1
-- if nevertheless successful get bus params from DUT1
-- and compare set and get bus params

post:
- shutdown DUT1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note: Value 255 is recognized as invalid by the affected devices and the corresponding sub-testcase passed.

@mac-can mac-can added the wontfix This will not be worked on label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant