I'm working on a SoC
test board, based on ARM Cortex M0+. The SoC
is equipped with 5 memory banks and is capable of voltage and frequency scaling. But the issue i'm facing is, when ever I write some data/value to r/w registers at some address with some frequency lower than default frequency (20.8 MHz), is causing data corruption in such a way that each value is being written at multiple register addresses, despite of one value at one address. Code looks as follows:
int main(void)
{
//AP_PLL->CLKREF_RM = 0x000104f6; //32768 * 0x4F6 => 41.7 MHz;
//AP_PLL->CLKREF_RM = 0x0001027b; //32768 * 0x27b => 20.8 MHz;
AP_PLL->CLKREF_RM = 0x00010140; //32768 * 0x4F6 = 10.8 MHz;
for (int i = 0; i < 200; i++)
{
*((unsigned int*) 0x1000 + i) = i;
}
return 0;
}
output when running at 10 Mhz : 0L, 0L, 1L, 1L, 1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 6L, 6L, 6L, 6L
expected output : 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L