2021-03-11 05: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
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.
2021-08-19 01: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
2021-03-11 06: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
2021-03-11 12:00 PM
2021-03-15 02: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
2021-08-19 01: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
2021-11-22 06: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
2021-11-22 08:18 AM
There are several other Bugs.
Code as it is generated (left) compared to as it should be (right):
2021-11-22 08:20 AM
Hello @FMink.1
Could you please share your ioc file?
Thanks, Khouloud
2021-11-22 08:39 AM
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