- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
There is a problem in the XMC_ERU_ETL_Init() function that can cause issues.
The function call uses the union XMC_ERU_ETL_CONFIG_t
union
{
uint32_t input;
struct
{
uint32_t input_a: 2;
uint32_t input_b: 2;
uint32_t : 28;
};
....
}
The function call XMC_ERU_ETL_Init() assumes that the user has zeroed out 28 most significant bits in the input field. This may not be the case if the config is on the stack, i.e.
XMC_ERU_ETL_CONFIG_t etl_config;
etl_config.input_a = 1;
etl_config.input_b = 1;
XMC_ERU_ETL_Init(.., .., &etl_config);
The above call will randomly overwrite the configuration in the EXISEL register... causing issues in previously set-up ERUs.
To fix this the user must explicitly zero initialize the config. So the following code will work fine:
XMC_ERU_ETL_CONFIG_t etl_config = { 0 };
etl_config.input_a = 1;
etl_config.input_b = 1;
XMC_ERU_ETL_Init(.., .., &etl_config);
This is easy to miss and can cause hard to troubleshoot problems.
I suggest that the XMC_ERU_ETL_Init() call is modified to explicitly zero out the 28 most significant bits before assignment to the EXISEL register.
Andriy
- Labels:
-
XMC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @andriy ,
Can you please mention the device, that you are using? I will try to check at my end first to understand the issue.
Best Regards,
Aashita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I'm using the XMC4700 Relax kit.