Adafruit is open and shipping! Let's build back better, together!
0

UF2 bootloader SAME54 XPRO board
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

UF2 bootloader SAME54 XPRO board

by ktritz on Wed Nov 11, 2020 6:50 pm

Greetings,

I have the SAME54 XPRO dev board, and would like to get CircuitPython running on it. It doesn't show up as a drive when I plug in the USB cable (plugged in the DEBUG port), and pressing the reset button doesn't seem to work either. I've been able to flash example LED code using Microchip Studio, so it appears to be connected and recognized by the computer, but it doesn't seem to have the UF2 bootloader installed. I tried to flash bootloader-same54_xplained-3.11.0.bin found on GitHub, but that didn't seem to work either.

Any suggestions?

ktritz
 
Posts: 6
Joined: Wed Nov 11, 2020 6:46 pm

Re: UF2 bootloader SAME54 XPRO board

by danhalbert on Thu Nov 12, 2020 4:01 pm

If you have loaded the UF2 bootloader successfully, then you need to use the regular port, not the DEBUG port. If you double-click the rest button, you should see a BOOT drive.

danhalbert
 
Posts: 2196
Joined: Tue Aug 08, 2017 12:37 pm

Re: UF2 bootloader SAME54 XPRO board

by ktritz on Fri Nov 13, 2020 3:25 pm

Thanks for the assistance, unfortunately no luck. Here is what I tried (I have 2 boards, both showed exact same response):

Use Atmel Studio 7 to load LED flasher code over USB debug port:
WORKS, can change LED on/off time delay in the code

Use Atmel Studio 7 to load bootloader-same54_xplained-3.11.0.bin over USB debug port:
successful write & verify
LED dimming/cycling ~ few Hz
no drive shows up
press reset button once, twice, multiple times - no change

Move USB cable to regular port:
LED flickers and then turns off
no drive shows up
press reset button once, twice, multiple times - no change

Move USB cable back to debug and try to reflash LED code:
works fine

Now, under the 'Advanced' selection in the Atmel Studio programming, there is an option to set the programming address or use a flashloader applet. Are either of these necessary? I know that when using Bossa, I would need a 0x4000 offset, but not sure if this is equivalent.

ktritz
 
Posts: 6
Joined: Wed Nov 11, 2020 6:46 pm

Re: UF2 bootloader SAME54 XPRO board

by danhalbert on Fri Nov 13, 2020 3:47 pm

The bootloader gets loaded at offset 0x0, and takes 16kB. SAMD5x bootloaders are 16kB, SAMD21 are 8kB.

The fast flash of the red LED when USB is not connected to the regular port indicates that the bootloader thinks it is not connected to USB, which is correct.

You should see a slow pulsing of the red LED when the regular port is plugged into the host computer. Is this on Windows 10?

danhalbert
 
Posts: 2196
Joined: Tue Aug 08, 2017 12:37 pm

Re: UF2 bootloader SAME54 XPRO board

by ktritz on Fri Nov 13, 2020 4:02 pm

Yes, I'm on Windows 10. The LED is amber and labeled LED0. When I start up with it connected to the regular port (labeled 'target usb') the LED blinks once or twice then turns off.

ktritz
 
Posts: 6
Joined: Wed Nov 11, 2020 6:46 pm

Re: UF2 bootloader SAME54 XPRO board

by danhalbert on Fri Nov 13, 2020 4:22 pm

Are you loading the flashing-LED test program at 0x0 or 0x4000?

I loaded the bootloader .bin onto a SAME54 XPRO board using a J-Link connected to the SWD connector and the JFlashLiteExe program. I loaded it at 0x0. I had a USB cable connected to the "TARGET USB" port. After loading,I removed the J-Link cable, and then double-clicked the RESET button, and LED0, near the SW0 button, starts to pulse slowing. I see an E54XBOOT drive appear.

(I am color-blind, sorry for red vs amber.)

danhalbert
 
Posts: 2196
Joined: Tue Aug 08, 2017 12:37 pm

Re: UF2 bootloader SAME54 XPRO board

by ktritz on Fri Nov 13, 2020 5:11 pm

I'm loading at 0x0 using the USB debug port, then switch over to the USB target port, no boot drive, and the LED turns off after a couple of flashes.

ktritz
 
Posts: 6
Joined: Wed Nov 11, 2020 6:46 pm

Re: UF2 bootloader SAME54 XPRO board

by danhalbert on Fri Nov 13, 2020 5:22 pm

I will download Atmel Studio and try a load that way. But in the meantime, do you have another machine to try the loaded board on? Even a Raspberry Pi should show the BOOT drive. It's possible there is another issue here: some utility programs prevent seeing the BOOT drives.

https://learn.adafruit.com/welcome-to-c ... -2978448-5 may be helpful

danhalbert
 
Posts: 2196
Joined: Tue Aug 08, 2017 12:37 pm

Re: UF2 bootloader SAME54 XPRO board

by danhalbert on Fri Nov 13, 2020 5:49 pm

I tried with Atmel Studio. First I erased the chip to make sure the bootloader I loaded was gone. Then I loaded the bin file, verified it, and switched the USB cord from DEBUG to TARGET. It pulses slowly as expected. So I think you may be programming it fine, but there's something else that is blocking your seeing the BOOT drive, as I mentioned in the previous post.

danhalbert
 
Posts: 2196
Joined: Tue Aug 08, 2017 12:37 pm

Re: UF2 bootloader SAME54 XPRO board

by ktritz on Fri Nov 13, 2020 6:35 pm

I tried another computer, and I saw the boot drive briefly appear before disappearing. This is a computer that hasn't had any Atmel programs installed previously. I tried multiple cables with and without going through a USB hub, and different ports. The boot drive shows up for about a second before disappearing.

The LED flickering on the board before turning off is the same as on the previous computer, so I'm not sure if I just missed a temporary mount of the drive on the original PC.

Pushing the reset button has no effect, the LED doesn't even cycle like it does when the power is first applied.

ktritz
 
Posts: 6
Joined: Wed Nov 11, 2020 6:46 pm

Re: UF2 bootloader SAME54 XPRO board

by ktritz on Fri Nov 13, 2020 8:26 pm

Ok, I figured it out in a weird, roundabout way. I was testing different example projects and loaded the LEDswitcher project which toggles the LED whenever switch SW0 is pushed. It worked fine, but when I switch the USB cable to the target instead of the debug port, the LED was super dim whenever I toggled it on. This indicated to me maybe there was a current draw somewhere.

I noticed the two jumpers just above the LED where set to measurement instead of bypass (that's how the came) so I moved the jumpers to bypass and voila, I now see the boot drive. There must have been too much loading on some circuit with the jumpers in the measurement position.

Now I can drag the circuit python uf2 file over, and see the CIRCUITPY drive.

Thanks for the assistance.

ktritz
 
Posts: 6
Joined: Wed Nov 11, 2020 6:46 pm

Re: UF2 bootloader SAME54 XPRO board

by danhalbert on Fri Nov 13, 2020 9:52 pm

Hooray! Glad you figured it out. I'll remember that potential issue.

danhalbert
 
Posts: 2196
Joined: Tue Aug 08, 2017 12:37 pm

Please be positive and constructive with your questions and comments.