I have defined/added a new board to PlatformIO but I can’t find any documentation whatsoever for the json board definition file, and specifically for the fields cited farther below.
It seems that different boards are defined in a fairly ad-hoc manner as if anything goes. Are there are some guidelines for how a well-formed board definition should look?
Also, once I have this working then I’d like to upload it to the project. Am I supposed to do a pull request, or do I email it out to the maintainer?
I’m puzzled that I’m not having to include register definitions and many other part-specific details about this board/CPU …or would I do that by creating a completely separate “bare metal” library? What happened to the “naked” framework thing? This seems really really sparse, especially considering that the CPU has specific methods of uploading code and debug features etc.
(1) “extra_flags”: What does this do? Does it actually affect anything or is it just for documentation purposes?
(2) “size_heap”: This is really weird because it would seem to be a compiler option and so why would it be defined here as part of CPU hardware? Wouldn’t it be safer to leave this out?
(3) “variant”: What does this do? It seems to be a documentation category thing rather than having actual effect during build-time.
(4) “f_cpu": "16000000L” Why is there an L at the end of the clock frequency? Some board definitions have an L while others do not.
Here is what I put together for the new Nuvoton N76E003 board:
{
“build”: {
“core”: “naked”,
“extra_flags”: “-DN76E003 -DNAKED_ARCH_MCS51 -DNAKED_MCS51_N76E003”,
“f_cpu”: “16000000L”,
“size_iram”: 256,
“size_xram”: 768,
“size_code”: 18432,
“size_heap”: 128,
“mcu”: “n76e003”,
“cpu”: “mcs51”,
“variant”: “n76e003”
},
“frameworks”: [],
“upload”: {
“maximum_ram_size”: 1024,
“maximum_size”: 18432
},
“name”: “Generic N76E003”,
“url”: “https://www.nuvoton.com/products/microcontrollers/8bit-8051-mcus/low-pin-count-8051-series/n76e003/”,
“vendor”: “Nuvoton”