2025-02-07 03:01 AM
I noticed that the ROM constants for ADC calibration values in the LL headers (*_ll_adc.h) are not defined as const.
e.g.
#define VREFINT_CAL_ADDR ((uint16_t*) (0x1FF07A2A))
#define TEMPSENSOR_CAL1_ADDR ((uint16_t*) (0x1FF07A2C))
#define TEMPSENSOR_CAL2_ADDR ((uint16_t*) (0x1FF07A2E))
And it should be:
#define VREFINT_CAL_ADDR ((const uint16_t*) (0x1FF07A2A))
#define TEMPSENSOR_CAL1_ADDR ((const uint16_t*) (0x1FF07A2C))
#define TEMPSENSOR_CAL2_ADDR ((const uint16_t*) (0x1FF07A2E))
Trying to write to it probably results in hardfault errors, but it should raise compile errors too in my opinion.