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
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
so,how to enter freeze mode and how to exit freeze mode?
Hi,
You may use "CAN_SetOperationMode" to enter or exit the Freeze mode. Please kindly refer to the following for details.
Hope that helps,
B.R
Kan
There are 2 a callback function
Can i give NULL for use CAN_SetOperationMode
Yes, you can set them as NULL.
B.R
Kan