Well this is a quick-and-dirty port of FreeRTOS for the ATXMega. It is not 100% tested, but it works fine.
AVR_ATXMega128A1_WinAVR.zip
FreeRTOS Interactive
|
Well this is a quick-and-dirty port of FreeRTOS for the ATXMega. It is not 100% tested, but it works fine.
Hello everybody,
if you download this port, then please give me a sign, a hello or at least some feedback so I know this posting was useful.
Hello Roman
I have 3 warning when I compile it with AVRstudio and winavr:
../FreeRTOS/Source/tasks.c:420: warning: cast from pointer to integer of different size
../FreeRTOS/Source/tasks.c:420: warning: cast to pointer from integer of different size
../FreeRTOS/Source/portable/GCC/ATXMega128A1/port.c:245: warning: cast from pointer to integer of different size
Please help me to remove these warnings ,Is these warnings critical to application?
Why the author does not respond?
3 warning exist in code!
> Why the author does not respond?
Well, first he is under no obligation to, he has provided the code for your use out of his own kindness, second he posted the code weeks ago and probably does not check the site every hour to see if there are any comments.
Those warnings actually exist in the mainline code on 8 bite devices, and are not something Roman has introduced. I believe you have had a reply to your question in the AVRFreaks forum too, and this has been discussed on the FreeRTOS support forum.
Please remember this forum is not a support forum. A separate forum exists for free support. I will leave these posts here long enough for you to read this, then remove them.
Hi Roman:
I'm going to use your port as the basis for an ATXMega64A3 port for myself. I don't expect there will be many changes, possibly none. I'll let you know, and if it seems robust I'll upload it to the forum.
Thanks,
DaveA
Sound nice Dave!
Best Regards R.B.
Hi Roman!
I have downloaded your port. I am working on xmega port of my own, but it is based on my previous atmega1280 port. In order to get FreeRTOS working properly on atmega1280 I had to modify portSAVE_CONTEXT(), portRESTORE_CONTEXT() and pxPortInitialiseStack() to save RAMPZ and EIND as well. Otherwise I had experienced problems when accessing data (bitmaps, strings, other data) in flash memory from different tasks. I think xmega port needs same corrections. I can send you those by email if you want. Also I want to use RTC as tick counter to allow to change main system frequency, while tick frequency remains 1 kHz. But damn RTC can only be clocked by 1,024 kHz internally and it is too slow (can get only 250 Hz tick frequency so far).
I want to thank you for some tips like how to declare naked interrupt.
Great job!
Regards,
Yuriy
Well That sounds great. I worked a while ago on the xmega port. I definitely circle back to it soon. Thank you for the tips about saving RAMPZ and EIND as well I will insert them to the context functions too.
Thanks
Regards
Roman
Hi Roman!
I want to thank you again for your contribution. Is it possible to discuss some issues via email? My email address is yuriy.kulikov.87@****.com
Moderator, i believe this post could to be deleted after a while.
If there are any issues, I would prefer them to be discussed here, so everybody can learn and benefit.
Thanks.
Hi Barry!
Ok, I just thought it would be better to post results here, not issues themselves.
Problem only exists, when I use my old portSAVE_CONTEXT(), portRESTORE_CONTEXT() and pxPortInitialiseStack() from Atmega1280 port. I had to add RAMPZ and EIND saving in order to use memory above first 64K (see "XMEGA D MANUAL", section 3.10 RAMP and Extended Indirect Registers). After these modifications I was able to read data from flash memory from different threads on Atmega1280.
The promblem I have encountred on XMEGA192D3 is reset of MCU, after first "ret" instruction is called in vTaskStartScheduler();:
------code------------
/* Restore the context of the first task that is going to run. */
portRESTORE_CONTEXT();
/* Simulate a function call end as generated by the compiler. We will now
jump to the start of the task the context of which we have just restored. */
asm volatile ( "ret" );
-----end of code-------
After this instruction MCU resets. When I don't save RAMPZ and EIND, RTOS runs fine. I do believe that XMEGA have the same core as atmega. Maybe RAMPZ's address is different? Unfortunately, I was not able to find memory map for XMEGA.
Have anybody tried to save additional registers on XMEGA? I want to contribute my own xmega port after I finish my work on using main drivers from Atmel framework provided for xmega. Access to whole memory should be available for this port.
Regards,
Yuriy
OK, I have found memory mapping, and these registers have the same addresses as in atmega. Still, I don't understand why saving the,=m results in reset.
I'd like to have FreeRTOS to play with on an xmega256a3. I'm new to all of this. This looks like the closest starting point. Is there anyway to tell what version of FreeRTOS this was built on? I would like to use V7.3.0 (for the tickless support). Given this was 2010, I'm expecting it's an older version, but don't know which.
I have question about AVR_ATXMega128A1_WinAVR: This project is finished and tested ?
Hey gpls,
I finished this project just before I posted it in 2010. I Developed this port on an explain board:
Inside this DEMO I configured a couple of tasks where some LEDs are put on and off, which is done in different periods of time. After some time you see the LEDs running asynchronously.
Inside the context switch I am pushing and popping only the cpu registers and nothing else, there could be some issues about Memory above 64K, like seen in the discussion above.
I tested it in a kind of smoke test, it wasn't a complete coveraging unit/system or whatever test.
I think I am going to be at the Embedded World next week it seems to be 27.02. and then I like to visit freeRTOS there, just to say hello to Mr. Barry :-) If you going to be there too, we could meet and talk about those points.
Regards
Roman
I use ATxmega128A1 with no external memory. I use only internal SRAM. In my project I have 3...5 simple task.
If I work with only internal SRAM there may be some problems with pop and push ?
ps. Roman, where are you from ?
Well then it seems to be exactly the same controller I ported it for and you can use my port directly. I don't see, why you should expect some problems with context switch using only internal mem. Take care as it was the version 5.xx or something, but I think there's not going to be a big difference to the actual version of it. If you still want to use the newest version, I could take a look on it and see if it's a big deal to port it.
Regards
P.S.: I am from Frankfurt, Germany. I am running an own software company here, messing around with 70% automotive and 30% embedded projects.
You wrote: "Take care as it was the version 5.xx or something, but I think there's not going to be a big difference to the actual version of it."
Where can I download the actual version ?
ps. I am from Poznan (Poland)
Hi gpls,
You can also check out https://github.com/yuriykulikov/FreeRTOS-on-XMEGA . Last time I checked it was working fine :-) It is only a port and last time I checked it was working frin on FreeRTOS 7.0.x. For examples you can take a look at my other projects, but they are in C++.
@gpls: So If you need the actual version you can download the official distribution from FreeRTOS and add Yuriys Files to it to make it run on the atxmega128A1. Seems to me to be the most sensful way.
ok thank you, I'll try to use these files
&Roman, I use your port, its very ok. I have question. I would like to write interrupt from timer. I do not know too well FreeRTOS, do you have an example of what the set up and what is the timer interrupt service from TCC0?