AVR tick-less (freerunning) for RT

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

Moderators: utzig, tfAteba

rfrankla
Posts: 5
Joined: Sun Jul 05, 2015 6:18 pm

Re: AVR tick-less (freerunning) for RT

Postby rfrankla » Wed Jul 22, 2015 8:18 am

Hi, yes I read the post you referenced.

The way I read the gcc manual we are not going to get 32 bit function pointers, because that would waste space for all mcu's only needing 16 bit pointers -- and that is the majority of AVR mcu's. Everything should work OK if EIND is default zero and the compiler emits code generating and linking the trampolines into the default lower segment of memory, and -mrelax is used to bring it all together cleanly.

There may be reasons for building your own trampoline area and setting EIND (using AVR assembler code) and jumping to a non-symbolic (not compiler generated symbol) location. But this is an advanced need and will need advanced support like linker scripts, something beyond just a large C/C++ program.

Like I said, that's what I understand from the gcc manual.

Rick.

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

Re: AVR tick-less (freerunning) for RT

Postby utzig » Sun Jul 26, 2015 3:23 pm

I just applied the changes. I also made the RT demo free running because the performance seems to be slightly better:

https://gist.github.com/utzig/263173f80c03eb187d01
https://gist.github.com/utzig/b2552e40ac3e4cb96052

While I have an old Mega 1280 the -mrelax option causes no issues for me so I put it there too. I'm considering changing the MCU of the demos to 2560 because more people seem to have it.

Cheers,
Fabio Utzig


Return to “AVR Support”

Who is online

Users browsing this forum: No registered users and 1 guest