-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Cannot upload generated code to Arduino Nano with Optiboot (new) bootloader, Arduino Every #2
Comments
Hi @BodoMinea I am working in another update but i did not have this issue. I would also like to link this repo with the auto update in the local Build of Otto Blockly that now is with the wrong fork. And have them sync so that we can continue working on improvements directly. Thanks a lot for your contribution! i wish you can help us more. 👍 |
Hi, no, this is not about the Arduino every or BLE or some new variant with feature additions. Not an old clone either (those are actually working properly and this is how I diagnosed the issue - old nano compiles and uploads, new arduino compiles and upload hangs, and I do have the CH340 installed because I sometimes program NodeMCU boards). It is a newly built, regular Arduino Nano acquired from a local supplier. The only difference is the bootloader. This one has an upgraded bootloader which requires a higher upload speed. You can see this issue discussed on another project which requires uploading to Arduino boards back in 2018: Also discussed on SE: https://arduino.stackexchange.com/questions/804/arduino-nano-uploading-gives-error-avrdude-stk500-recv-programmer-is-not-re Also people complaining of some Arduino boards referencing this: https://www.amazon.com/gp/customer-reviews/RW6XCPCYF030F?ASIN=B0713XK923 I wish you good luck and hope you'll keep up the good work with the updates and everything! If you need more information I'll be around. |
Hi @BodoMinea thanks Would you like to join us for more improvements? |
Pay attention to the upload speeds. Also notable: this difference between Arduino boards in the IDE board select was not here from the start, they introduced it with a board package update (AVR package 1.6.21) and later new IDE package, for example I found this file in this version in the Arduino IDE appdata board packages folder, not in the Program Files, but on a new install it comes in the program files. I am willing to help you further with this project. I do not have an Arduino Nano Every board but I did a little digging - installed the Mega AVR package in Arduino IDE through the Boards Manager and explored the boards.txt properties. It still uploads with avrdude, on BAUD 115200 (like the OptiBoot Nano I added) but also has a different CPU - atmega4809.
The addition to boards.js in Otto Blockly could look something like:
(I cannot verify all the values without a sample board at this time but I changed some according to the spec page at https://store.arduino.cc/arduino-nano-every - also this board apparently supports interrupts on all pins so interrupt should be changed, and also picture added - https://store-cdn.arduino.cc/uni/catalog/product/cache/1/image/520x330/604a3538c15e081937dbfbd20aa60aad/a/b/abx00028_featured_1.png ) |
How can you know if you have one nano or the other by trying both uploaders? |
If you choose the wrong option, it will stay for a long time on „Uploading” and then fail with:
Basically the board will not respond to the wrong sketch upload speed and the serial uploader will just wait until it times out. Maybe coding in some warning into the project would help (there's none in arduino). Something like: „Cannot upload to your Arduino Nano board? Try the different revision versions in the menu.” |
Yes in terms of User experience specially for beginners i would like to add some warning, maybe we need to increase the help section or at least make it clear in the forums |
Yes. The PR is merged now and theoretically we could close this issue. Do you want to add the supposed Arduino Every variant even though it is not tested? I could do that. And maybe also code in the warning. |
Yes that would be great please, i have all the "real new nanos" here (every, iot and BLE) so that... i could test now. There is also few community members loyal to Arduino that would love this. Thanks! |
I put in Pull Request #3 for adding the Arduino Nano Every which I could not test. It's a little bit different for the Arduino Nano 33 BLE. The Every is still a „regular AVR”, while the BLE runs on Cortex CPU, has native USB and has a different upload tool „openocd” which does not set an upload speed, at least in the Arduino IDE config files. I'm not sure this can be added to Otto Blockly as easily as editing the boards.js file. I think the compilation and upload processes need to be fired up differently. |
well at least having the nano every is a good start thanks! |
I just build the APP and once i try to check the code in Blockly with Arduino Nano selected i get Error: Command failed: verify.bat nanooptiboot Board nanooptiboot (platform avr, package arduino) is unknown |
Yes, I think there are some changes that need to be done in the Arduino Core that ships with blockly (put by installer into install directory). When I started contributing to this project, the Arduino part of it was not on the repo. I still do not know how this is installed locally (the board definitions in the Arduino Core seem to be missing, locally I copied them from my Arduino installations). There's the compilation/arduino folder in the repo, but the boards.txt file is not there. Can you give some insight into how the Arduino Core / Libraries are added to the local installation? Is there some archive / download / script taking place in the install phase (NSIS)? |
Hi @BodoMinea I was actually doing similar approach just copy the whole compilation/arduino folder from blocklino, which is necessary to have a local working installer or software, there is an .exe file there but i am not sure if is supposed to install before building the electron app. That is why i added to have all in one place and also because i saw it was important in other blockly arduino repos. It must be something related to arduino cli |
Hi, I looked into the problem. I can help you solve the old/new Arduino Nano part of it by providing my full installation folder. You can get it from here: https://drive.google.com/open?id=1m0rDPZVmRO6X_6Ue8MmQBH4P6cFzYPU_ The files regarding Arduino platforms and board definitions are not in the repo so a commit will not help. The archive above contains the current Github version of Otto Blockly and the necessary files and definitions (bootloader files, etc.) to make all Arduino Nanos (except de Every work). You can bundle this into the NSIS installer. I do not think I will be able to finalize the same tricks for the Every until I get a board on my hands to actually try. |
Hi so how about we upload the arduino platforms and boards definitions in a new pull request? how to bundle in the NSIS installer? I will try in every but better not to release this feature until is tested for all nanos |
@BodoMinea you can see here we still have this issue with this update, only the old bootloader works and sounds weird for beginners. Maybe this one we just call it Otto since is the one we use with our nano boards. |
@cparrapa yes, I know this issue is still ongoing and I'm looking into possible solutions. The thing is that the referenced files where the 'nanooptiboot' parameters are missing, are not to be found and therefore modified in this repo, but they are in the local otto blockly install. So basically, when I initially got Otto Blockly from the otto website, these files that are not in this repo were installed (by the installer, one example of this file is boards.txt). Do you know how this executable installer that is on the website is produced or by who? That's the only way we can update it. These are Arduino related files that the installer puts into the 'compilation' folder at install time. |
@BodoMinea as you see in Blocklino repo is also like that but somehow the arduino files are produced when packing i guess, this should be something related with Arduino CLI but i am also in the process of learning how it works this compiler. Thanks for taking some time to help! |
good news! @BodoMinea with your boards.txt file i manage to fix the next release for Arduino Optiboot(new), apparently that is the only file that needed to be changed, i also added Arduino Every inside that .txt, but i am not sure if the parameters are working, at least the check does not give errors |
Sorry if this is already addressed in some update, I couldn't find one through easy means - automatic update / GitHub.
On the local build of OttoDIY Blockly, obtained through the official website, which is definitely based on this, it is apparently not possible to compile and upload code suited for the new Arduino Nano variants which come with the OptiBoot bootloader. This requires higher code upload speed (BAUD 115200).
This also seems to be causing problems for other people on the forum:
My now open Pull Request #1 aims to solve this problem.
The text was updated successfully, but these errors were encountered: