Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to bring Platform IO build in line with Arduino build #108

Conversation

jeremypoulter
Copy link
Contributor

@jeremypoulter jeremypoulter commented Sep 6, 2019

These changes fix the 'Arduino' version when building with Platform IO to make sure both Platform IO and Arduino can be used to generate certified builds.

As part of this I have added Travis CI config that builds with various AVR cors both with Platform IO and Arduino.

I did try to find a Platform IO version that matches 1.6.15 but the there is a jump from 1.6.14 to 1.6.17. Note the compiler version between those is the same and also the only real change between those packages is the boards.txt so should be equivalent to 1.6.15.

See https://travis-ci.org/jeremypoulter/open_evse/builds/582162466 for some example builds with Travis CI. I added a little script that outputs a few key details:

Arduino CLI, AVR core 1.6.15:

Arduino AVR Version: 1.6.15
GCC Version: avr-gcc (GCC) 4.9.2
Binary Size: 91261
   text	   data	    bss	    dec	    hex	filename
  31710	    732	    840	  33282	   8202	firmware/open_evse/open_evse.arduino.avr.openevse.elf

Platform IO, AVR core 1.6.14

Arduino AVR Version: 1.6.14
GCC Version: avr-gcc (GCC) 4.9.2
Binary Size: 91261
   text	   data	    bss	    dec	    hex	filename
  31710	    732	    840	  33282	   8202	.pio/build/openevse_1-6-14/firmware.elf

Arduino CLI, AVR core 1.6.23

Arduino AVR Version: 1.6.23
GCC Version: avr-gcc (GCC) 5.4.0
Binary Size: 90423
   text	   data	    bss	    dec	    hex	filename
  31398	    742	    828	  32968	   80c8	firmware/open_evse/open_evse.arduino.avr.openevse.elf

Platform IO, AVR core 1.6.23

Arduino AVR Version: 1.6.23
GCC Version: avr-gcc (AVR_8_bit_GNU_Toolchain_3.6.2_1759) 5.4.0
Binary Size: 90423
   text	   data	    bss	    dec	    hex	filename
  31398	    742	    828	  32968	   80c8	.pio/build/openevse_1-6-23/firmware.elf

I think with the platform version fixed in Platform IO, at least on the surface the binaries look identical to the ones produced by equivalent AVR core versions with Arduino IDE/CLI.

@jeremypoulter jeremypoulter changed the title Changes to fix the 'Arduino` version WIP: Changes to fix the 'Arduino` version Sep 6, 2019
@jeremypoulter
Copy link
Contributor Author

jeremypoulter commented Sep 6, 2019

FYI I think this is the diff between Arduino AVR Core 1.6.14 and 1.6.17
arduino/ArduinoCore-avr@9ef763b...5a05bf0#diff-293796aa8902943c0f1a5ff91a5ea0aa

Unfortunately Arduino have not tagged the repo but I think these are the commit hashes of the different releases based on the version number in platform.txt changing:

  • 1.6.14 - 9ef763b137012ad333eced410f34acd4df732d9c
  • 1.6.15 - fa3f7e41a97c82d61cbd2162062551c85f006409
  • 1.6.16 - af7655dfccfbd9001997ca6400d365f5493fc96c
  • 1.6.17 - 5a05bf01f4ffbe16670eb8d713688d059c3bd084

There are a few compile options that change but Platform IO will not use those anyway so I need to see what the compile options are when building on 1.6.15.

@jeremypoulter jeremypoulter changed the title WIP: Changes to fix the 'Arduino` version Changes to bring Platform IO build in line with Arduino build Sep 7, 2019
@lincomatic
Copy link
Owner

Hi, sorry, I've been traveling a lot, so super busy w/ other work. If you want me to merge this, do you mind squashing it first?

@jeremypoulter
Copy link
Contributor Author

Easiest way is to do that on merge, https://help.github.com/en/articles/about-pull-request-merges#squash-and-merge-your-pull-request-commits, but if you need this done before hand A will create a new PR with a squashed commit.

@lincomatic
Copy link
Owner

Hi, sorry for the huge delay on this. How do I see how the merge changes the files w/o actually merging the pull request? is there a way to merge this pull request into a new branch cloned from development? or could you just tell me which files it adds? I don't want to include the empty lib/ subdir you have in your branch, for instance.. it's superfluous and confusing to me

@jeremypoulter
Copy link
Contributor Author

If you use VS Code there is a nice extension for this. To do it with normal Git I think you can do:

git fetch origin pull/108/head:pr_108
git checkout pr_108

See: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally

Re the lib directory, that is already on the development branch already. Is something that Platform UI creates automatically, but can be removed and added to the .gitignore file

@lincomatic
Copy link
Owner

Looks different to me, but I pushed your changes anyway

Your platformio.ini:
DATA: [======== ] 76.7% (used 1570 bytes from 2048 bytes)
PROGRAM: [==========] 98.5% (used 32282 bytes from 32768 bytes)

Arduino AVR 1.6.15
Sketch uses 32596 bytes (106%) of program storage space. Maximum is 30720 bytes.
Global variables use 1572 bytes (76%) of dynamic memory, leaving 476 bytes for local variables. Maximum is 2048 bytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants