Another attempt at getting Muxto to work

Hello everyone. I have tried a few times now to incorporate the Nano Every into a larger circuit and have hit a hurdle every time with the step that involves getting Muxto to work. I have tried a lot of different things and even at this point made my own circuit board of the Nano Every just to remove variables in the process. I am fairly confident that my board is routed correctly, the USB traces are routed as a differential pair, I had it SMD assembled so that I didn’t have to wonder if my sloppy soldering was to blame.

I am now at the point where I have “successfully” programmed the ATSAMD11 with the Muxto.bin firmware found on the github here. I am using quotes because Atmel Studio confirms that the binary file is uploading correctly but the device is still not working so clearly I am still missing something.

When I plug in my programmed board the device manager shows it as an unrecognized device. When plugging in a fresh Nano Every I see that it shows up as an Arduino with a COM # in the device manager so I am clearly missing a step. I can’t tell if installing the Muxto binary on the ATSAMD also needs to be followed up with running the Muxto.ino file also hosted on the github. I understand that without the files hosted by Mattech that it is no longer a simple task to compile the firmware within the Arduino IDE. I can’t imagine that there is no way to program this device without those files since Arduino is still selling them.

I ended up going with this method of wiring up the Atmel ICE to make rewiring simpler

Here is the relevant pinout from the datasheet in case it’s helpful to someone.

I also downloaded Atmel studio because for some reason the Microchip IDE does not program binary files. Muxto.hex is 32 kB which is twice the size of the program memory on the Atsamd11 so it can’t be used. I am not super familiar with AVR programming but I know that there are sometimes issues when the fuses are not set correctly, maybe this is my problem?

I even tracked down the version of the nano every webpage that includes the muxto firmware upload instructions. It doesn’t help a lot since it seems to describe re-uploading the muxto firmware on a device that already has a bootloader installed.

If it wasn’t obvious I am pretty stubborn about this. I don’t want to use an external UPDI programmer to bypass the atsamd11, I want the included USB port to do the programming.

I’m doing this on Windows 10, Arduino 2.3.7. I have a Linux machine that I can employ as well if necessary.

Any help is greatly appreciated.

The inside of this processor, the ATmega4809, is a very different beast to the inside of other more conventional processors. Which is why many third party libraries do not work with them. Look up the data sheet for this processor.

There is a very good book from Tom Almy called "Far Inside The Arduino: Nano Every Supplement" He covers comprehensibly all the things you can do with it.

You can get the code from his examples here

Better still buy the book.

Sorry but I have no idea what Muxto is, and why you need it.

I have tried a few times now to incorporate the Nano Every into a larger circuit and have hit a hurdle every time with the step that involves getting Muxto to work.

I don’t want to use an external UPDI programmer to bypass the atsamd11, I want the included USB port to do the programming.

If you are using a Nano Every, the samd11 chip is pre-programmed as you need for both the usb terminal interface and the program download(with a 1200 baud trigger). Please explain more about your issue.

The .ino file is the source code from which the binary was compiled. So you would only use the .ino file if you wanted to modify the "MuxTO" firmware.

Thank you for confirming that, I am sort of grasping since I’m not sure what I’m missing.

I think my original post was not clear since I have been in the trenches with this for a bit. I am trying to take the arduino nano every circuit and incorporate it into one of my own circuit boards while still being able to program it/ serial communicate through a USB connector.

The arduino nano every has a second microcontroller (the ATSAMD11D14A) that behaves like a USB UPDI programmer for the ATMEL 4809. It’s basically the part of the board that handles USB communication since the 4809 doesn’t do it natively. Muxto is the firmware that is installed on the ATSAMD11 that makes it handle USB communication.

So far I have installed muxto on an atsamd11 but it shows up as an unrecognized USB device on my computer.

Can you confirm something else for me? I have seen the muxto firmware referred to as a bootloader in a few places, there also seems to be some sort of function that activates when you boot the nano every with the SWDIO pin connected to ground which would suggest a bootloader. I know that there are some instructions out there on using the “bossac” script to reprogram the ATSAMD11. Am I missing a second step that needs to happen in order to configure muxto/ the ATSAMD11? Here is a thread where they are talking about it, it’s pretty old so I don’t know it the info is outdated.

The bootloader is a separate binary:

MuxTO is the application binary, not the bootloader. Sometimes people incorrectly refer to programmers (the hardware device) as "bootloaders". The MuxTO firmware allows the ATSAMD11 chip to be used as a UPDI programmer (utilized to upload sketch binaries to the ATmega4809 on the Nano Every), so it is possible you might find some cases where people refer to that hardware as a "bootloader".

So, I understand that you are not using a Nano Every mounted on your board, but rather an AT4809 mounted on a custom board which you want to program through a usb connector.

If this understanding is correct, and you are indeed building a custom board with an AT4809 as the main mcu, you do not do not help the situation by calling it a Nano Every.

Rather than using a samd11 chip as a usb/updi interface (or using another updi solution) have you considered installing optiboot on the 4809?

MCUdude’s MegaCoreX has optiboot pre-compiled for any of the serial ports on the atmega4809.

I wasn’t familiar with optoboot but I have been reading through the documents. It seems like I would still need to set up a second chip to work as the USB device that does the UPDI programming on the 4809 correct? This might work for my purposes - I will keep reading the documentation. Thank you for the tip.

My goal is to make reprogramming the device as simple as possible for the end user, ideally exactly the same as programming an Arduino Nano Every from the Arduino IDE. I know that there are other ways to get an Arduino sketch onto the 4809 with a secondary ICSP programmer - I want to maintain the USB programming functionality of the original Nano every.

Has anyone successfully programmed the ATSAMD11 chip with the ‘muxto’ firmware and had it function the same as a store bought Arduino Nano Every? If so can you confirm that uploading the “muxto.bin” firmware (linked below) to the ATSAMD11 chip was all that was required so that I can at least narrow down what my mistakes might be? Is it not possible to do what I am trying to do without the mattech board files that allow the user to compile and program the board through the Arduino IDE?

You will need a updi programmer to burn the bootloader into the 4809 chip, but after that initial programming you will not need it. You will need a usb/ttl converter on the board like an FTDI or ch340. The bootloader code will reside on the 4809.

My goal is to make reprogramming the device as simple as possible for the end user, ideally exactly the same as programming an Arduino Nano Every from the Arduino IDE.

One alternative is to mount an complete Nano Every on you board using either a header or direct mounted with the castellated pads. How many of these boards are you planning to build?

Hey Cattledog, I appreciate you taking the time to think through this with me. I currently have a version of this circuit with an arduino soldered with headers to the back of the main PCB. Sadly, this increases the amount of soldering required quite a bit. I have tried the SMD castellated holes method as well but the design has other through hole components and is space constrained in a way that makes it difficult to find a big empty space on the main PCB to fit a daughter board. Integrating the nano every circuit into my main PCB will allow me to move components around in such a way that I can fit everything together more elegantly.

You will need a updi programmer to burn the bootloader into the 4809 chip, but after that initial programming you will not need it. You will need a usb/ttl converter on the board like an FTDI or ch340. The bootloader code will reside on the 4809.

Just to be clear - even with the converter chip on board once I flash optiboot will the installation process look the same as on a stock nano every? I know that the FTDI/ TTL chips often require a USB driver installation.

Frankly, I would still like to know what I am doing wrong with installing muxto on the ATSAMD11. I have read other people discuss installing muxto as a solution but based on my reading it seems like something that many have struggled to get working besides myself. If anyone has any insight on what I am missing I would appreciate it, if not it looks like optiboot is going to be my next step.

I have read other people discuss installing muxto as a solution but based on my reading it seems like something that many have struggled to get working besides myself

Yes, trying to install MuxTO on the Nano Every samd 11 using the ide and board selection for a MattairTech board has been an issue.

I would recommend that you get a SAMD 11 Xplained Pro development board from Microchip and use Atmel Studio to see if you can get the MuxTO code onto the chip.

https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/UserGuides/Atmel-42349-SAMD11-Xplained-Pro_User-Guide.pdf

It's all a bit over my head so curl up, have a good read and Good Luck.

Thank you Cattledog.

For other folks reading this, I actually have already programmed an ATSAMD11 with the muxto.bin firmware using atmel studio. It was on a custom board that I made, not the official dev board, so hardware mistakes are not out of the question. I will probably get the devboard/ “SAMD11 Xplained” board just to rule out hardware mistakes. However, I copied the posted schematic exactly, I am pretty confident in my board routing abilities, and I had the board SMD assembled so soldering mistakes are also unlikely.

The place where I am stuck is that after programming on the muxto.bin firmware, my board shows up in the device manager as an “unrecognised device” and as a result is not recognized by the arduino IDE. If anyone reading this has further suggestions for what debugging steps I should follow next I would appreciate it immensely.

You can try the steps at sugegsted at Nano Every sometimes does not USB enumerate on PC reboot to see if that will work for you (if there is no hardware issue).