Problems with CubeMx 6.12 + adc5 + dma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-22 5:41 AM - last edited on ‎2024-08-26 2:19 AM by mƎALLEm
In my project I use 4 adc, managed with the same code. With adc5, and two channels, I had a problem: I read two equal values, that is, the second was equal to first channel.
After several searches I discovered that, in the adc.c file created by cubemx, in the section relating to adc5,
the line -->sConfig.Channel = ADC_CHANNEL_2;<-- was missing
First channel configuration
/** Configure Regular Channel */
sConfig.Channel = ADC_CHANNEL_1;
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5;
sConfig.SingleDiff = ADC_SINGLE_ENDED;
sConfig.OffsetNumber = ADC_OFFSET_NONE;
sConfig.Offset = 0;
if (HAL_ADC_ConfigChannel(&hadc5, &sConfig) != HAL_OK)
{
Error_Handler();
}
/** Configure Regular Channel */
Second channel configuration
--> sConfig.Channel = ADC_CHANNEL_2; <<-- this was not there
sConfig.Rank = ADC_REGULAR_RANK_2;
I have re-done the configuration with Cubemx several times but the problem remains
Is it a bug?
Can I do something?
It is annoying to have to remember to manually add a line of code in adc.c when I change the configuration in Cubemx.
Thanks
- Labels:
-
ADC
-
Bug-report
-
DMA
-
STM32CubeMX
-
STM32G4 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-22 6:45 AM - edited ‎2024-08-22 6:51 AM
Hello @giancarlofi
Please share your ioc file to reproduce this case.
You can check the "Keep User Code when regenerating" option and change your code in the USER CODE sections, it will be kept as it is, but this option applies only to user sections.
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-22 7:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-23 2:07 AM
Hi @giancarlofi,
I checked your ioc file and the line for ADC_CHANNEL_2 is generated:
Make sure to use the latest release of STM32CubeMX and STM32CubeG4 firmware package.
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-23 2:41 AM
Hi Imen, thank you for your response but the adc is hadc5 not hadc2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-24 9:42 AM
I redid the file generation several times, but the result did not change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-26 1:37 AM - edited ‎2024-08-26 2:31 AM
Hi @giancarlofi ,
You are right. I escalated this issue internally for fix (via internal ticket number 189389)
(PS: The internal ticket number 189389 is only for reference, not available outside of ST)
Thank you for your contribution.
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-26 2:09 AM
Thanks Imen,
to get information on the bug resolution can i follow some maillist or forum?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-26 3:44 AM
We will be back to you when we fix the issue, or you can follow the Main fixed issues for coming releases via wiki page: STM32CubeMX errata - stm32mcu.
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-02 12:26 AM
Hi @giancarlofi ,
I would inform you that this issue is fixed in the latest release of STM32CubeMx v6.13.0 published on st.com.
Thank you again for your contribution.
Thanks
Imen
