Background:
I have intermediate experience in programming AVR devices using Atmel Studio and used AVRISPmkII and STK500 exclusively to program devices. I always used “native” approach and have not touched Arduino as a framework, have not worked with command line, and have no experience working with other micros. I work with custom boards most of the time, defining port and bit definitions depending on the project. In short, i am very sheltered under the Atmel/Microchip umbrella.
I am at a lost on how to start using platformio, because most examples i find in the community and documentation on AVR revolves around Arduino.
Here are my questions:
Question 1: How to define boards that will NOT use any framework?
I have read Custom Embedded Boards — PlatformIO latest documentation and checked other json board files in ~/.platformio/platforms/atmelavr/boards, and i still cannot fully understand what goes into “build”, “framework”, “connectivity”, and “upload” sections.
As i review the “build” sections of some json files, i notice differing data. I tried to reference GNU Make AVR Options (here: AVR Options (Using the GNU Compiler Collection (GCC))) but cannot establish base line.
What goes into:
1.“core”
2."extra_flags”
3.“variants”?
4."hwids”
5.“usb_product”.
I have read somewhere that in order to go native, i should just omit the “framework” section altogether. Is this correct?
For the “connectivity” section, (saw this in ‘Ethernet’ board), I don’t really know what this is or where it came form.
For the “upload” section, i am also reading mostly Arduino specific examples (in ~/platformio/packages/framework-arduinoavr/programmers.txt). I am using AVRISPmkII.
What goes into:
1.”protocol”
2.”required_upload_port”
3.”speed”
Any other parameters needed?
This is my current board.json (mostly copied from: megaatmega2560)
{
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_AVR_MEGA2560",
"f_cpu": "12000000L",
"mcu": "atmega2560",
"variant": "mega"
},
"fuses": {
"efuse": "0xff",
"hfuse": "0xdf",
"lfuse": "0xff"
},
"name": "Custom m2560 Board 1",
"upload": {
"maximum_ram_size": 8192,
"maximum_size": 253952,
"protocol": "stk500v2",
"require_upload_port": true,
"speed": 115200
}
}
Question 2: What goes into platformio.ini and what goes into board.json? It seems like most of the things are identical between the two?
Thank you for your patience with an utter noob on this. Cheers.
Edit: board.json description