ISR

Hi Can you please tell me the next questions : 1.What is System_Tick() interrupt priority in FREE RTOS ? 2.What is the range of Tasks priority in Free RTOS ? 3.What is the range of ISR priority in Free RTOS ? 4.Can in use librery functions in ISR ( for example memset in ISR) ? Thank You Michael

ISR

Which port are you using?

ISR

FreeRTOS V8.2.1

ISR

I meant which MCU and compiler are you using FreeRTOS with?

ISR

I am using MCU STM32F205RC. Compiler: I am using Atollic

ISR

1.What is System_Tick() interrupt priority in FREE RTOS ?
Search for configKERNELINTERRUPTPRIORITY on this page http://www.freertos.org/RTOS-Cortex-M3-M4.html and other pages on the website.
2.What is the range of Tasks priority in Free RTOS ?
http://www.freertos.org/RTOS-task-priority.html
3.What is the range of ISR priority in Free RTOS ?
That depends on the MCU as not all Cortex-M devices have the same priority ranges. See the link posted in answer to question 1 and the user manual for your STM32.
4.Can in use librery functions in ISR ( for example memset in ISR) ?
That depends on the library function. Juse when writing a bare metal application (with no OS) callilng memset() should be fine, but calling something like malloc() or printf() would be a very bad idea.

ISR

Thank You !

ISR

Hi I am using MCU STM32F205RC. Compiler: I am using Atollic FreeRTOS V8.2.1 I have some questions:
  1. Is it possiable that ISR1 is stop running (preempted) by another ISR2 (when ISR2 have higher preority than ISR1) ?
    1. Is it possiable that ISR1 is stop running (preempted) by another ISR2 (when ISR2 have lower preority than ISR1) ?
    2. Is it possiable that ISR1 is stop running (preempted) by another ISR2 (when ISR2 have the same preority than ISR1) ?
Thank You

ISR

These are questions about the hardware, the answers to which are in the ARM documentation. An interrupt can itself only be interrupted by another interrupt if that other interrupt has a higher priority.

ISR

Thanks ! Can you please tell me what is the use of those functions portSETINTERRUPTMASKFROMISR(); portCLEARINTERRUPTMASKFROMISR();

ISR

System Tick has higher priorty than ISR’s. Can System Tick preempt ISR’s ? How can I avoid race condition between ISR’s ? Is it by using portSETINTERRUPTMASKFROMISR ? Thanks

ISR

portSETINTERRUPTMASKFROMISR(); portCLEARINTERRUPTMASKFROMISR();
These are the equivalent of taskENTERCRITICAL() and taskEXITCRITICAL() for us in ISRs and are used to avoid race conditions. You can call taskENTERCRITICALFROMISR() and taskEXITCRITICALFROMISR() too which makes this more obvious. You will find examples of how the functions are used inside the queue.c file.
Can System Tick preempt ISR’s ?
System tick is an ISR so I think this has already been answered. Normally the system tick is the lowest priority ISR.

ISR

I never use the function memcpy in ISR. But i use in in tasks. Is it good or is it bad to use critical section with memcpy in tasks ? For example :
    portENTER_CRITICAL();

    memcpy(&I2, &I1, sizeof(I1_FLSMsrEvnt));

   portEXIT_CRITICAL();

ISR

memcpy() itself does not need a critical section. The only time you would need a critical section is if the buffer being memcpy’ed to or from could be accessed by another task while the memcpy operation was in progress. If there are any occasions that you need to use a critical section in an interrupt then use taskENTERCRITICALFROMISR() and taskEXITCRITICALFROMISR() in place of taskENTERCRITICAL() and taskEXITCRITICAL(). See http://www.freertos.org/taskENTERCRITICALFROMISRtaskEXITCRITICALFROMISR.html for information on how to use the _FROMISR() versions.

ISR

Thank You. Is a local variable of task remains his value after context switch to another task and back or the local variable of a task reinitilized to his original value ?