FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [December 2016 Threads]
In the CCS/ARMCortex-R5 port (used for TI Hercules RM57 safety processors, in particular) the portSETINTERRUPTMASKFROM_ISR() macro is not defined, so it ends up being stubbed out.
This macro is used from the various ...FromISR() functions to disable interrupts.
Unfortunately, the ...FromISR() functions CAN be called from Tasks. In particular, FreeRTOS+UDP does this all the time (see xProcessReceivedUDPPacket() in FreeRTOS_Sockets.c, for example). The net result is that interrupts are not disabled during various OS critical sections inside these ...FromISR() functions, and internal OS structures end up getting mangled if interrupts occur at the wrong times.
There seems to be an impression (perpetuated in posts on this forum, even, see https://sourceforge.net/p/freertos/discussion/382005/thread/c7121eea/?limit=25#2487) that this macro can be stubbed out if the port does not support nested interrupts. This is simply untrue.
I have a proposed fix if that would be helpful. I want to make sure that the intent is understood first.
While the generic Cortex-R port does support interrupt nesting, and does implement portSETINTERRUPTMASKFROMISR() (see https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/portable/GCC/ARMCR5/portmacro.h) the older and Hercules specific CCS port you are referring to does not support interrupt nesting as I recall so doesn't implement portSETINTERRUPTMASKFROM_ISR(). It would be interesting to see your proposed fix, but it might be easist to just replace the 'FromISR' versions of functions in the UDP code with their non-ISR equivalents.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.