May 26, 2021
05:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 26, 2021
05:53 AM
Hello, I've a project in Keil with the XMC1400 Boot Kit using the CAN driver from Infineon:
In the function CAN_PowerControl() there is the initialization of the clock:
But XMC_CAN_CANCLKSRC_FPERI is not defined due in the file xmc_can.h selects this only for the XMC4 family:
I can't edit CAN.c or xmc_can.h, in Keil they are protected due they're included in the project from the package manager.
I've defined the XMC1404_Q064x0200 as a preprocessor symbol so in xmc_device.h it defines this:
So seems the CAN.c provided from Infineon is not prepared to be used with the XMC1400?
Will it be correct to modify a copy of CAN.c and select XMC_CAN_CANCLKSRC_MCLK?
* @file CAN.c
* @date 21 Jun, 2019
* @version 1.3
In the function CAN_PowerControl() there is the initialization of the clock:
if (!global_can_initialized)
{
XMC_CAN_InitEx(can->can, XMC_CAN_CANCLKSRC_FPERI, XMC_SCU_CLOCK_GetPeripheralClockFrequency());
global_can_initialized = true;
}
But XMC_CAN_CANCLKSRC_FPERI is not defined due in the file xmc_can.h selects this only for the XMC4 family:
/**
* Defines the Clock source used for the MCAN baudrate generator
*/
typedef enum XMC_CAN_CANCLKSRC
{
#if defined(MULTICAN_PLUS) || defined(DOXYGEN)
#if (UC_FAMILY == XMC4)
XMC_CAN_CANCLKSRC_FPERI = 0x1U, /**< Use peripheral clock as MCAN baudrate generator input clock. */
#else
XMC_CAN_CANCLKSRC_MCLK = 0x1U, /**< Use peripheral clock as MCAN baudrate generator input clock. */
#endif
XMC_CAN_CANCLKSRC_FOHP = 0x2U, /**< Use high performance oscillator (fOHP) as MCAN baudrate generator input clock. @note Only available for XMC1400, XMC4800 and XMC4700 series*/
#else
XMC_CAN_CANCLKSRC_FPERI = 0x1U, /**< Use peripheral clock as MCAN baudrate generator input clock. */
#endif
} XMC_CAN_CANCLKSRC_t;
I can't edit CAN.c or xmc_can.h, in Keil they are protected due they're included in the project from the package manager.
I've defined the XMC1404_Q064x0200 as a preprocessor symbol so in xmc_device.h it defines this:
#elif defined(XMC1404_Q064x0200)
#define UC_FAMILY XMC1
#define UC_SERIES XMC14
#define UC_DEVICE XMC1404
#define UC_PACKAGE VQFN64
#define UC_FLASH (200UL)
#define MULTICAN_PLUS
#define CCU4V3
#define CCU8V3
So seems the CAN.c provided from Infineon is not prepared to be used with the XMC1400?
Will it be correct to modify a copy of CAN.c and select XMC_CAN_CANCLKSRC_MCLK?
Solved! Go to Solution.
- Tags:
- IFX
1 Solution
Jul 04, 2021
10:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 04, 2021
10:31 PM
Hi,
Did you download the package from this website : https://www.keil.com/dd2/pack/#!#third-party-download-dialog

There are XMC4000 and XMC1000 versions available in the website. Which package are you using. If this is not the source you are referring, kindly point me to it.
Best Regards,
Vasanth
Did you download the package from this website : https://www.keil.com/dd2/pack/#!#third-party-download-dialog
There are XMC4000 and XMC1000 versions available in the website. Which package are you using. If this is not the source you are referring, kindly point me to it.
Best Regards,
Vasanth
1 Reply
Jul 04, 2021
10:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 04, 2021
10:31 PM
Hi,
Did you download the package from this website : https://www.keil.com/dd2/pack/#!#third-party-download-dialog

There are XMC4000 and XMC1000 versions available in the website. Which package are you using. If this is not the source you are referring, kindly point me to it.
Best Regards,
Vasanth
Did you download the package from this website : https://www.keil.com/dd2/pack/#!#third-party-download-dialog
There are XMC4000 and XMC1000 versions available in the website. Which package are you using. If this is not the source you are referring, kindly point me to it.
Best Regards,
Vasanth