[SOLVED] avr-gcc interrupt vector size in AT90PWM316

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

Hi,

In my current project I ran out of space in a AT90PWM3B, so it was "easy" to replace with a AT90PWM316.

There are at least 2 problems:

1. avr-gcc allocates only 2 bytes per interrupt vector instead of 4 bytes, which is the needed size.

2. It seems the eeprom functions are handled on specific part named source files. The functions for the pwm316 are undefined.

Re 1. How do I set the compiler to allocate 4 byte interrupt vectors for the pwm316 ? I have seen _VECTOR_SIZE in the include file for a mega328, but that does not do the trick.

Re 2. I can define local functions in my project as a workaround, but it would be nice to have the EEPROM functions for the pwm316 included in the system like the rest.

---

I have used the newest direct buildsript from bingo ( big thanks )
I compiled it on Trisquel with no problems.

Used versions:
avr-gcc-4.9.1 w. avrlibc-1.8.1 , dude-6.1, gdb-7.8 & binutils 2.24

EKH

Last Edited: Sun. Aug 17, 2014 - 10:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When invoking avr-gcc, did you specify the correct -mmcu option?

Iluvatar is the better part of Valar.

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

skeeve wrote:
When invoking avr-gcc, did you specify the correct -mmcu option?

Yes.

EKH

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

My suspicion is that the bingo build did not go as well as believed.
The -mmcu flag is the only thing that is supposed to affect the size of an interrupt vector entry.
The bug could be in either the compiler or the linker.
Either the compiler got the size wrong or the linker made "improvements".

How recent is AT90PWM316?

Iluvatar is the better part of Valar.

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

Thank you for offering your help.

Over the phone I tested with bingo. The problem is that codeblocks does not know the pwm316 so i added -mmcu=at90pwm316 to the compiler c flags. But I did not add the same to the linker flags which remembered the previous at90pwm3b.

So you were right that the linker could be the problem.

After I added the linker flags my problems disappeared. So bingo was not the source of the problem :D

EKH