This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

about CMSIS_OS2 and STM32HAL how use?

STM32HAL need HAL_gettick() but CMSIS_OS2 without os_time how do i ... ( ¯¨̯ ¯̥̥ )

Parents Reply Children
  • 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