Support of ATmega324PB in avr-gcc

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

 

 Any news or ideas on the topic? Just bought 324PB Xplained Pro and all of a sudden found out that I can't even compile for it.

 Toolchain I have is 3.5.3, no mention of 324PB in headers and device specs. Release notes for the latest gcc toolchain (3.5.4) at

 

http://ww1.microchip.com/downloa...

 

 list only 324A, P and PA

 Is it the same with the Studio? I can't use it, just curious.

 

 Thanks

 

 PS

 Not sure if this belongs here or in Compilers. Please, feel free to move.

 

 

This topic has a solution.
Last Edited: Thu. Dec 28, 2017 - 06:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yabusame wrote:
all of a sudden found out that I can't even compile for it

Please explain that.

 

You mean you have previously been able to "compile for it", but now can't?

 

What, exactly, are you doing?

What, exactly, is happening?

Any error messages?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 Sorry for not being perfectly clear. This is my first 324PB so I haven't been able to compile for it before.

 

 Here is what happened:

 

avr-gcc -Wall -pedantic -O3 -pipe -mmcu=atmega324pb -DBLI_APP_VERSION=\"0.2\" -I. bli.c -c -o bli.o
avr-gcc: error: cannot access device-specs for 'atmega324pb'

 

 

 

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

Well,  AS7 knows all about the ATmega324PB.

 

However there are a few changes in the header files compared to the ATmega324PA.

e.g. bit names in multiple peripherals like USART0, USART1 are now called RXC instead of RXC0, RXC1

and single peripheral SFR names like TWCR are now called TWCR0, TWCR1 because there are two TWI channels in the 324PB.

 

You will need to do a certain amount of conditional editing.   e.g. #if ..324PB.. #define TWCR TWCR0

 

There have been similar name conflicts in the past.  e.g. with RXC RXC0

The new system is more logical.  i.e. single bit name because RXC0, RXC1 are both in the same position in UCSR0A and UCSR1A

 

David.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yabusame wrote:
avr-gcc: error: cannot access device-specs for 'atmega324pb'
http://packs.download.atmel.com/#collapse-Atmel-ATmega-DFP-pdsc

via

http://distribute.atmel.no/tools/opensource/Atmel-AVR-GNU-Toolchain/3.6.1/avr8-gnu-toolchain-readme.pdf

(page 8)

4. Supported Devices

 

P.S.

0-series megaAVR?

Some new megaAVR in the works.

 

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. Dec 27, 2017 - 03:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 gchapman,

 

 Thanks, atpack worked. Do you know if avrdude part definition of 324pb can be derived from 324p by simply changing signature to 0x1e 0x95 0x17?

 

 

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

You're welcome.

Yabusame wrote:
Do you know if avrdude part definition of 324pb can be ...
Don't know (won't have mega324PB until Jan '18)

 

"Dare to be naïve." - Buckminster Fuller

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

Yabusame wrote:
... 324pb can be derived from 324p by simply changing signature to 0x1e 0x95 0x17?
An assumption is like the change for mega328PB.

http://svn.savannah.gnu.org/viewvc/avrdude/trunk/avrdude/avrdude.conf.in?r1=1391&r2=1397

 

"Dare to be naïve." - Buckminster Fuller

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

gchapman wrote:

Yabusame wrote:
... 324pb can be derived from 324p by simply changing signature to 0x1e 0x95 0x17?
An assumption is like the change for mega328PB.

http://svn.savannah.gnu.org/viewvc/avrdude/trunk/avrdude/avrdude.conf.in?r1=1391&r2=1397

 

 

 That's what I did. I can flash the chip and change fuses.

 However, Atmel's migration guide 324->324PB says `ATmega324PB is not a drop-in replacement for ATmega324 variants, but a new device.' So 324PB may require more profound changes. We'll see.

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

 It works.