ADC Injected Mode LL code generation needs manual workarounds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-11 5:50 AM
I am using cubeIDE 1.5.0 with STM32F103RBT
I configured 2 injected channels, triggered by Tim1 trigger out event in the device configuration tool. After that
- code generation for Initializing ADC injected group (call to function LL_ADC_INJ_Init) is completely missing and
- Sequencer Rank configuration contains calls function LL_ADC_INJ_SetSequencerRanks with LL_ADC_REG_RANK_x instead of LL_ADC_INJ_RANK_x
Workaround (added to USER CODE BEGIN ADC1_Init 2):
//Cube IDE does not generate code for ADC INJ Mode initialization.
//SequencerLength setting must be done !!BEFORE!! LL_ADC_INJ_SetSequencerRanks
LL_ADC_INJ_InitTypeDef init_inj;
LL_ADC_INJ_StructInit(&init_inj);
init_inj.SequencerLength = LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS;
init_inj.TriggerSource = LL_ADC_INJ_TRIG_EXT_TIM1_TRGO;
init_inj.TrigAuto = LL_ADC_INJ_TRIG_INDEPENDENT;
init_inj.SequencerDiscont = LL_ADC_INJ_SEQ_DISCONT_DISABLE;
LL_ADC_INJ_Init(ADC1,&init_inj);
//Re-initialize Sequencer Ranks correctly
LL_ADC_INJ_SetSequencerRanks(ADC1, LL_ADC_INJ_RANK_1, LL_ADC_CHANNEL_1);
LL_ADC_INJ_SetSequencerRanks(ADC1, LL_ADC_INJ_RANK_2, LL_ADC_CHANNEL_8);
now, ADC injected channels work as expected, but it seems to me that these are bugs in the configuration tool that should be fixed
Solved! Go to Solution.
- Labels:
-
ADC
-
STM32CubeIDE
-
STM32CubeMX
-
STM32F1 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-19 1:54 AM
Hello @FMink.1​ ,
I'm back again to inform you that issue is now fixed, you can use the latest CubeMX version available on site :)
Khouloud
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-11 6:56 AM
Hello @FMink.1​
Thanks for your feedback,
Could you please check with the latest Cube version (1.6.0 for IDE and 6.2.0 for MX)?
If you still face a problem please share your ioc file to check your case.
Thanks, Khouloud
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-11 12:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-15 2:35 AM
Hello @FMink.1​
Sorry for the delay, thank you for providing your ioc file which helped me to reproduce issues.
Issues confirmed and they will be fixed, many thanks for raising such a problem to our attention =)
Your contribution is always welcome, Khouloud
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-19 1:54 AM
Hello @FMink.1​ ,
I'm back again to inform you that issue is now fixed, you can use the latest CubeMX version available on site :)
Khouloud
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-22 6:48 AM
It does not work. E.g., if 2 injected channels are configured, ADC_INJ_InitStruct.SequencerLength = 2 is set from code generation tool.
But it should be ADC_INJ_InitStruct.SequencerLength = LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS
LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS is not equal to 2, but (0x1 << 20)!
I still need workarounds to get the desired behaviour.
Best regards, Fabian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-22 8:18 AM
There are several other Bugs.
Code as it is generated (left) compared to as it should be (right):
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-22 8:20 AM
Hello @FMink.1​
Could you please share your ioc file?
Thanks, Khouloud
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-22 8:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-25 12:11 AM
Hi @FMink.1​ ,
The original issue has been fixed (issue raised in the description), this one is newer, and thank you for raising it to our attention, I already analyzed the problem and I confirm the issue, but could you please add new post, so that the issue will be visible to the other Community members which are facing the same problem as you and to be able to put a status on it?
Thanks, Khouloud
