- Task creation :
- USBMANAGERSENDER (7U)
- USBMANAGERRECEIVER (8U)
- USBDRIVERPRIORITY (9U)
- BLETASKPRIORITY (6U)
- Interrupt priorities :
- BLEUARTINTERRUPT_PRIORITY (7U)
- FTDIUARTINTERRUPT_PRIORITY (5U)
Hello, I’m new to FreeRTOS and I’ve been working on this for 2 days, that’s the reason i’m asking for your help. I have three tasks running. One is used to communicate with a bluetooth device, and the 2 others are used for TX and RX over USB (UART). My app works fine when I send or receive data to my bluetooth device but when I command my bluetooth device to enter discover mode, there is so much data incoming that I can’t process everything. My queue used for bluetooth data management gets full and my app won’t respond to any command I send. Priorities used in my app :
Can you please show how you are creating and using the queue. Thanks.
If you are using the queue as a simple character fifo, it is quite possible to overload your system, as is well described in the documentation and examples. There is a LOT of over head for each character. A stream buffer or message buffer might be more efficient, or some method where you build up a buffer of data for a message, and just send a buffer address through a queue. You also may need a much larger queue to be big enough to hold the amount of data you need, and have some form of dealing with overrun.
Here is some code from my project. I hope this files are clear. Thanks in advance for your feedback and your help on my code. As i said, any help is appreciated 🙂
Really I was hoping for just a cut down piece of code that showed how the queue in question was being used. Looks like there are quite a lot of queues in the code you posted.
yeah sorry about that :/ I tought it would be interesting for you guys to have it all, so you can see everything and tell me if i’m doing something really wrong.. I will post something shorter 🙂
Hello again, it’s been a week and i’m still working on this, it’s kind of an annoying feeling.. I found some minor mistakes in my code and I hope it would fixed the problem but it did not. After that I tried to implement a few things that did not worked ( stopping dma stream, changing task priorities, adding a mutex, ..) I also have been reading the practical guide to master FreeRtos. but still a few quetions came to my mind : is it possible that fast interrupt starve task from process time and if yes how can I handle this from happening ? I also thought my problem could come from the fact that my ble driver wait on a queue that receive from interrupt and from a task in communciationManager. Just so you guys know, this code has not been written by me. I made a few corrections but as someone with few experiences I find it hard to work on someone else (big) project .. Guess i’ll be working on this for a while so any help is welcome 🙂
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.