The general structure of the headers for STM32 peripherals inside CMSIS,
typedef struct {
__IO uint32 REGn;
// ...
} SOC_PER_TypeDef;
#define SOC_PER_BASE 0x40003000
#define SOC_PER ((SOC_PER_TypeDef *) SOC_PER_BASE)
And then a 'call/use' site is,
if(SOC_PER->REGn != 0) /* xxx */;
Eva is responding with text like,
out of bounds read.
assert \valid_read(&((IWDG_TypeDef *)((uint32_t)(0x40000000 + 0x3000)))->SR);
The define __IO
is compiler specific (located in CMSIS) and is volatile
.
Could I redefine __IO
to accommodate frama-c? Or should I be targeting SOC_PER_BASE
with an annotation of some sort. Are their pre-defined pre-processor variables to update headers?
Ie,
#ifdef FRAMA_C
extern SOC_PER_TypeDef SOC_PER_stub;
#define SOC_PER_BASE &SOC_PER_stub
#else
#define SOC_PER_BASE 0x40003000
#endif