DIY arduino zero

Hi,
I want to DIY a board of "arduino zero", for teaching. Because the live debugger of "arduino zero" is very useful and vivid when I explaining the running process of the program for my students. Another reason is that the price of "arduino zero" is expensive in terms of my income.
I read the schematics of "arduino zero", there are two mcus, one is samd21g18, but another one has no mcu name in the schematics, it just labeled as "IC3".
捕获
What is "IC3"? Very confused.
I think there are bootloaders in these two mcus, if I want to DIY this board, can anyone tell me how to get the bootloaders and burn them to the mcus of my DIY board?
My English is poor, I‘m sorry.
Best regards.

https://kr.mouser.com/datasheet/2/268/mchp_s_a0007997221_1-2275308.pdf

You might be able to put together a lower cost solution based on this open source CMSIS-DAP compliant debugger:

It can be used with Arduino IDE 2.x just the same as the Zero's on board EDBG debugger.

The creator of free-dap also sells the debug probes on Tindie for a very reasonable price:

I have been very happy with it.

1 Like

Hi @wanggaoteng

For educational purposes, Segger also off their J-Link Edu Mini, that's also compatible with Atmel/Microchip Studio: https://www.segger.com/products/debug-probes/j-link/models/j-link-edu-mini/.

Hi, thank you.
I have tried to buy, but the CMSIS-DAP by Alex Taradov in "Tindie" can't shiped to China, so...
But there are so many cmsis-dap (most based on the files in github, and even there is a hand-by-hand book about how to diy a daplink) in "taobao.com", most of them are very cheap ($3-4USD). Can them suit for the live debug of arduino ide 2.0 ? Or can them be configured to suit arduino ide 2.0? I have no atsamd21 board on hand, cannot test.
Best regards.

Thanks a lot.

Thanks

Can you get the Microchip SMD21 Curiosity Nano where you are?
Like the Arduino zero, it includes a debug chip, and it's cheaper (in the US.) (I don't know if it works with the Arduino debug feature; it does work with Microchip Studio and MPLABX.)

AFAIK, the EDBG chip on Zero is an AT32UC3A4256 with pre-programmed firmware, is hard to purchase even in the US (minimum quantity 4000 at mouser and digikey, and still $8+...), and difficult to use (BGA package...) No one other than Arduino (and Microchip) provides a board with that chip (although there are many cheaper SAMD21 boards without the debug chip.)

I hope that Arduino plans to support other debug adapters, including semi-hosted debugging which would require just some clever SW in the SAMD chip, but I haven't been following the IDE 2.0 development discussions...

Hi, thanks a lot.
I have not a " Microchip SMD21 Curiosity Nano " at hand, but I order a ATSAMD21 board and a daplink today in taobao, they total $15 USD, shipping is included.
111
222
About 3 days I receive them, I will test them using arduino ide 2.0.
The daplink is open source in github, but the ATSAMD21 board can not find its schematic, it is regrettable.

the board is Arduino M0 or Zero without the debugger chip

Unless you already have them on hand, I don't think the J-Link is a good choice for this application of an educational setting with the Arduino IDE 2.x. The reason is that, although it is supported, it is more complex to use the J-Link debug probe because you must first install Segger's proprietary software and then add a special configuration file to each sketch you use the debugger on, as described here:

Compare that to the "plug and debug" experience when using a CMSIS-DAP compliant debug probe. Even though it is not such a big different for you or me, I think that it is best to avoid any unnecessary complexity in an educational setting. The students should be focused on learning embedded systems instead of getting the tools configured correctly.

1 Like

Well, I only mentioned that in passing. My main point is that the first link I shared provides you with both the hardware design files and firmware for the debug probe. I would guess that it would be easier and cheaper to base the integrated debug probe on your DIY ATSAMD21G18 board on that open source project than it would be to use the EDBG chip and its proprietary firmware.

I have the ATSAMD21 boards aplenty, but unfortunately I don't have one of these DAPLink things. It sounds interesting though. Maybe someone else here on the forum will be able to provide a definitive answer.

Some valuable information to know when you are interested in more advanced usage of the Arduino IDE 2.x integrated debugger is that the debugger is this VS Code extension:

So the information you find about that extension also generally applies to the Arduino IDE. I found mention of someone using DAPLink with the debugger here:

Please let us know what your findings are.

As I mentioned in my previous reply, the IDE is using this "Cortex Debug" extension, so pretty much anything it is capable of should be available to the Arduino IDE users.

Unfortunately, the Arduino developers never bothered to write formal documentation for configuring an Arduino boards platform for debugger support, but the minimal necessary changes can easily be reverse engineered by looking at how it was done in the "Arduino SAMD Boards" platform:
https://github.com/arduino/ArduinoCore-samd/blob/1.8.12/platform.txt#L129-L140

And there is one other piece, which is documented:
https://arduino.github.io/arduino-cli/latest/platform-specification/#sketch-debugging-configuration

I'm looking forward to seeing what the Arduino community will do with this new capability of the IDE.

@in0 Thanks for your insight into programmers and debugging. It's an interesting discussion.

Hi, thanks for prividing the web links.
I received the board and daplink today, but find that the SWD interface is 1.27mm :joy:
111
It was my fault that I didn't investigate it in advance.
A transfer line has been ordered, please wait some days again :sweat_smile:

Hi, thanks

Hi, thanks a lot.

Hi, I get the transfer line today, and test the "arduino ide 2.0 + daplink + arduino m0":

and find that the arduino ide 2.0 can not recognize the daplink, so arduino m0 can not be recognized too, so the live debugger isn't be launched. I noticed that there is a "launch.json" appeared when click the "Start Debugging" button:


I don't know how to configure the launch.json file, so the test failed. Can you help me?

Then I use platformio, it works perfectly, just one clicking, everything works very well:

Best regards.

Please provide a detailed description of what you mean by "can not recognize". Include the full and exact text of any error or warning messages you encounter.

I believe that the launch.json file is completely ignored. Instead, for debug probes that need a custom configuration, you should use the debug_custom.json file, as described here:

https://docs.arduino.cc/tutorials/mkr-wifi-1010/mkr-jlink-setup#debugging-in-arduino-ide-20

(but note that exact configuration is for j-link and almost certainly can't be used for Daplink).

Hi, I choose the board, port, programmer as follows:
1
Clicking the "Get Board Info", then the board information getted:
2
Then I upload the sketch, an error occured:


Because daplink is not supported by arduino ide 2.0:
5
so I think the errors when uploading are unavoidable, unless daplink is supported by arduino ide 2.0
Then I click the "Start Debugging" button, the following appeared:

It seems that something has to be configured.

The arduino ide 2.0 is not as good as platformio, platformio support daplink, just one click when debugging arduino m0. It is very friendly for the students.
I think there is a very long way for arduino ide 2.0
Best regards.