Custom uploader for multi Arduino project

I have a Product involving two Arduinos (details later) and I may want to sell it in the future, but to be able to do it I have to create a user friendly uploader!

Here are some details to the project
Main Arduino: Arduino mkr Zero
Second Arduino: Arduino nano
The Arduinos communciate over Serial (nano uses SoftwareSerial)
The microusb port of the mkr zero is exposed to the outside, the mini usb from the nano cant be reach by a normal product user

My current Plan:
Create a simple Processing app that is able to load a .bin(mkr Zero) and a .hex(nano) file. Than the user should select the com port of the mkr zero and click start. The software would then upload a simple sketch to the mkr zero which just reroots the serial input to the nano. Then the .hex file is uploaded to the nano (over the mkr zero...). After the upload (to the nano) finished it should upload the .bin to the mkr zero.

To upload sketches I plan to use the Arduino CLI
So here is my first question: Is it possible to connect arduino cli and processing?
If not are there alternatives?

My next question is: The mkr enters bootloader mode when the com prot is opend at 1200 bps! The nano is reseted and then the upload is timed perfectly to enter bootmode (correct me if I am wrong!) But would the reset signal to the nano be disrupted by the mkr Zero in between?

Do you see any more difficulty/problems with this Plan?

P.S: I already have experience with Processing apps and know how to do the file loading and interface!

probierer:
Is it possible to connect arduino cli and processing?

Looks like it will be no problem:
PApplet...-

probierer:
would the reset signal to the nano be disrupted by the mkr Zero in between?

Well, first of all, if you have the Nano connected to the MKR Zero via Software Serial, then you're going to need to find a custom bootloader that allows uploading via software serial. The stock bootloader on the Nano won't do this.

As for the reset signal, the normal reset signal on upload to the classic Arduino Nano comes from the DTR or RTS pin of the FTDI FT232R (in the case of official Nanos or true clones) or the CH340 (in the case of Chinese Nano derivatives). You're not using that chip, so you're not going to have a normal reset signal. You'll need to connect a pin from the MKR Zero to the Nano's reset pin to do the reset.

Are you really sure you need two Arduino boards? It seems like a lot of trouble.

oh yeah! I forgot I have also one connection to the normal serial on the nano! And yes I have to use two arduinos because I have to play audio and render animations on an ws2182b pixel matrix (both libs use interrupts and therefore dont really work reliable) I already implemented the system and it works pretty good so that is not the Problem!

OK, so the stock bootloader will be fine, but you'll still need to pulse the Nano's reset pin LOW at the start of the upload process to activate the bootloader.

I mostly wonder WHY you expect users of your product to install their own software (basically firmware)... and why you don't want to use the IDE for this. Or if distributing the code as .hex file, you can use avrdude. Just build a simple shell script around it, add a basic GUI if you wanna be fancy.

pert:
OK, so the stock bootloader will be fine, but you'll still need to pulse the Nano's reset pin LOW at the start of the upload process to activate the bootloader.

Okay thanks!

wvmarle:
I mostly wonder WHY you expect users of your product to install their own software (basically firmware)... and why you don't want to use the IDE for this. Or if distributing the code as .hex file, you can use avrdude. Just build a simple shell script around it, add a basic GUI if you wanna be fancy.

My project involves a lot of files and custom modified libs. I cant expect the users of the Product to import all the correct files and compile it for an Software Update (The Product of course comes pre flashed, but I want them to be able to receive updates) But thanks for the Info, I will have a look in avrdude

You can only use avrdude to upload to the Nano. The uploader tool for the MKR Zero is bossac (the command line tool for bossa).

Just found it in the verbose output from the ide! I have now an Idea how to realize it! Thanks a lot for all the Information!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.