let's say I need to use a mutex in my driver layer and I don't want to use FreeRTOS calls that deep in my code (to keep the drivers independent from FreeRTOS).
Is there any side effect of using the ARM Cortex-M mutex instructions when using FreeRTOS:
I do use the FreeRTOS semaphores and mutex in my application layers, but I want to avoid using them at driver levels.
Thanks a lot!
FreeRTOS mutexes are heavy as they use the queue code so can have any number of tasks blocked on giving or taking them. They do give you blocking ability and priority inheritance though. Do not use a spin lock on a Cortex instruction because lower priority tasks will be starved and you will get deadlock if a starved task has the lock.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.