Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

LwIP's sys_arch realization calls prohibited osSemaphore* functions from ISR #548

Open
Snarkorel opened this issue Aug 14, 2017 · 1 comment

Comments

@Snarkorel
Copy link

Current realization of LwIP's sys_arch.cpp sys_arch_sem_wait() function calls osSemaphoreWait() function from CMSIS-RTOS API, that's prohibited to use while we are in interrupt handler.
It should be rewritten to use ISR-safe methods, e. g. queue or mailbox.

@Snarkorel Snarkorel changed the title LwIP's sys_arch realization calls prhobitied osSemaphore* functions from ISR LwIP's sys_arch realization calls prohibited osSemaphore* functions from ISR Aug 14, 2017
@Snarkorel
Copy link
Author

Since CMSIS-RTOS doesn't have critical sections, problem can be solved by defining LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT option in lwipopts.h and implementing custom sys_arch_protect/sys_arch_unprotect functions at sys_arch.cpp that will disable interrupts instead of using semaphores.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant