cancel
Showing results for 
Search instead for 
Did you mean: 

ADC won't start after Cube upgrade

S-E
Associate II

Hi,

I have a project on Nucleo board with STM32U575ZIT6Q. I'm using STM32CubeIDE.

My ADC worked fine until i did this:

migration.PNG

After migration HAL_ADC_Start function returns error.

When I generate code I use this setting:

code gen.PNG

What is wierd, is that if I unselect this box, and generate code then ADC starts to work again!

Since I need to have those files separate I have to use previous Cube version.

Is there something I need to do or this is a SW bug?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Found the differences:

main() is the same and calls all functions in same order
both projects generate a warning about the SMPS when clicking generate, instructions unclear how to solve this
MMTAppRegionsCount differers, the "ok" has 0 regions enabled and the "nok" version has 3 regions enabled in the ioc file, but I see no difference in generated code
ProjectManager.CoupleFile=false in the ok version, true in not ok
MX_ADC4_Init() is the same
MX_GPIO_Init() is the same
MX_ICACHE_Init() is the same
HAL_ADC_MspInit() is the same
HAL_ADC_MspDeInit() is the same
HAL_MspInit() DIFFERS!
Line "HAL_PWREx_EnableVddA();" is not generated!

To me this is a bug. You can add HAL_PWREx_EnableVddA() in the user code section and that should fix it. Please let me know if that works.

ST needs to be aware of this. Please add bug-report tag to your start post.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

View solution in original post

8 REPLIES 8
Ghofrane GSOURI
ST Employee

Hello @S-E 

First let me thank you for posting.

I would appreciate it if you could share your IOC, as this will help me investigate the issue.

THX

Ghofrane

unsigned_char_array
Senior III

Compare the generated code with a diff tool (git, diffmerge, winmerge, etc.) and tell us the difference. Do you have any user code sections or is your generated code unmodified?

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

Hi,

IOC file is here.

Only ADC is set.

unsigned_char_array
Senior III

Please upload both ioc files. I cannot compare one ioc file with itself and I cannot open the one you uploaded in V6.11.1. Upload the working one (V6.11.1) and the nonworking one (V6.12.0).

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

Hi,

Files are here.

Both should be V6.12.0.

Found the differences:

main() is the same and calls all functions in same order
both projects generate a warning about the SMPS when clicking generate, instructions unclear how to solve this
MMTAppRegionsCount differers, the "ok" has 0 regions enabled and the "nok" version has 3 regions enabled in the ioc file, but I see no difference in generated code
ProjectManager.CoupleFile=false in the ok version, true in not ok
MX_ADC4_Init() is the same
MX_GPIO_Init() is the same
MX_ICACHE_Init() is the same
HAL_ADC_MspInit() is the same
HAL_ADC_MspDeInit() is the same
HAL_MspInit() DIFFERS!
Line "HAL_PWREx_EnableVddA();" is not generated!

To me this is a bug. You can add HAL_PWREx_EnableVddA() in the user code section and that should fix it. Please let me know if that works.

ST needs to be aware of this. Please add bug-report tag to your start post.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

Hello @unsigned_char_array 

Concerning the missing  HAL_PWREx_EnableVddA() , I confirm that this is a bug that has been raised to our dev team and this will be fixed as soon as possible .

Internal ticket number:143431  (This is an internal tracking number and is not accessible or usable by customers).

I will keep you posted with updates.

THX

Ghofrane

Hi,

Adding HAL_PWREx_EnableVddA() works!

Thank you for investigating.