2024-02-21 04:43 PM
I am trying to run a simple ADC example provided by STM32CubeIDE for my Nucleo-H743ZI2 board. I know the basic functionality of the board hardware and computer connection is OK, because I was able to write a simple program to blink all three user LEDs (LD1, LD2, LD3) on the board, and that works as expected.
However the example code, for which the README file starts as below, does not work. It compiles without error, it loads and it runs, but after some delay it ends up in the Error_Handler code with the red LD3 LED after the call to HAL_ADCEx_Calibration_Start() returns 0x01 instead of the HAL_OK = 0x00 value expected. Is there anything obvious I might be doing wrong? The only thing that occurs to me is this example was provided for the Nucleo-H743ZI and not the Nucleo-H743ZI2 that I have, but the latter part number does not show up in any examples, at all so I assumed maybe it was compatible (?)
ADC_RegularConversion_Polling conversion using Polling
******************** (C) COPYRIGHT 2017 STMicroelectronics *******************
ADC/ADC_RegularConversion_Polling/readme.txt
MCD Application Team
Description of the ADC RegularConversion Polling example.
******************************************************************************
- This example runs on STM32H743xx devices.
- This example has been tested with NUCLEO-H743ZI board and can be
easily tailored to any other supported device and development board.
[...]
if (HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_CALIB_OFFSET_LINEARITY, ADC_SINGLE_ENDED) != HAL_OK)
{
/* Calibration Error */
Error_Handler();
}
2024-02-21 04:49 PM - edited 2024-02-21 05:06 PM
I might add, the call to HAL_ADCEx_Calibration_Start() takes about 66 seconds after start before returning with a value 1 and while I'm not sure how long is normal, this length of time seems excessive. I have now tried this on two different Nucleo-H743ZI2 boards, with the same results, so it doesn't look like an isolated hardware issue.
If I simply remove the call to the calibration start, then I immediately get to the Error_Handler() again with the next call, to HAL_ADC_Start()
However, note that the prior calls to HAL_ADC_Init() and HAL_ADC_ConfigChannel() were successful, so it's not like the hardware doesn't exist, I would think anyway.
2024-02-21 05:15 PM
Further reading indicates there are differences between the H743ZI and the H743ZI2, the boards are apparently not compatible, including in the ADC section definitions. So there should be a separate, different example for the ZI2 board, but there is not, and I guess I'm out of luck for finding a working example to start with.
2024-02-22 02:54 PM
FWIW I managed to get some code working by modifying a project I had previously from a different board. Still feels odd that ST has example code for the obsolete H743ZI board, but not the current H743ZI2 which is not exactly brand new, given it came out 4+ years ago.