2023-09-29 09:43 AM
Hi, I ran into a bug a while back where some ADC reads I had set up weren't working. In the course of debugging I found that the ADCs only worked after I changed the order in which some automatically generated startup functions were called in order to initialize the DMA controller before the ADCs. However, whenever I make changes to my .ioc and generate code it regenerates these startup functions in the wrong order.
Why is this happening and how do I fix it?
This is the incorrect order they are generated in:
This is the order I have to change it to for the ADCs to work:
Solved! Go to Solution.
2023-09-29 10:33 AM
Hello @EPala.2 ,
Which CubeMx version are you using?
When DMA is used, the MX_DMA_Init shall always be called before any peripheral initialization. This issue is already fixed in CubeMx.
So, make sure to use latest release of CubeMx. Then, please keep me informed about your update.
Imen
2023-09-29 10:18 AM
Hello @EPala.2
I've tried to reproduce this problem with a few boards but I can't. Can you tell me wish board are you using?
Best regards.
II
2023-09-29 10:33 AM
Hello @EPala.2 ,
Which CubeMx version are you using?
When DMA is used, the MX_DMA_Init shall always be called before any peripheral initialization. This issue is already fixed in CubeMx.
So, make sure to use latest release of CubeMx. Then, please keep me informed about your update.
Imen