Conversation
Eduardo-Barreto
left a comment
There was a problem hiding this comment.
tenho q revisar com mais calma depois devo nao nego pago quando puder
| @@ -0,0 +1,602 @@ | |||
| #MicroXplorer Configuration settings - do not modify | |||
There was a problem hiding this comment.
opa acho q eh bao chamar o outro ioc de micras_v0
There was a problem hiding this comment.
na real eu acho q o meta eh fazer a release e matar o antigo kkkkk aí chama esse só de micras.ioc
…ion for STM32H7 in adc_dma.cpp
There was a problem hiding this comment.
Pull request overview
This PR adds support for a new hardware board version (v1) based on the STM32H7 microcontroller family, alongside the existing STM32G4-based board. The changes introduce the necessary CubeMX configuration and platform-specific ADC calibration code.
Key Changes:
- Added CubeMX configuration file for STM32H725RGVx (STM32H7 family) microcontroller
- Updated board version identifier to "v1" to distinguish between hardware revisions
- Implemented platform-specific ADC calibration for both STM32H7 and STM32G4 families
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| CMakeLists.txt | Sets BOARD_VERSION to "v1", enabling the use of the micras_v1.ioc configuration file |
| micras_hal/src/adc_dma.cpp | Adds conditional compilation for ADC calibration supporting both STM32H7 (with offset calibration) and STM32G4 platforms |
| cube/micras_v1.ioc | New CubeMX configuration file for STM32H725RGVx with DMA, ADC, timers, UART, and SPI peripherals configured |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #if defined(STM32H7) | ||
| HAL_ADCEx_Calibration_Start(this->handle, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED); | ||
| #elif defined(STM32G4) | ||
| HAL_ADCEx_Calibration_Start(this->handle, ADC_SINGLE_ENDED); |
There was a problem hiding this comment.
The ADC calibration code only handles STM32H7 and STM32G4 platforms. If this code is compiled for any other platform, the ADC will not be calibrated, which could lead to inaccurate readings. Consider adding an else clause with a compile-time error or warning for unsupported platforms to make this explicit.
| HAL_ADCEx_Calibration_Start(this->handle, ADC_SINGLE_ENDED); | |
| HAL_ADCEx_Calibration_Start(this->handle, ADC_SINGLE_ENDED); | |
| #else | |
| #error "ADC calibration is only supported for STM32H7 and STM32G4 platforms." |
Configuração inicial do micro no cube