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] [March 2010 Threads] problem wth queue between ISR and TaskPosted by Alessio Tognazzolo on March 27, 2010 Hi to all, i have a big problem: i'm using a queue system to synchronize a task with 2 ISR (one from ethernet and one from timer).ISR unblock task with a binary semaphore. Inside ISR i'm using a queue to create events to insert into it(with xQueueSendFromISR function) and in the task i have a loop blocked with a xSemaphoreTake.Idon't understand why i have a bus fault when i execute the instruction xSemaphoreTake. Thanks in advice for your answer,
Alessio
RE: problem wth queue between ISR and TaskPosted by Dave on March 27, 2010 Which architecture are you using? Are you basing your project on a provided demo? Have you created the semaphore and the queue before you use them (especially if the interrupt is executing before the scheduler is started)? Is anything working?
RE: problem wth queue between ISR and TaskPosted by Richard Damon on March 27, 2010 If it was created as a semaphore, then the ISR should use xSemaphoreGiveFromISR not xQueueSendFromISR, while Semaphores are built on Queue code, I don't think they are interchangeable (for instance, Semaphores set up the queue for a zero byte object, and the QueueSend may not be set up to handle something like that.
RE: problem wth queue between ISR and TaskPosted by Alessio Tognazzolo on March 27, 2010 i'm using a STM32 architecture with Cortex M3 processor. I creathed both semaphore and queue before enable interrupts.I'm using a queue to simulate a producer-consumer model.Everytime i have an interrupt i insert an element in the queue,after i unblock task that consume elements in the queue. About ISR first i must insert an element on the queue (and i do it with xQueueSendFromISR) and after i do xSemaphoreGiveFromISR and finally before leave ISR i do portEND_SWITCHING_ISR.
RE: problem wth queue between ISR and TaskPosted by Dave on March 27, 2010 Are you totally 100% sure that the priority of the interrupt is equal to or low than configMAX_SYSCALL_INTERRUPT_PRIORITY? On the STM32 for the priority to be lower the value of the priority must be higher (0 is the highest priority and 255 is the lowest priority, so if you don't set the priority it will be 0 by default and therefore the highest possible and this will cause an issue). Also, how the priority is specified depends on the function used to set it. Some need the priority to be shifted to the top bits when others don't. This is nearly always the problem with interrupts on Cortex M3 parts.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|