ADC Not Working STM32H7A3RI
Show older comments
Hello, I have a custom PCB with an STM32H7A3RITx with 5 ADCs, however I have been unable to get the Analog to Digital Converter block in Simulink to work properly. Setting the block to "read results only" results in the ADCs reading max value, however setting the block to "trigger and read" results in my code crashing. I've messed with the STM32CubeMX ADC settings to see if I can make things work, but I have been unable to do so.
Additionally, I've attempted to keep the Analog to Digital Converter block set to read only, with ADC Continuous Conversion Mode enabled, however that creates the following error when I build: Continuous conversion Mode is currently not supported. Open STM32cubemk project > Pin & Configuration > Analog > ADC1 > Parameter Settings > Configuration > ADES_Common Settings and Set the Continuous Conversion Mode as 'Disabled'
Matlab r2024b, STM32CubeMX 6.4.0
What am I missing to make this work? Thanks!




1 Comment
Isha
on 15 Jun 2026
Hello,
From your description, there are a couple of configuration points that are likely contributing to the behavior you are observing:
1. Continuous Conversion Mode
The error you encountered indicates that continuous conversion mode is not supported by the Analog to Digital Converter block in this workflow.
Please ensure that this option is disabled in your STM32CubeMX project before rebuilding.
2. “Read results only” returning maximum value
In this mode, the block expects that ADC conversions are already being performed. If no valid trigger is configured, the ADC result register may not be updated, which can result in constant or maximum values being read.
Please verify:
- A valid trigger source is configured (software or external), and
- The ADC is actively performing conversions before attempting to read the result.
3. “Trigger and read” causing crash
This behavior typically indicates a mismatch between:
- The trigger configuration in Simulink, and
- The ADC settings in STM32CubeMX
Ensure that:
- The trigger source defined in Simulink matches the configuration in CubeMX
- Unsupported modes (such as continuous conversion) are not enabled simultaneously
4. Recommended Debugging Approach
To isolate the issue, we recommend starting with a simpler setup:
- Single ADC channel
- Basic trigger configuration (e.g., software trigger)
- No continuous conversion mode
Once verified, you can gradually extend to your full configuration.
Hope this helps.
Answers (1)
Shivam
on 30 Jun 2026
0 votes
Hello @William
I was not able to reproduce the issue faced by you. Seems like there is some file missing which initialises the model. We will need more information.
If the issue is not resolved even after trying out the steps listed in the comment by @Isha, kindly contact the Technical Support for further assistance:
Please make sure to attach the relevant files pertaining to the project like simplified/reduced Simulink model and the IOC file. It will be helpful in reproducing the issue faced by you.
Regards,
Shivam
Categories
Find more on Get Started with STM32 Microcontroller Blockset in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!