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] [April 2016 Threads]
I have also posted this in the avrfreaks forum.
http://www.avrfreaks.net/comment/1871906#comment-1871906
I got an application working fine on my robot with ATmega1284p.
I have another robot build on the arduino mega, with the atmega2560 chip.
I have set up to program the arduino mega with avrdude in atmel studio.
The plan was to just change some small context switching things in the port.c file and run the same software on this robot, to make it easy to make changes on both robots with little hassle.
It was not that simple.
I have tried several different port.c-files, but it seems FreeRTOS just stops working when I call vtaskdelay, it does not allow context switch.. It may or may not doing something else, I don't know since I can't use the debugger and check.
The only version of FreeRTOS I seem to get to work, is the version from this repo: https://github.com/greiman/FreeRTOS-Arduino - when I use arduino IDE. I could off course implement my c code from the atmega1284 to the arduino IDE and run it from the .ino file, but I would rather be using atmel studio for both..
I have found some other libraries for freertos and atmega2560 but these seems very bloated and I have trouble picking out what I need to make my application work..
I would really appreciate some tips on how to proceed..
Sincerely
when I call vtaskdelay, it does not allow context switch
Do you mean it does not swich away from the task that called vTaskDelay()? Or that the task that calls vTaskDelay() never runs again? If the latter, then the most likely issue would be that the tick interrupt is not executing. Have you checked that the setup of the timer that generates the tick interrupt is the same between the two AVR parts?
I can't debug using the USB bootloader, but yes, it seems like the task that calls vTaskDelay() does not run again.
I run the FreeRTOS arduino code from the arduino IDE, and my tasks are running as expected.
I use the same FreeRTOS files, in my atmel studio project, and I get this issue. Only changes I made was some arduino specific led blinking that I changed from digitalwrite to bit manipulation.
I could not find the source of my problems, but using these files solved it for me:
https://github.com/feilipu/miniAVRfreeRTOS
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.