CAN2_SetAcceptanceMask how to use

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAN2_SetAcceptanceMask how to use

626 Views
李志權
Contributor II

when i call it,it will return 9 ERR_NOTAVAIL

how to use?

Labels (1)
0 Kudos
7 Replies

517 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi 志權

     Could you tell us which chip or board you are used?

     And where the CAN2_SetAcceptance Mask from?

     For the convenience of solving the question, it is best for you to paste you 9 ERR_NOTALAIL.

Best regards!

Jing

0 Kudos

517 Views
李志權
Contributor II

k60-can.bmpcan-test-main.bmp
can-test-setmask.bmp

0 Kudos

517 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi ,

The following is the API definition:

LDD_TError CAN_SetAcceptanceMask(LDD_TDeviceData *DeviceDataPtr, LDD_CAN_TMBIndex BufferIdx, LDD_CAN_TAccMask AccMask);

and below is some description for parameters as well as the return value.

** @param
**     DeviceDataPtr   - Device data structure
**                       pointer returned by [Init] method.
** @param
**     BufferIdx   - Index for Acceptance Mask
**                       Message Buffer.
** @param
**     AccMask     - 11-bit Mask could be selected for
**                       a standard frame or 29-bit for an extended
**                       frame.
** @return
**                     - Error code, possible codes:
**                       ERR_OK - OK
**                       ERR_SPEED - This device does not work in
**                       the active clock configuration
**                       ERR_PARAM_RANGE - Value of buffer index is
**                       out of range.
**                       ERR_NOTAVAIL - Acceptance mask isn't
**                       possible change when CAN component is
**                       running, component must be disabled or
**                       switched to freeze mode.

So maybe you call this API when CAN is running, please disable it or put it into freeze mode before calling this function.

Hope that helps,

B.R

Kan

517 Views
李志權
Contributor II


so,how to enter freeze mode and how to exit freeze mode?

0 Kudos

517 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi,

You may use "CAN_SetOperationMode" to enter or exit the Freeze mode. Please kindly refer to the following for details.

1.png

Hope that helps,

B.R

Kan

0 Kudos

517 Views
李志權
Contributor II

There are 2 a callback function

Can i give NULL for use CAN_SetOperationMode

0 Kudos

517 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Yes, you can set them as NULL.

B.R

Kan

0 Kudos