Hello,
I working on a project with a BeagleBone Rev. A6 (processor AM3359 ZCZ). In this project I measure the execution time of a FOR loop by a GPIO pin.
The code statement is shown below:
HWREG(SOC_GPIO_1_REGS + GPIO_SETDATAOUT) = (1 << 16);
foo = (unsigned int*) &main;
for (i = 0; i < 1000; i ++) {
tmp += *foo;
foo++;
}
HWREG(SOC_GPIO_1_REGS + GPIO_CLEARDATAOUT) = (1 << 16);
The measured execution time is about 1,17 ms (milliseconds).
I think, that the execution time is wrong (too high), because the MPU is configured with 720 Mhz.
Is my expectance wrong? Or had I mad an error in the CPU initialization?
For the time measurement I had modified the bootloader project of the starter ware „AM335X_StarterWare_02_00_00_07“. In the following the modified main() function is shown.
int main(void) {
unsigned int* foo; unsigned short i;
/* Configures PLL and DDR controller*/
BlPlatformConfig();
GPIO_Initialisation();
while (1) {
HWREG(SOC_GPIO_1_REGS + GPIO_SETDATAOUT) = (1 << 16);
foo = (unsigned int*) &main;
for (i = 0; i < 1000; i ++) {
tmp += *foo; foo++;
}
HWREG(SOC_GPIO_1_REGS + GPIO_CLEARDATAOUT) = (1 << 16);
}
}
For debugging I use the CCSv5.2 and XDS100v2 USB emulator. The Debugger writes the code into the internal RAM.
I had made the following points:
- check the MPU PLL and Core PLL configuration together with a colleague
- check the voltage settings together with a colleague
- execute the code on a NAND flash without a debugger (same execution time)
- execute the code in the internal RAM with a debugger
Thank you for your help.
Philip Hertweck