STM32HAL need HAL_gettick() but CMSIS_OS2 without os_time how do i ... ( ¯¨̯ ¯̥̥ )
Hi Milorad,
I use your nops delay exactly and I get a delay of 1 sec !!!! I use STM32F4 and Keil compiler and my SystemCoreClock is 72MHz. What is your SystemCoreClock?
Hi Julio,
I guess you are right, the SystemCoreClock should be also divided by 1000, so to not use integer math we should divide it by 1024 (it is close enough for this usage case) which is same as shifting to right for 10 bits, so the "for" loop should be corrected as follows:
for (i = (SystemCoreClock >> 14U); i > 0U; i--) { __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); }
Best regards, Milorad