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
  • Interesting.
    I tried something similar a while back but I found that osKernelGetState() didn't always return osKernelRunning as one would expect once the system was up and running.

    Can't remember exactly, but I'm sure it sometimes returned osKernelError which caused the function to use the manually incremented tick (as in the above example).
    This in turn plays havoc with any HAL library calls that use HAL_GetTick().
    I suspected that the problems I was seeing were as a result of the occasional osKernelError, and then the manual tick++ was very different to the values returned by osKernelGetTickCount().

    I gave up investigating why I was seeing osKernelError (It was a while ago).

    Now I just use a simple version which works for me:

    uint32_t HAL_GetTick (void) {

    return (uint32_t)osKernelGetTickCount();

    }

Reply
  • Interesting.
    I tried something similar a while back but I found that osKernelGetState() didn't always return osKernelRunning as one would expect once the system was up and running.

    Can't remember exactly, but I'm sure it sometimes returned osKernelError which caused the function to use the manually incremented tick (as in the above example).
    This in turn plays havoc with any HAL library calls that use HAL_GetTick().
    I suspected that the problems I was seeing were as a result of the occasional osKernelError, and then the manual tick++ was very different to the values returned by osKernelGetTickCount().

    I gave up investigating why I was seeing osKernelError (It was a while ago).

    Now I just use a simple version which works for me:

    uint32_t HAL_GetTick (void) {

    return (uint32_t)osKernelGetTickCount();

    }

Children