Mar 21, 2019
07:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 21, 2019
07:28 AM
In the XMC_lib v2.1.20 library there is a flaw: using the "XMC_CCU4_SLICE_CaptureInit" API, all the settings made in the CC4yCMC register are reset!
The cause of this defect is the following: in the file "xmc_ccu4.c" in line 397 the following statement is written:
slice->CMC = ((uint32_t)capture_init->timer_concatenation << CCU4_CC4_CMC_TCE_Pos);
In this way the entire contents of the register (except for the setting of the "timer_concatenation" flag TCE) is reset, and all settings made previously to the API are lost. 😞
Regards
Andrea
The cause of this defect is the following: in the file "xmc_ccu4.c" in line 397 the following statement is written:
slice->CMC = ((uint32_t)capture_init->timer_concatenation << CCU4_CC4_CMC_TCE_Pos);
In this way the entire contents of the register (except for the setting of the "timer_concatenation" flag TCE) is reset, and all settings made previously to the API are lost. 😞
Regards
Andrea
3 Replies
Mar 25, 2019
09:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 25, 2019
09:15 AM
Hi Andrea,
It is the task of the Init function to initialize the peripheral. Why are you expecting that the registers would keep their previous value after the Init function is called? What is your use case?
Regards,
Jesus
It is the task of the Init function to initialize the peripheral. Why are you expecting that the registers would keep their previous value after the Init function is called? What is your use case?
Regards,
Jesus
Mar 28, 2019
03:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 28, 2019
03:07 AM
jferreira wrote:
Why are you expecting that the registers would keep their previous value after the Init function is called? What is your use case?
The CC4yCMC register contains the settings valid for all external timer commands (Start, stop, gate, count, capture, etc.).
If I previously used "XMC_CCU4_SLICE_CountConfig" or "XMC_CCU4_SLICE_DirectionConfig" for example, when I call the "XMC_CCU4_SLICE_CaptureInit" function it happens that all settings made by the two functions in the CMC register are lost.
This happens if I want to configure, for example: Event0 = Count, Event1 = direction, Event2 = capture.
Regards
Andrea
Apr 01, 2019
05:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 01, 2019
05:30 AM
There is only one way to get around this problem: first do the initialization as "capture" and then edit the other events to do what is necessary.
Andrea
Andrea