Skip to content

Commit

Permalink
Refs #1524. Place the CAN peripheral back into its reset state, befor…
Browse files Browse the repository at this point in the history
…e initializing, for XMC1 and XMC4 targets.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@958 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
  • Loading branch information
feaser committed Jul 8, 2022
1 parent c71a3e1 commit 7d21803
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Target/Demo/ARMCM0_XMC1_XMC1400_Boot_Kit_GCC/Prog/boot.c
Expand Up @@ -266,6 +266,12 @@ static void BootComCanInit(void)
XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t baud;
unsigned long receiveId;

/* set the CAN peripheral into the disabled state. the call to XMC_CAN_Init
* below enables it again, which consequently brings the peripheral back into
* its reset state.
*/
XMC_CAN_Disable(CAN);

/* decide on fCAN frequency. it should be in the 5-120MHz range. according to the
* datasheet, it must be at least 12MHz if 1 node (channel) is used with up to
* 16 message objects. This is sufficient for this CAN driver.
Expand Down
6 changes: 6 additions & 0 deletions Target/Demo/ARMCM0_XMC1_XMC1400_Boot_Kit_IAR/Prog/boot.c
Expand Up @@ -266,6 +266,12 @@ static void BootComCanInit(void)
XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t baud;
unsigned long receiveId;

/* set the CAN peripheral into the disabled state. the call to XMC_CAN_Init
* below enables it again, which consequently brings the peripheral back into
* its reset state.
*/
XMC_CAN_Disable(CAN);

/* decide on fCAN frequency. it should be in the 5-120MHz range. according to the
* datasheet, it must be at least 12MHz if 1 node (channel) is used with up to
* 16 message objects. This is sufficient for this CAN driver.
Expand Down
6 changes: 6 additions & 0 deletions Target/Demo/ARMCM0_XMC1_XMC1400_Boot_Kit_Keil/Prog/boot.c
Expand Up @@ -266,6 +266,12 @@ static void BootComCanInit(void)
XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t baud;
unsigned long receiveId;

/* set the CAN peripheral into the disabled state. the call to XMC_CAN_Init
* below enables it again, which consequently brings the peripheral back into
* its reset state.
*/
XMC_CAN_Disable(CAN);

/* decide on fCAN frequency. it should be in the 5-120MHz range. according to the
* datasheet, it must be at least 12MHz if 1 node (channel) is used with up to
* 16 message objects. This is sufficient for this CAN driver.
Expand Down
6 changes: 6 additions & 0 deletions Target/Demo/ARMCM4_XMC4_XMC4700_Relax_Kit_GCC/Prog/boot.c
Expand Up @@ -270,6 +270,12 @@ static void BootComCanInit(void)
XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t baud;
unsigned long receiveId;

/* set the CAN peripheral into the disabled state. the call to XMC_CAN_Init
* below enables it again, which consequently brings the peripheral back into
* its reset state.
*/
XMC_CAN_Disable(CAN);

/* decide on fCAN frequency. it should be in the 5-120MHz range. according to the
* datasheet, it must be at least 12MHz if 1 node (channel) is used with up to
* 16 message objects. This is sufficient for this CAN driver.
Expand Down
6 changes: 6 additions & 0 deletions Target/Demo/ARMCM4_XMC4_XMC4700_Relax_Kit_IAR/Prog/boot.c
Expand Up @@ -270,6 +270,12 @@ static void BootComCanInit(void)
XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t baud;
unsigned long receiveId;

/* set the CAN peripheral into the disabled state. the call to XMC_CAN_Init
* below enables it again, which consequently brings the peripheral back into
* its reset state.
*/
XMC_CAN_Disable(CAN);

/* decide on fCAN frequency. it should be in the 5-120MHz range. according to the
* datasheet, it must be at least 12MHz if 1 node (channel) is used with up to
* 16 message objects. This is sufficient for this CAN driver.
Expand Down
6 changes: 6 additions & 0 deletions Target/Demo/ARMCM4_XMC4_XMC4700_Relax_Kit_Keil/Prog/boot.c
Expand Up @@ -270,6 +270,12 @@ static void BootComCanInit(void)
XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t baud;
unsigned long receiveId;

/* set the CAN peripheral into the disabled state. the call to XMC_CAN_Init
* below enables it again, which consequently brings the peripheral back into
* its reset state.
*/
XMC_CAN_Disable(CAN);

/* decide on fCAN frequency. it should be in the 5-120MHz range. according to the
* datasheet, it must be at least 12MHz if 1 node (channel) is used with up to
* 16 message objects. This is sufficient for this CAN driver.
Expand Down
5 changes: 5 additions & 0 deletions Target/Source/ARMCM0_XMC1/can.c
Expand Up @@ -101,6 +101,11 @@ void CanInit(void)
* in case a different CAN channel is configured.
*/
ASSERT_CT((BOOT_COM_CAN_CHANNEL_INDEX >= 0) && (BOOT_COM_CAN_CHANNEL_INDEX <= 1));
/* set the CAN peripheral into the disabled state. the call to XMC_CAN_Init
* below enables it again, which consequently brings the peripheral back into
* its reset state.
*/
XMC_CAN_Disable(CAN);

/* decide on fCAN frequency. it should be in the 5-120MHz range. according to the
* datasheet, it must be at least 12MHz if 1 node (channel) is used with up to
Expand Down
6 changes: 6 additions & 0 deletions Target/Source/ARMCM4_XMC4/can.c
Expand Up @@ -111,6 +111,12 @@ void CanInit(void)
#else
ASSERT_CT((BOOT_COM_CAN_CHANNEL_INDEX >= 0) && (BOOT_COM_CAN_CHANNEL_INDEX <= 2));
#endif

/* set the CAN peripheral into the disabled state. the call to XMC_CAN_Init
* below enables it again, which consequently brings the peripheral back into
* its reset state.
*/
XMC_CAN_Disable(CAN);

/* decide on fCAN frequency. it should be in the 5-120MHz range. according to the
* datasheet, it must be at least 12MHz if 1 node (channel) is used with up to
Expand Down

0 comments on commit 7d21803

Please sign in to comment.