AnsweredAssumed Answered

STM32F0 Discovery Reading ts_cal1 and ts_cal2 from system memory

Question asked by romain reicher Employee on Jun 20, 2013
Latest reply on Jun 23, 2013 by Clive One

I'm desperate to not achieve my project with the internal temperature sensor of STM32F0
For now I try to read the sensor factory calibration data stored in the system memory by simple pointer that way.

(53) uint16_t ts_cal1, ts_cal2;
(54) ts_cal1 = *(uint16_t*)(0x1FFFF7B8);
(55) ts_cal2 = *(uint16_t*)(0x1FFFF7C2);

The KEIL compiler does not
appreciate ...

..\main.c(55): error:  #77-D: this declaration has no storage class or type specifier
..\main.c(55): error:  #28: expression must have a constant value

Do you have any advice or tell me what I forgot?

Also, is that one of you has already managed to use the formula in the datasheet Temperature (in ° C) = {(V25 - VSENSE) / Avg_Slope} + 25?