adafruit / arduino-board-index

Adafruit Package Lists for the Arduino v1.6.4+ Board Manager
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
39 stars 29 forks source link

please add toolsDependencies for bossac@1.7.0 in the adafruit:samd boards for all the feather M0 boards #22

Closed ScottiSws closed 5 years ago

ScottiSws commented 5 years ago

You specify the following in platform.txt tools.bossac.path={runtime.tools.bossac-1.7.0.path}

Then in boards.txt you specify it as the upload tool for the M0 Express. adafruit_feather_m0_express.upload.tool=bossac

But since you don't have it as a toolsDependencies in your package_adafruit_index.json for adafruit:samd@1.2.9, you will get a "can't find {runtime.tools.bossac-1.7.0.path}/bossac" error during an upload.

The IDE seems to find bossac randomly. Maybe something gets cached at some point. You can definitely see this issue if you use the new alpha arduino-cli tool. I think it gets cached from the arduino:samd package but I'm not sure. When it happens I usually need to delete .arduino15 and reload.

If I put your index url into arduino-cli via .cli-config.yml (this file must live next to exe and not in $HOME), then manually add the toolsDependencies to adafruit:samd@1.2.9 I can install everything, compile, and upload all from command line.

https://github.com/arduino/arduino-cli

ladyada commented 5 years ago

we cant reproduce this (maybe because we're not using the CLI?) could you add the line in question as a PR so it works for you, then we'll test it still works for us and merge :)

ScottiSws commented 5 years ago

I'll be sending you a PR in a bit and found a way to replicate the issue in Arduino IDE 1.8.8.

I fixed the issue in bpt.ini for when you update adafruit-samd to its next version and hacked up the package_adafruit_index.json to add a fake 1.2.10 version for replicating the issue.

  1. Start clean on Ubuntu 18.04 ( Version probably doesn't matter ) Delete .arduino15 and the Sketch direction ( clean out libraries, etc ). Essentally start like a brand new install of the IDE.

  2. Start the bpt.py test-server on my altered index and follow instructions for using it with the IDE.

  3. Choose Adafruit SAMD v1.2.9 only.

  4. Get the Blink Sketch, choose Adafruit Feather M0 Express board and proper port.

  5. when you build and upload you should get this error. java.io.IOException: Cannot run program "{runtime.tools.bossac-1.7.0.path}/bossac": error=2, No such file or directory

  6. Update the Adafruit SAMD to v1.2.10 ( the fake version with the bossac 1.7.0 dependency )

  7. when you rebuild the Blink sketch it should upload and work properly now.

ladyada commented 5 years ago

kk!

ScottiSws commented 5 years ago

Here you go. PR https://github.com/adafruit/arduino-board-index/pull/23

I tried to use bpt to update but I can't really force adafruit-samd to a new version and the --force option seemed to make a second 1.2.9 which didn't seem right. That's why I faked the index file.

per1234 commented 5 years ago

we cant reproduce this

I can reproduce it in the Arduino IDE as well. Arduino SAMD Boards 1.6.7 through 1.6.21 used bossac 1.7.0 so the boards of Adafruit SAMD Boards with upload.tool=bossac happen by chance to work fine with any of those Arduino SAMD Boards versions installed. But Arduino switched to a new version in Arduino SAMD boards 1.6.22 and newer so if you have a modern version of Arduino SAMD Boards installed you can't upload to any of the Adafruit SAMD Boards with upload.tool=bossac.

ladyada commented 5 years ago

@per1234 should we change to upload.tool=bossac-1.7.0? then?

per1234 commented 5 years ago

No. The name of the tool is bossac so that's correct: https://github.com/adafruit/ArduinoCore-samd/blob/master/platform.txt#L120-L130 The problem is the bossac tool specifies bossac version 1.7.0 specifically: https://github.com/adafruit/ArduinoCore-samd/blob/master/platform.txt#L120

tools.bossac.path={runtime.tools.bossac-1.7.0.path}

but your Boards Manager JSON file doesn't have bossac 1.7.0 as one of the toolsDependencies items for Adafruit SAMD Boards so there is no guarantee that bossac 1.7.0 will be installed. It may just happen to be if the user has an outdated version of Arduino SAMD Boards installed, but most people are likely using the latest version of Arduino SAMD Boards.

The solution is https://github.com/adafruit/arduino-board-index/pull/23, which adds the missing toolsDependencies item for bossac 1.7.0.

ScottiSws commented 5 years ago

It's been a few months but I authored the pull request #23. You'll need to use my instructions from Feb 5th exactly. Don't automatically install the Arduino SAMD package thinking you need it. You don't! Your Adafruit SAMD package will work by itself if you fix the bossac-1.7.0 dependency.

ladyada commented 5 years ago

oh duh - missed that. ok i 'redid' the PR, thank you and sorry it didnt get merged then. we have another bug to fix so will be picked up very soon in 1.5.1 :)

ladyada commented 5 years ago

ok 1.5.1 is release, lemme know if that doesnt fix it!

ladyada commented 5 years ago

closin' for now - reopen if still a problem!

szymonpk commented 5 years ago

@Scotti6666 even with your PR it doesn't work for me. Any idea why?

ScottiSws commented 5 years ago

@szymonpk, there isn't enough information in your post to make any determination. That said, you might try reinstalling and only selecting the "Adafruit SAMD" and nothing else.