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

samples/subsys/canbus/isotp/sample.subsys.canbus.isotp fails to build on mimxrt1170_evk_cm7 #37691

Closed
galak opened this issue Aug 14, 2021 · 2 comments · Fixed by #37800
Closed
Assignees
Labels
area: CAN bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: high High impact/importance bug

Comments

@galak
Copy link
Collaborator

galak commented Aug 14, 2021

After the SDK 2.10.0 update for NXP HAL we now get:

./scripts/twister -s samples/subsys/canbus/isotp/sample.subsys.canbus.isotp -p mimxrt1170_evk_cm7

gets:

/home/galak/git/zephyr/drivers/can/can_mcux_flexcan.c: In function 'mcux_flexcan_init':
/home/galak/git/zephyr/drivers/can/can_mcux_flexcan.c:727:10: error: passing argument 3 of 'FLEXCAN_TransferCreateHandle' from incompatible pointer type [-Werror=incompatible-pointer-types]
  727 |          mcux_flexcan_transfer_callback, data);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |          |
      |          void (*)(CAN_Type *, flexcan_handle_t *, status_t,  uint32_t,  void *) {aka void (*)(CAN_Type *, struct _flexcan_handle *, int,  unsigned int,  void *)}
In file included from /home/galak/git/zephyr/drivers/can/can_mcux_flexcan.c:15:
/home/galak/git/modules/hal/nxp/mcux/drivers/imx/./fsl_flexcan.h:2034:63: note: expected 'flexcan_transfer_callback_t' {aka 'void (*)(CAN_Type *, struct _flexcan_handle *, int,  long long unsigned int,  void *)'} but argument is of type 'void (*)(CAN_Type *, flexcan_handle_t *, status_t,  uint32_t,  void *)' {aka 'void (*)(CAN_Type *, struct _flexcan_handle *, int,  unsigned int,  void *)'}
 2034 |                                   flexcan_transfer_callback_t callback,
      |   
@galak galak added bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: high High impact/importance bug labels Aug 14, 2021
@galak
Copy link
Collaborator Author

galak commented Aug 14, 2021

This seem to be related to some miss match in building of files based on FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL being defined or not.

@galak galak assigned dleach02 and CristXu and unassigned dleach02 Aug 14, 2021
@galak
Copy link
Collaborator Author

galak commented Aug 14, 2021

This seem to be related to some miss match in building of files based on FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL being defined or not.

Looks like on rt1170 because of FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL being defined result is uint64_t instead of uint32_t. This seems like it has to get cleaned up in several places in the shim driver.

cfriedt pushed a commit that referenced this issue Aug 20, 2021
The RT1170 platform adjusted the result parameter in the callback
function to be a uint64_t. The adjustment is to conditionally change
the callback definition and then cast the result value to a size that
fits the reported values across the various SOCs.

With error results, cast result to uint64_t and modified the called
function to print a uint64_t value.

With the RX/TX status, result is a MB value that doesn't exceed 64
so the result value is cast down to a uint32_t.

Fixes #37691

Signed-off-by: David Leach <david.leach@nxp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CAN bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: high High impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants