-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
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
[2.0.x] Enable local board repository for PIO #11079
[2.0.x] Enable local board repository for PIO #11079
Conversation
c020475
to
9a4832f
Compare
-Enable boards_dir option in PIO INI -Remove defunct custom board file operations for PIO auto-build environment -Remove now-defunct Teensy++ 2.0 PIO entry, replaced by `at90USB1286_DFU` and `at90USB1286_DFU` (using this entry always put AT90USB board boot loaders in jeopardy of being overwritten due to the very small size of the official Teensy++ 2.0 bootloader) -whitespace
9a4832f
to
4ffe1c1
Compare
Something appears to have gone wonky with Travis builds and doesn't appear related to this PR:
|
A library updated with a new version that had a few issues, it's fixed now but will take a bit to propagate through platformio, |
Definitely a better solution. It'll be 2-4 weeks before I'm back home & can test this in Ubuntu & macOS. Since it's a PIO option then I think the risk is pretty small. I'll modify my doc changes accordingly. I'm not sure that deleting the Teensy20++ environment is a good idea. I've tried many times to upload CDC & DFU boards using the Teensy environment and the Teensy loader always refused to start the upload. I'm speculating that the concern comes from using the Teensy environment to build an image and then using a non-PIO tool to do the upload. That could blow the CDC/DFU bootloader away if the image is max'd out and the lock bits aren't set right. Now that we can do the DFU/CDC uploads from withing PIO I don't think that should be a concern. Maybe there is a legitmate concern with the new PIO CDC/DFU upload options. The new CDC/DFU options use AVRDUDE. There's no way (that I know of) to check the image size before AVRDUDE is kicked off. If the lock bits are set wrong and the image is too big then it will blow away the bootloader. I don't see an elgant way of fixing this. The best I see right now would be to modify autobuild to do a build first, get the image size from the buffer (or the ELF, or ...) and then kick off the upload if the size is OK. Time to re-read the platformio.ini and AVRDUDE docs to see if there is a usueful option. |
I don't understand the concern to keep the Teensy++ 2.0 environment at all and contend it should not be reverted. There is not a single 3D printer control board that uses an actual Teensy++ 2.0 board (with Paul's "Halfkay" bootloader that consumes 2k PROGMEM) and so the issue for AT90USB users to compile with PIO up to ~130000 bytes and upload to their board always had the possibility to blow away the large CDC, LUA, DFU boot loaders that all consume 8k PROGMEM boundary so only have 122880 bytes available before encroaching on the bootloader. The only thing that can come with keeping the environment now that you have a working custom board definition for AT90USB boards is if we want to keep the ability to generate hex files that can overwrite the bootloader of non-Halfkay boards without warning 😝 . The Teensy uploader utility only works with the Halfkay bootloader resident only on genuine factory Teensy boards, so we always have had to use a separate utility to upload, and the Teensy Uploader helper app that Paul wrote/maintains will never ever ever work with any 3D printer board. |
Regarding DFU boards, one piece of trivia is that the dfu-uploader is far more tailored for flashing DFU-equipped boards, being smart enough to not allow flashing more than the configured [progmem-total] - [size-of-the-bootloader-based-on-what-the-boundary-fuses-say]. But I don't think that's compelling enough to implement it parallel of avrdude since the board definition file (ever since #10943) prevents PIO from creating a hex that is too large. You could probably easily add a script like you suggest that checks the size of the resulting image and simply not proceed with flashing if greater than 122880 bytes, but it seems overly-redundant (as long as the Teensy++ 2.0 entry is put to pasture as it needs to be 😁 ) |
I just tested the maximum_size entry in the JSON. It really works. Thanks - elegant, simple, applies to every situation and no further work needed. 🙂 |
"I'm speculating that the concern comes from using the Teensy environment to build an image and then using a non-PIO tool to do the upload. That could blow the CDC/DFU bootloader away if the image is max'd out and the lock bits aren't set right." yup |
-Enable
boards_dir
option in PIO INI-Remove defunct custom board file operations from PIO auto-build environment
-Remove now-defunct
teensy20
PIO environment entry, replaced byat90USB1286_CDC
andat90USB1286_DFU
(usingteensy20
entry always put AT90USB board bootloaders in jeopardy of being overwritten due to the very small size of the official Teensy++ 2.0 bootloader)-Update monitor_speed for AT90USB boards
-Whitespace