Bootloading a Samd21 with less pins?

Hello i have a 2 arduino zero boards and 1 m0+ board all with a Samd21 processor on it. I did count the pins. But i was wondering something else.

about a year ago i bought some processors by them self ATSAMD21E15B-AU. They have less pins on them then the one that comes with the boards that is ATSAMD21G18. Back then i was unsure if i can program them the same way as the Zero boards for bootloading. So i gave up on that and put them away into now. I have a use for them and I'm wondering if i program the same bootloader as i did for my zero boards using the ice programmer, Would it take or would i need to do something to it to make it work?

Joseph

This boards platform provides support for the ATSAMD21E15A:

Unfortunately, I don't see anything in there about ATSAMD21E15B, but it might be that the ATSAMD21E15A board definition also applies. I don't know anything about the significance of the A vs B. If not, that platform would likely provide the easiest base for adding this part.

Another, more actively maintained, boards platform that provides support for ATSAMD21E15A is Adafruit SAMD Boards:

Hellp Pert my Zero board is a ATSAMD21G18A-U not the ATSAMD21E15A model as you said. Mine was bought from the arduino store when they first came out. I think the E15B model ATSAMD21E15B-A maybe work. I'm going to give it a try I need to look up the pinout to see if they line up and if they do then i need to order some PCB for it. I will keep this post updated what happens next.

Joseph

I never said anything about the Zero using ATSAMD21E15A. I'm well aware of which microcontroller the Zero uses.

I mentioned the ATSAMD21E15A because the 3rd party boards platforms I shared above provide support for that part and it is likely very similar to your ATSAMD21E15B, which is the topic of the discussion here. I don't see how your Zero board is relevant to this conversation.

Hello pert, I miss understood what you wrote. I'm relooking at it again. I'm bringing up my board because of the processor that is on there is what i wrote about. Compare to the new processors i got a while ago. I was trying to see if i can program the newer processor like the board with the same bootloader.

Anyhow you are right i'll leave my board out of it. And i will try to boot load it.

Joseph

Hello, I did mange to get the processor ATSAMD21E15B boot loaded using the standed arduino zero loader. Also i tried a blink led sketch that loaded with no problem but when i tried to put a led on pin 18 which is PA17 assigned to arduino as D13 nothing happens. I always tired every other pin on there and got nothing at all. I'm not sure what is going on.

Joseph

Hello i found something that looks like the same problem I'm having in another post here. It looks like he has created his own board and bootloader for this. I have tired it and came up with this error.

I have put the folder in the Documents/Arduino Folder right with the libraries and sketches. Then i open arduino and saw it in the Boards area. So i selected it and upload the blink sketch and came up with this error.

Sketch uses 10792 bytes (65%) of program storage space. Maximum is 16384 bytes.
Global variables use 1984 bytes of dynamic memory.
Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:36)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
embedded:startup.tcl:60: Error: Can't find C:\Users\jJc\Documents\Arduino\hardware\my_boards\samd/variants/samd21e15/{build.openocdscript}
in procedure 'script' 
at file "embedded:startup.tcl", line 60
the selected serial port at file "embedded:startup.tcl", line 60
 does not exist or your board is not connected

I'm not sure what to do now? This is beyond my skill level now.

Edit: I'm at this point I'm unsure now what to do. Should i keep with this post or ask for help in the other post where that guy is having the same problem as me?

Joseph

I would keep my own topic and follow the other topic.

Can't help with your problem.

hello has anyone else successfully worked with this processor on the arduino community? Any if so can you please help and let me know what I'm doing wrong please?

Joseph

You should invest on a real debugger/programmer such as a JLINK SWD. Makes it easier to load code to bare chips (and debugging issues with your program)

This is the syntax for a property expansion in the Arduino "properties" data format used by boards.txt and platform.txt files of Arduino boards platforms.

When you see this sort of thing, it means the property was not defined, in which case the expansion syntax is simply treated as a string literal.

I'll provide a simple example. If I had this in a platform.txt file:

some.name=joseph
salutation=hello {some.name}

Then the value of the salutation property would be set to "hello joseph".

But if I forgot to define the some.name property:

salutation=hello {some.name}

Then the value of the salutation property would be set to "hello {some.name}".
(don't get confused by the . in the property name. It doesn't have any special significance. It's only a character in an arbitrary property name.)

So the reason for this odd path in your error message:

is that your platform does not define the build.openocdscript property

I do have a SWD programmer. I actually took a spare arduino zero and turned it into a programmer and using the swd pins to program other swd chips.

joseph

Hey Pert i found this Github suppose to be for this processor version. That is how i came across this error.

Joseph

Cool! I wasn't aware of that one. I'll add it to my list of every known Arduino boards platform.


I think I spotted the cause of your error:
https://github.com/hydronics2/samd21_QFP_reference_PCB/blob/master/arduino/hardware/my_boards/samd/boards.txt#L28

samd21e15.openocdscript=openocd_scripts/arduino_zero.cfg

Try changing that line to this:

samd21e15.build.openocdscript=openocd_scripts/arduino_zero.cfg

Then restart the Arduino IDE and try uploading again.

Hey Pert, Is that correct it needs to go into the Documents/Arduino then make that hardware folder there and put that in there Or does it need to go some other place?

Joseph

The correct location is under the hardware subfolder of your sketchbook folder (the default location of which is C:\Users\user name \Documents\Arduino on Windows):

<sketchbook folder>
|_ hardware
    |_ my_boards
        |_ samd
            |_ boards.txt
            |_ etc ...

Okay, I have done that. Now Question is which bootloader do i use to make this work? Currently I'm trying by using the arduino zero bootloader.

Joseph

I have uploaded the Arduino zero bootload. Now I have tried the my_board board in the board manger that shows up. I get this error now that i have not seen before.

Sketch uses 12284 bytes (74%) of program storage space. Maximum is 16384 bytes.
Global variables use 2056 bytes of dynamic memory.
Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:36)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
target halted due to debug-request, current mode: Thread 
xPSR: 0x61000000 pc: 0x0000060c msp: 0x20007ffc
** Programming Started **
auto erase enabled
Error: Invalid command argument
image.base_address option value ('bootloader.size') is not valid
embedded:startup.tcl:477: Error: ** Programming Failed **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 536
at file "embedded:startup.tcl", line 477
the selected serial port at file "embedded:startup.tcl", line 477
 does not exist or your board is not connected

Not sure about that. I see they have some bootloader files in the repo:
https://github.com/hydronics2/samd21_QFP_reference_PCB/tree/master/arduino/hardware/my_boards/samd/bootloaders/trinketm0

but also say:
https://github.com/hydronics2/samd21_QFP_reference_PCB/tree/master/arduino

There is no bootloader so you need a Segger or ATMEL programmer to SWD program the device.

I took a arduino zero board and turned it into a swd programmer by removing the two zero ohms jump resistors and use the SWD pins to program the chip. I do use this board that i turn into a program on other 32bit processors. So i can verify that it does work.

Joseph