Arduino Zero - is buying it a mistake?

I needed a plug and play USB MIDI interface so I could control a SDR which uses a MIDI interface. My research suggested that a UNO which I had, was low on processing was not the best for a MIDI peripheral. I decided on a Zero as I wanted the chance to use a debug interface that would be better than a serial port.
Having spent a couple of days I have made little progress with the Zero. I can only program it through the native interface, failed to get it recognized as any type of mouse or USB device, just a unspecified USB port.
A search for examples sketches that claim to be for a Zero are few, is this becasue they are so underused or can I assume that other similar processor based Arduinos should work.
Should I go for a different Arduino?

Lots of "wild thoughts" in Your question. Know that all helpers are newbies, totally stupid, regarding Your setup. You need to explain the matter in a more thorough way.
Read and follow this link: How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum

The Zero is one of a number a SAMD21 based arduino boards.
For getting it to emulate a keyboard/ mouse search for "hmi"

Guys thanks for being kind. I am a newbie but normally able to figure things out. Being more specific and asking in the right forum is important. But my question was intentional. Should I invest in the Zero or adopt a better supported device?? On paper the Zero fits my need, but just seems to have issues and perhaps better for those with more experience?
[1] Correct Forum? Well if I was looking for a specific technical issue I would be in that forum. but the inability to use the program port has been asked there, but no reply or just a trail that stops with the conclusion there is a bug in the IDE.
[2] My current technical issue. Using native port to program, I can get some of the HID sketches to load and run, judging from the TX led responding to inputs. But the USB device always shows up as a serial device and not as the required mouse. keyboard, MIDI etc. My reading did not suggest I needed to replace the boot loader or any tricks to make it take on the properties intended and I find nothing about this issue. There is so little information about using the ports for programing, guides mention that the programing port is better, but it does not work for me. My sense is there is an issue with how USB is working which is why I came here to see if this was just me doing something wrong.

There is an Arduino Zero category
https://forum.arduino.cc/c/hardware/arduino-zero

Please provide a detailed description of what has prevented you from programming it via the "Programming Port".

Please try this:

Upload this sketch to your Zero:

#include <Mouse.h>

const byte enablePin = 2;
const byte LEDPin = LED_BUILTIN;

void setup() {
  pinMode(enablePin, INPUT_PULLUP);
  pinMode(LEDPin, OUTPUT);
  Mouse.begin();
}

void loop() {
  if (digitalRead(enablePin) == LOW) {
    Mouse.move(0, 200);
    digitalWrite(LEDPin, HIGH);
    delay(1000);
    Mouse.move(0, -200);
    digitalWrite(LEDPin, LOW);
    delay(1000);
  }
}

Use a jumper wire to connect pin 2 to a GND pin (this is done so that you have a way to disable the mouse emulation so that it does not make it difficult to upload a new sketch to the board later).

You should now see the mouse moving up or down once a second. Do you see that?

Nothing has the level of community support that the AVR-based boards (e.g., Uno, Mega, Leonardo) have, both due to it being an ideal entry level architecture and because they have had the longest time to accumulate such support. However, the SAMD-based boards like the Zero have been around quite a long time and gotten a lot of love from Arduino and the community, so I think it is actually pretty well supported at this time.

One thing you need to understand is that portability is a hallmark of the Arduino project. So many sketches and libraries will work just fine on the Zero even if you don't see this stated explicitly. It is true that some libraries use architecture-specific low level code that does require the library author to add support for each architecture. But even in these cases, the SAMD21G18 microcontroller is one of the primary targets in the Arduino world so there is a good chance it was added.

If code is written for the SAMD architecture, then it will work on the Zero. The more recent boards of that architecture such as the Nano 33 IoT and MKR boards as well as the Adafruit, SparkFun, and Seeed Studio (e.g., XIAO) offerings are usually lower cost due to the omission of the onboard debugger, so you might see less mention of the Zero from the cost-sensitive hobbyist community these days.

The main exception would be the code that relies on supplemental components of some of the SAMD-based boards, such as the Wi-Fi radio on the Nano 33 IoT. Obviously, you can't use a library like WiFiNINA on a board that doesn't have a "NINA" radio module connected, even though the library is compatible with the SAMD architecture.

I don't see any evidence so far that would indicate your problem is related to the bootloader.

I might have one, but I need you to provide more information before I know whether it is applicable to your situation.

ino
Thanks for taking the time to help. Just dealing with the test program. The answer is no, it does not work.
I used the cloud editor to load just to be sure there were no issues with my libs. It complied and loaded, no mouse movement and the device manager in Windows showed the first attached image.
runningDM
I was no longer able to upload or "see" the board. After a double reset I get a different view in the device manager. See the second image.
DM-2-after reset
Then by changing the native port number on the editor I can get back in and upload again. The jumper on pin 2 seemed to have no effect.
I have another post on the forum, about the programing port. The latest on that Unexpected command line argument: {extra_params} - #7 by ukphotoguy
Suggests it is a bug that was fixed back in November but not released yet. I have yet to understand the work around, todays task. But I doo feel that the experience with this board is less than great.
I was sold by this article Create a MIDI Device | Arduino Documentation | Arduino Documentation
It would be a great start for me. But this does not compile on my zero without errors, undeclared variables, then if I declare them I still get issues, working round them I can get it to load but same USB view in the DM., however whenever I press one of the buttons, the tx led toggles and this suggest it may be working but not connecting through USB.
Hence my theory that USB seems broke on this board. The fix from the other forum might be the solution, just not obvious for someone as new as me to incorporate the fix!
Hope this helps move things forward.

Having fixed programing port download I tried your example again and read the code. I can confirm that the L led is pulsing as is a burst from the tx light. That stops when I remove the pin 2 ground. So the program is working at the board level. Each time I reset the board, the com port count increases. Removing drivers and trying to change drives for the expected mouse driver all fail. Trying on a computer with no Arduino software installed results in windows finding the Arduino Zero and the extra serial port.
The Create a MIDI Device sample program still fails to compile, see image. If I fix by defining the letters it then fails because of a duplicate definition of A so I switched that out for a H and then it compiled and loaded. Seems to work as the TX led bursts whenever I push a button, but same USB devices appear in the Device manager, just an extra serial port not the expected MIDI controller. Odd that old example code will not compile and the A gets treated differently. I wonder if anybody got this code working on a Zero. Even has me wondering if my Zero is a fake, its marked official was unopened and the box has the hologram.


I am about dry of ideas, so I hope someone can invest some time for me.

Aha, you've already discovered one of my "tricks". Great work finding that solution already. This is progress!

I have one more trick up my sleeve for this problem, courtesy of one of Arduino's developers:

your problem is likely related with drivers installation; a solution is to open Device Manager and uninstall the MKR1000 drivers; after reset, both serial and HID (keyboard) drivers should be automatically installed (thanks to windows 10).

It sounds like you were already on the right track with looking at the drivers.

I'll provide more detailed instructions:

  1. Upload a sketch to your Arduino board that uses the "Keyboard" or "Mouse" library.
    You can use that test sketch I provided above.
  2. Open the Windows Device Manager.
  3. Under the "Ports (COM & LPT)" tree, you should see your Arduino board listed with a :warning:. Right click on it.
  4. Select "Uninstall device" from the context menu.
  5. Check the box next to "☐ Delete the driver software for this device".
  6. Click the Uninstall button.
  7. Unplug the Arduino board's USB cable.
  8. Plug the Arduino board's USB cable back in.
  9. Check the "Ports (COM & LPT)" tree in "Device Manager" again. If you still see your Arduino board listed with a :warning:, repeat from step (3) until it no longer appears.
    I find that sometimes it takes multiple attempts to completely remove the problematic drivers from my system (perhaps there are multiple copies of them present).

Keyboard and mouse emulation should now start working as expected.

Thanks for sticking with me here. I had seen that article which is why I tried removing drivers and even using a computer that had never seen Arduino.
No luck repeatedly deleting and finding drivers. But a re-read of the Keyboard and Mouse not working document introduced me to USBDview which let me see all current and previous USB devices seen by the PC. I used it to delete all the unused clutter and start with a clean set each time.
I have made a number of experiments, even rolled back to use the 1.6.21 SAMD version. I find that it perhaps works if I connect the PC to the programing USB where I see two extra HID devices and no errors in device manager. The mouse does not move and the TX led is not bursting on the board, so I suspect there is no connection to that USB port.
This raises a question, can you connect applications to the programing USB, the mouse.h documents do not acknowledge a programing port so presumably that library uses the native port. Never seen any mention of using or selecting which port, would be cool if you could use both??
I still have the problem that when using the native port connected to the PC I never get a HID driver, the device descriptor is shown as Arduino Zero device type of HID so windows loads the driver for the description, i.e Arduino and then finds it in error becasue it does not open correctly, I think that is why it is disabled.
I think this is a similar but different issue to the original problem Keyboard and Mouse..., but perhaps the difference is I am using a Zero not a MKRZERO whatever that is??
I feel confident enough to feel that no amount of removing and replacing the driver will work, unless I can force the driver to be an HID mouse, and windows does not want me to do that.
Here is the windows device manager when connected through the programing port, note the four HID devices, there would normaly be two.


This is the USBDview view.

When connected to the Native port I get these results
First Device Manager

You can see I had done some experimenting by the com port numbers which keep incrementing on each try.
The USBDview shows

If you want the details of the HID port they look like this

This illustrates the issue with incorrect Driver Description as originally identified in the original issue posting.
The corisponding details when using the programing port is

OK well not sure I can do much more, have to say that whereas I appreciate this is a community based project, Arduino as a not for profit company should be doing a better job of this basic stuff working out of the box. I truly believe I should never have purchased a Zero as so far I am like four days into this and still cannot make a mouse move.
Any suggestions or places to wave my red flag?

OK kudos to those still reading. Just had a cup of coffee and had a thought, how many times this happens? You write up where you are at, relax and then have a breakthrough.
I didn't restart my IDE after downgrading the SAMD version.
So, after a restart I reload the simple mouse sketch and it worked. My mouse went up and down as expected.
The resulting device manager view is now


The USBBview has this view

and the details of the HID line is

To those following in my footsteps, you need to go all the way back to SAMD version 1.6.21 for the USB and programming port of the Arduino Zero to work!!! Somebody tell the QA person in charge of releases.

Now that you have found a work around, you could report the issue here: GitHub - arduino/ArduinoCore-samd: Arduino Core for SAMD21 CPU

Judging by the ages of some of the current issues, it is unlikely to get an immediate fix, but it may help others who attempt the same thing.

EL34, Just finished doing just that, rather a frustrating start to my programing again. Thanks for encouragement.

I would buy a Zero just for fun, if it didn't cost an arm and a leg where I live.

You can only use the "Native Port". This port is connected directly to the primary ATSAMD21G18 microcontroller of the Zero. So the microcontroller is able to connect to the computer via the HID interface.

The "Programming Port" is connected to the EDBG debug probe on the board, which is a separate microcontroller from the one your sketch program runs on. The EDBG is in turn connected to the ATSAMD21G18. So that chip is acting as a "bridge" for communication with the computer. This is why you must use the "Native Port" for HID.

I don't think so. The Arduino MKR Zero board also uses the ATSAMD21G18 microcontroller. Other than the different form factor of the board, the primary difference between the two is that the MKR Zero does not have an EDBG. So it only has a "Native Port".

I'm glad you persevered and finally found success!

That is definitely unexpected. I don't have any explanation for why restarting the Arduino IDE would cause it to work. I guess we should just be happy that it did.

In order to make all relevant information available to any who are interested in this subject, I'll share a link to the report here:

I would keep an eye on the Arduino Store for sales. I noticed quite a good discount on that board just recently. Sadly it looks like it is no longer.

I end up using mine quite a bit recently because the onboard debugger makes using the Zero the fastest way for me to start up a debugging session in Arduino IDE 2.x to do a quick check on something.

aarg,
I am happy for you. I am a little further into my Zero, still not a happy programmer.
For the community, perhaps old, perhaps helpful, some more feedback.
Remember I am using old code, version 1.6.21 of the SAM Boards core.
Guess what? It does not support debugging, comes up in IDE2 as board not supported. If I go to the current SAM version 1.8.12 it shows debug supported, but becasue of the known issue that was never fixed, you cannot download to the programming port. But you can use 1.8.10 which seems to download OK and has debug. Great if you are not trying to run any sketch that want to use the USB features becasue to get HID USB support you still need to roll back to 1.6.21.
So, for me I have a board with no debug.
Next helpful find. Even the Blink sketch does not work on the Zero as the serial port is different. You need to use SerialUSB. instead of serial. Not really clear in the docs, you need to dig a bit for that.
Now the next issue. Known problem with a single USB port and lots of data, assuming you are using serialUSB and monitoring a terminal on the native programming port, there is a traffic issue. If you have a lot of traffic, for me that means regular MIDI commands and a reasonable level of serial port traffic, like monitoring a loop and some variables: You hit the lost traffic or full buffer issues and things start to fall apart. My solution is to use serial1 which goes to the pins 1 and 2 connected to a serial to USB board. Now I have a hardware independent serial port which seems stable and can handle the traffic.
Summery, Yes go buy a Zero, but if you want to use HID USB, including Mouse/Keyboard & MIDI emulation, you get no debug and will probably need a serial to USB board for debug using the serial port.

Blink sketch doesn't use the serial port.

But it is true that most Arduino sketches are written for Serial, and so need adjustment to do serial communication via the "Native USB" port on the Zero. That is not usually a problem because most people use the "Programming Port" for this purpose. The "Native USB" port is mostly used when you need to do HID.

And anyway, it is really not so difficult to make this change in the sketches where necessary. If you aren't comfortable with that, then the more entry level boards like the Uno and Leonardo are probably a better choice until you get more experienced with writing code.

I think it is reasonably well documented.

There is a table on the Arduino language reference page for serial communication:
https://www.arduino.cc/reference/en/language/functions/communication/serial/

and several mentions on the product page:

https://store.arduino.cc/products/arduino-zero#docs

Very cool!

The Zero should work, and of course if everyone who has problems with it just gives up, those problems will never get fixed. A nice chicken and egg problem.

That said, for music-oriented stuff, you might have better luck with one of the PJRC Teensy boards.
(teensy 2 is approximately Uno powered. Teensy-LC is similar to Zero. The Teensy-3 and higher are all significantly more powerful. None of hardware debugging support, though.)

Speaking of problems getting fixed, the fix for the "Programming Port' upload bug on the Zero has now been released in "Arduino SAMD (32-bits ARM Cortex-M0+) Boards" version 1.8.13, available for updates via the Arduino Boards Manager.

The driver issue is still a bit of a mystery to me. It does seem that the bug was never fixed, but I have not seen any other reports that weren't resolved by the workaround mentioned above. This despite the fact that it has existed for almost three years now and affects the entire popular SAMD boards line, surely in use by thousands of Windows users over that time. So it seems that there must be something unique about @ukphotoguy's system or usage.

Guys, looks like there is movement on finding a solution to the problems. My setup is not special, I just feel using the Zero for HID emulation is not popular.
For the past week I have shifted to using a Leonardo which seems to have worked flawlessly for me, reliably downloading and then acting as a MIDI controller. Same setup and same programmer. So, either I got a lot better, or the new board is much more stable.
I am really looking forward to being able to use the debug feature when things settle down.