Author Topic: Adding new devices to Atmel AVR project wizard processor list  (Read 12061 times)

Offline dexter

  • Single posting newcomer
  • *
  • Posts: 2
Hi everybody!

C::B 17.02 is missing some of the newer AVR microcontrollers from its AVR project wizard processor list.

E.g. it lists atmega324a, atmega324p and atmega324pa but no atmega324pb (I am sure that might be
the case with some other microcontroller families too).

So I wonder if there is a way to add new devices to that list or a way around it?

Please advise.

Thank you.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Adding new devices to Atmel AVR project wizard processor list
« Reply #1 on: March 23, 2019, 04:43:37 pm »
The wizard is written in a scripting language (squirrel), you can do right click -> edit script in the wizard and do the modifications you need to do.

If you think these changes are valuable to other people or you don't want to maintain them locally you can post a patch, so the changes could be integrated in the next version of C::B
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline dexter

  • Single posting newcomer
  • *
  • Posts: 2
Re: Adding new devices to Atmel AVR project wizard processor list
« Reply #2 on: March 24, 2019, 10:02:34 pm »
Thank you oBFusCATed, you pointed me in the right direction, however, it did not quite work.

I was able to edit the script as suggested but after doing that the micro in question still did
not appear in the AVR project drop-down list of processors. I had also to manually edit the
script.xrc file. After that the desired micro was finally shown in the list. For those who might
want to repeat this exercise: go to your CodeBlocks installation folder\share\CodeBlocks\
templates\wizard\avr and add your required microntroller to the list inside wizard.script AND

This is only half of the problem. Now you can create a project for your microntroller but when
you go ahead and compile you will get all sorts of the errors. All of them, basically, boil down
to the fact that the compiler, as well the linker, know nothing about this new device.

I don't know if there is a way to automatically update your existing avr8-gnu-toolchain from
Atmel ATmega Series Device Support (1.3.300) - - so I did
a few more manual hacks. First, I added packs\atmel\ATmega_DFP\1.3.300\include to the
Compiler Search Directories in GNU GCC Compiler for AVR Global compiler settings, then
copied specs-atmega324pb from the pack to avr8-gnu-toolchain\lib\gcc\avr\5.4.0\device-specs,
and crtatmega324pb.o and libatmega324pb.a from the pack to \avr8-gnu-toolchain\avr\lib\avr5.

Now I can build the project. Not the most elegant way to do things but, hey, it worked for me.
If anybody knows a better way to do this please share.