1

I am trying to set up a custom board under the Arduino IDE, but I can not figure out why I am getting the warning...

Warning: Board Move38:avr:build doesn't define a 'build.board' preference. Auto-set to: AVR_BUILD

I think am following the recommendations and template in the official spec here... https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification#boardstxt

My "vendor/maintainer" is move38 and my platform is avr, so the path to the boards.txt is...

Arduino\hardware\Move38\avr\boards.txt

Here is my boards.txt that defines the blink board...

blink.name=Blinks Tile
blink.upload.tool=avrdude
blink.upload.protocol=avrisp
blink.upload.maximum_size=15872
blink.upload.maximum_data_size=1024

blink.build.core=blinks
blink.build.board=AVR_Blink

blink.build.mcu=atmega168pb

blink.c.extra_flags=-Wextra -flto
blink.c.elf.extra_flags=-w -flto
blink.cpp.extra_flags=-Wextra -flto
blink.ltoarcmd=avr-gcc-ar

# set F_CPU to 1Mhz for all boards on this platform
build.f_cpu=1000000L

...which would seem to define build.board as AVR_BLINKS.

I think am following the recommendations and template in the official spec here... https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification#boardstxt

...but nonetheless the warning persists.

I am using Arduino IDE version 1.8.3 on Windows.

What am I missing here? Is there something special about the value, format, or position of the build.board key that I am missing here?

Thanks!

More notes

Adding the following lines to a working boards.txt file...

build.name=testname
build.f_cpu=4000000L
build.core=blinks
build.board=AVR_BOARD

Will create a menu entry for a new phantom board called testname, but this is not a real board with usable keys. If you compile while that board is selected, you get the warning...

Using board 'build' from platform in folder: C:\Users\passp\Documents\Arduino\hardware\Move38\avr
Using core 'arduino' from platform in folder: C:\Users\passp\Documents\Arduino\hardware\Move38\avr
Warning: Board Move38:avr:build doesn't define a 'build.board' preference. Auto-set to: AVR_BUILD

...despite the fact that the key build.board is explicitly defined.

  • Do you have a board called Move38 in there too? – Majenko Aug 22 '17 at 20:09
  • Which version of the Arduino IDE are you using? Is that your full boards.txt? I can't reproduce the issue with Arduino IDE 1.8.4. – per1234 Aug 22 '17 at 21:41
  • @Majenko There is no board named Move38. There is only one board in the boards.txt and is is the blink board. The Move38 is the "vendor/maintainer" as per the spec and so is the name of the parent directory- the boards.txt path is Arduino\hardware\Move38\avr\boards.txt. Thanks! – bigjosh Aug 23 '17 at 1:38
  • @per1234 I've posed a full boards.txt above, and also the (hard earned!) answer. Thanks for offering to help! – bigjosh Aug 23 '17 at 4:26
1

It appears that you can no longer set a global property in the boards.txt file. You must set every property individually inside each board ID, even if they are the same for every board in the file. This seems to contradict the documentation that states that...

The other properties will override the corresponding global properties of the IDE when the user selects the board.

Further, if any global key is set directly, then both the board specific keys and the global keys are ignored.

So in my above boards.txt, setting the the global key build.f_cpu at the end of the file seems to cover the blink.build.board key and prevent it from being copied to build.board when the board is selected. Even if you set the global key build.board directly, this setting is ignored.

0

The line in your boards.txt:

build.f_cpu=1000000L

created a separate board entry with the board ID build, thus the error message:

Warning: Board Move38:avr:build doesn't define a 'build.board' preference. Auto-set to: AVR_BUILD

From your comment:

# set F_CPU to 1Mhz for all boards on this platform

and your answer I see that you expected that line to define a global value for the build.f_cpu property but the Arduino IDE has no mechanism for doing this in boards.txt and I don't believe it ever has. You need to define the properties for each board individually in boards.txt, where they will override previously defined properties of the same name. However, you can define default property values for the hardware package in your platform.txt just as you attempted to do in boards.txt.

  • With the "build.f_cpu" key defined, I do not see a new board named "build" under the boards menu, and all the keys defined for the "blinks" board (which is properly selected from the boards menu) disappear when the "build.f_cpu" key is defined so even if there was a phantom "build" board now defined, why should it suppress some of the selected board's keys? Thanks! – bigjosh Aug 23 '17 at 5:52
  • Also, when I read the line "A configuration file is a list of "key=value" properties" in the spec, I expect that I can set any key to any value in any config file. This does not seem to be true - setting global keys in boards.txt does not actually set the global key. The section on boards.txt says that keys can be set on individual boards, not that they can not be set globally. I think either a bug or a documentation issue or both. – bigjosh 1 min ago – bigjosh Aug 23 '17 at 5:53
  • "I do not see a new board named "build" under the boards menu". That's because the board is missing a required property. Try adding the line: build.name=bigjosh. – per1234 Aug 23 '17 at 13:08
  • "why should it suppress some of the selected board's keys". What do you mean by keys? – per1234 Aug 23 '17 at 13:08
  • Adding a name does create a phantom entry in the menu, but does not actually create a board with keys. See new added notes above.Thanks! – bigjosh Aug 23 '17 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.