uCos II example code for ATxmega128A1

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone,

I would like to use the Micrium RTOS uC/OS-II on an ATxmega128A1 device. I've downloaded the official port from the Micrium website, but the example there is very complex and only for the STK-600 development board from Atmel.

So does anyone have a minimal example of code to get uC/OS-II to work on an ATxmega128A1 (e.g. the basic init of the OS and two empty tasks)?

I would like to use uC/OS-II as RTOS because I got in touch with the uC/OS-II version for PC some years ago during my studies. But now I'm a little bit overwhelmed with the given, really complex example.

Thank you very much!

Regards,
saint elmo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yep I do...
Which uc/OS-II version do you prefer? 2.86 or 2.91?
Are you using the Xplain or Xplained boards by any chance?

Nick

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Nick,

thank you for your response. I have no preference for a version, so which one would you recommend?

No, I can't use/don't have xplain/xplained boards because the xmega µC is fixed on a self made board with some sensors and actuators.

Regards,
saint elmo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You compiling with the IAR compiler? (codevision and imagecraft have xmega compilers... the imagecraft compiler uses a two stack model, and I think IAR does also, so looking at the os_cpu_c.c and os_cpu_i.h files from an iccv7avr port might help.)

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

saint_elmo wrote:
Hello Nick,

thank you for your response. I have no preference for a version, so which one would you recommend?

No, I can't use/don't have xplain/xplained boards because the xmega µC is fixed on a self made board with some sensors and actuators.

Regards,
saint elmo

Probably 2.91 seeing as it is the latest version and includes a few more features and bux fixes.

And as Bob asked: What compiler are you using?

Unfortunately, the ports I have made are AVR Studio 4 projects (avrgcc)...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If someone can share the minimal project, I would appreciate that.

I love Digital
and you who involved in it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://www.nickdademo.com/avr-xm...

Enjoy :)

Note: At this stage only the v2.86 port for the Xplain has been posted... More downloads and documentation coming soon - The source code is heavily commented so modifying should be pretty straightforward.

Let me know of any issues.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yippee! I just got 2.86 ticking on my mega32 bd running at 16mhz and 38400 bps. The iccv7avr ports I had were using const instead of __flash. Big Breakthru! So I'm not a ucos guru,but I sure did port it to an avr mega32! I have an xplain here in my boxes somewhere. Guess I'd better get going on it.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobgardner wrote:
Yippee! I just got 2.86 ticking on my mega32 bd running at 16mhz and 38400 bps. The iccv7avr ports I had were using const instead of __flash. Big Breakthru! So I'm not a ucos guru,but I sure did port it to an avr mega32! I have an xplain here in my boxes somewhere. Guess I'd better get going on it.

Good work! uC/OS-II real does simplify the coding of larger projects ;)

If you do try my port, let me know how it goes!

Cheers

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

UPDATE:

All versions are now up (v2.86 and v2.91 for both the Xplain and Xplained) and can be downloaded again from here: http://www.nickdademo.com/avr-xm...

I haven't had any feedback at all on these ports so far, so I'd appreciate any comments :)

Nick

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, Nick, here's some feedback. :-)

Woohoo! This is great stuff. I downloaded the hex file to my Xplained board, hooked up a serial cable to header J1, and powered it up. Worked first time. I'm showing 2% CPU usage running at 32 MHz with eight LEDs blinking.

I have only spent about ten minutes on this, have only glanced through one source file. This looks great!

I need some time to go through the source in detail, and to try compiling it in AVRStudio4. Good thing the Seattle rains are coming back...

I have wanted to get started with uCOS for a long time but always lacked time, a port, and a suitable board. Now I have all three!

Thanks again,

klaxon44

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Follow-on...Just noticed I didn't mention, I downloaded and installed 2.91 for Xplained.

klaxon44

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
OK, Nick, here's some feedback. :-)

Woohoo! This is great stuff. I downloaded the hex file to my Xplained board, hooked up a serial cable to header J1, and powered it up. Worked first time. I'm showing 2% CPU usage running at 32 MHz with eight LEDs blinking.

I have only spent about ten minutes on this, have only glanced through one source file. This looks great!

I need some time to go through the source in detail, and to try compiling it in AVRStudio4. Good thing the Seattle rains are coming back...

I have wanted to get started with uCOS for a long time but always lacked time, a port, and a suitable board. Now I have all three!

Thanks again,

klaxon44

Thanks! I'm glad it's all working without any issues! :)

The only modifications you really need to make are to the main C source file (xmega_ucos-ii.c) and if needed, to the configuration files (os_cfg.h and app_cfg.h). So basically, you can just start creating tasks in xmega_ucos-ii.c to suit your needs - using the existing code as a starting point is probably the easiest way.

Compiling should be a breeze too - no modifications should be needed (if you encounter build errors, just make sure the directories are all set correctly in the AVR Studio project settings).

Let me know if you have any questions. ;)

Nick

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nick,

I took your 2.91 source files, without modification, dropped them into an AVRStudio4 (4.18) project, built the project, loaded it into my Xplained board, and the code runs just fine.

Thanks for sharing your work. I'm looking forward to some great learning time on uCOS-II.

klaxon44

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

klaxon44 wrote:
Nick,

I took your 2.91 source files, without modification, dropped them into an AVRStudio4 (4.18) project, built the project, loaded it into my Xplained board, and the code runs just fine.

Thanks for sharing your work. I'm looking forward to some great learning time on uCOS-II.

klaxon44

Good to hear! Good luck with it all :)
If you have any suggestions/other questions - let me know!

Nick

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am sorry to bother, but did anyone use uCOS-II port for AVR32UC3B0 (board EVK1101)?

I would like to see a working example for this micro controller, so please post it if you have it.