AVR Architecture changes? Topic is solved

ChibiOS public support forum for topics related to the Atmel AVR family of micro-controllers.

Moderators: utzig, tfAteba

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

AVR Architecture changes?  Topic is solved

Postby tfAteba » Fri Jun 23, 2017 9:34 am

Hi Giovanni, Utzig,

I'm working on porting ChibiOS on many AVR architecture. My goal is to learn and have better understanding of how RTOS work.

Bellow is starting point for the tinyAVR architecture for example:
https://github.com/tfateba/chibios-on-attiny85

While starting, I think about have another structure under os/hal/port/AVR/:
Instead of having all low devices drivers files there, I would like to add additional directories represanting the supported architecture sush as "tinyAVR, megaAVR, xmegaAVR and so on."

What about that idea? Can I make this kind of structure or is there some disadvantage?

Thanks.
regards,

Theo.

User avatar
Giovanni
Site Admin
Posts: 14443
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: AVR Architecture changes?

Postby Giovanni » Fri Jun 23, 2017 10:21 am

Hi,

Up to you and Fabio, are you going to duplicate drivers for the various architectures?

Giovanni

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: AVR Architecture changes?

Postby tfAteba » Fri Jun 23, 2017 10:58 am

are you going to duplicate drivers for the various architectures?

To make it simple for the begining, yes I'm going to dupicate the drivers.

But after having several architectures implemented, I will try to make some common drivers like in the LDD folder on the STM side.

Is there a problem if I duplicate the code and let it duplicated ?
regards,

Theo.

User avatar
Giovanni
Site Admin
Posts: 14443
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: AVR Architecture changes?

Postby Giovanni » Fri Jun 23, 2017 11:04 am

Duplicating is generally a bad idea, I do my best to avoid that.

Giovanni

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: AVR Architecture changes?

Postby tfAteba » Fri Jun 23, 2017 11:18 am

I understand, so I will then keep the same concept.
In that case, I will see if it is still pertinent to change the actual architecture so that the specific part goes under the new folders.
regards,

Theo.

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: AVR Architecture changes?

Postby tfAteba » Fri Jun 23, 2017 1:32 pm

Thank you for your feedback :) Giovanni
regards,

Theo.

utzig
Posts: 359
Joined: Sat Jan 07, 2012 6:22 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 20 times
Contact:

Re: AVR Architecture changes?

Postby utzig » Tue Jun 27, 2017 12:18 pm

Hi,

AFAK the core should be very similar, requiring just some #ifdef's, but the HAL is different enough to require new drivers for most peripherals. I would suggest eventually using a directory structure like:

Code: Select all

os/hal/ports/AVR/MEGA/<current drivers moved here>
os/hal/ports/AVR/XMEGA/<new drivers for ATXmega>
os/hal/ports/AVR/TINY/<new drivers for ATtiny>


I don't see much value in running an OS in a Tiny MCU to be honest. They have very little resources, their peripherals are really simple to program, so not really sure why someone would use an OS there (apart from learning reasons). I have one XMega board somewhere but never really used it for anything. Maybe I could help with a bring up of PAL/SERIAL and have one basic blinking/test demo running (but free time is not great right now!).

Cheers,
Fabio Utzig

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: AVR Architecture changes?

Postby tfAteba » Tue Jun 27, 2017 10:41 pm

Hi,

Utzig, what you propose was my first idea, but after Giovanni remarks, I decide to not modify the current structure to avoid code duplication.

If we are agree, I will then make the actual port look like you said:

Code: Select all

os/hal/ports/AVR/MEGA/<current drivers moved here>
os/hal/ports/AVR/XMEGA/<new drivers for ATXmega>
os/hal/ports/AVR/TINY/<new drivers for ATtiny>os/hal/ports/AVR/MEGA/<current drivers moved here>
os/hal/ports/AVR/XMEGA/<new drivers for ATXmega>
os/hal/ports/AVR/TINY/<new drivers for ATtiny>


Utzig wrote
I don't see much value in running an OS in a Tiny MCU to be honest. They have very little resources, their peripherals are really simple to program, so not really sure why someone would use an OS there (apart from learning reasons).


You are rigth, I started to port ChibiOS RT and NIL on the ATTINY just for learning reason, and I tougth it would be interesting to share with other people.

I have also plan to work on XMEGA port, just after finishing the the ATTINY, so do not worry if you don't have the time to work on. I already have the hardware too :)
regards,

Theo.

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: AVR Architecture changes?

Postby tfAteba » Wed Aug 02, 2017 9:00 pm

Hi Giovanni, Utzig, All,

I just want to signal that the AVR part of the project sow is architecture change last few weeks, sorry for the notification delay.

I have apply changes as suggest by Utzig in os/hal/port/AVR/ to add MEGA, TINY directories to be able to easily add support for Tiny AVR micro-controllers.

XMEGA will come soon :D .

Thanks.
regards,

Theo.

utzig
Posts: 359
Joined: Sat Jan 07, 2012 6:22 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 20 times
Contact:

Re: AVR Architecture changes?

Postby utzig » Wed Aug 02, 2017 9:31 pm

Very nice! Once you have serial+pal working just push them, then I'll try taking some time to test on my board and maybe writing a spi or i2c or usb driver.


Return to “AVR Support”

Who is online

Users browsing this forum: No registered users and 2 guests