wagiminator / SAMD-Development-Boards

Collection of SAMD Development Boards, Programmers, Tools and Firmware
Other
26 stars 5 forks source link

Programming a ATSAMD21E18A without bootloader #2

Open heliosoph opened 3 years ago

heliosoph commented 3 years ago

At the moment I am designing a custom board with the ATSAMD21E18A. I want to program the controller directly via SWD without using a bootloader and USB. This could save me a USB connector on my board. For initial tests the controller sits on a breadboard. My programmer is the Atmel ICE. Connection via openocd is fine.

In the Arduino IDE I selected
SAMD DevBoards, Board "SAMD21E DevBoard", Microcontroller "SAMD21E18A", Clock Source "Internal Oscillator", USB Config "USB disabled", Serial Config "1xUART, 1xWIRE, 1xSPI", Bootloader "No Bootloader", Timer PWM Frequency "732.4Hz (16Bit)", Floating Point "Print & String use auto-promoted doubles only" Build Options "config.h disabled"

I was able to upload the blink example. It worked but I got some error messages that I unfortunately didn't copy. The blink example is running but the chip is bricked. No SWD connection is possible.

My questions are: Did you ever test uploading a sketch from the IDE without bootloader? Do you see any errors in what I did? Do you have any recommendations?

Thanks in advance

heliosoph

wagiminator commented 3 years ago

Hi, I tried it with your settings on my board. However, since I don't have an Atmel ICE, I used my SWD adapter. It worked for me with no problems. I also cannot imagine that the SAMD can be bricked so easily. Have you already tried another Arduino core (e.g. https://github.com/mattairtech/ArduinoCore-samd)? You can also try to install the bootoloader by hand (https://github.com/wagiminator/SAMD-Development-Boards/blob/main/SAMD21E_DevBoard/bootloader/readme.txt) and see if it works.

heliosoph commented 3 years ago

Hi wagiminator, thanks a lot for your testing and your quick reply! I tested with my Atmel ICE and a new chip and it works like a charm :-) I use the standard Arduino SAMD core. Programming also seems to be much faster than via USB. Don't know what I really did in the first try. Now it works and I have a starting point for my project.

Thanks

heliosoph

wagiminator commented 3 years ago

Well that sounds good. I wish you every success with your project!