Problem with stm32f745 work
After the firmwared (or power off-on) and after the reset the same program takes a different amount of time in ticks. Find it in my oun code. Then tried to create code in Cube and check it - same thing. Then I checked clocking settings and frequency - it was same and after power off-on and after reset (HSE 8MHz, Sys 216M). Then I checked systic interruption systic (setting for 1ms), and it always was 1ms.
What to do and why it can be?
For example the simplest program:
volatile uint32_t *DWT_CONTROL = (uint32_t *)0xE0001000;
volatile uint32_t *DWT_CYCCNT = (uint32_t *)0xE0001004;
volatile uint32_t *DEMCR = (uint32_t *)0xE000EDFC;
volatile unsigned int *DWT_LAR = (volatile unsigned int *)0xE0001FB0;
uint32_t Mcounter, count;
main()
{
*DWT_LAR = 0xC5ACCE55; // unlock (CM7)
// enable the use DWT
*DEMCR = *DEMCR | 0x01000000;
// Reset cycle counter
*DWT_CYCCNT = 0;
// enable cycle counter
*DWT_CONTROL = *DWT_CONTROL | 1 ;
SystemClock_Config();
while(1)
{
u8 i=0;
Mcounter=*DWT_CYCCNT;
i =1;
count=*DWT_CYCCNT-Mcounter;
float op_time=count/216.0f;// count/F_CPU
SendToUart(count);
}
}
count after power off-on = 0;
count after reset = 34 ticks;