Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

PA10 on Trinket M0 high at boot
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PA10 on Trinket M0 high at boot

by msivers on Sat Mar 07, 2020 7:05 am

Hello,

I have created my own CircuitPython Bootloader for SAMD21E18 which is based on Trinket M0 bootloader. The only change is that I added some more pins to mpconfigboard.h which are not defined in the Trinket M0.
I noticed that when resetting the MCU the PA10 pin goes high for a fraction of a second which I like to avoid. On Trinket M0 this pin is connected to an onboard LED. I am not sure which part of the bootloader code I have to change to avoid that the pin goes high at boot. Any help would be appreciated.

msivers
 
Posts: 4
Joined: Wed Sep 25, 2019 4:12 pm

Re: PA10 on Trinket M0 high at boot

by tannewt on Mon Mar 09, 2020 1:03 pm

I think it's based on the define here: https://github.com/adafruit/uf2-samdx1/ ... nfig.h#L15

tannewt
 
Posts: 1536
Joined: Thu Oct 06, 2016 8:48 pm

Re: PA10 on Trinket M0 high at boot

by msivers on Mon Mar 09, 2020 6:00 pm

tannewt wrote:I think it's based on the define here: https://github.com/adafruit/uf2-samdx1/ ... nfig.h#L15

Yeah, I thought the same but commenting out this line actually resulted in a bricked board, see below.
viewtopic.php?f=52&t=163181
Also I would like to use the CircuitPython bootloader from the link below.
https://github.com/adafruit/circuitpyth ... trinket_m0
The mpboardconfig.h has a similar define which I already commented out but without any effect.

I guess my question is related to the following. When I start from a fresh board I first upload the bin file below via J-Link.
https://github.com/adafruit/uf2-samdx1/releases
After that the board gets recognized as a flash drive and I can upload the CircuitPython UF2 bootloader.
Does the new bootloader completely replace the old one or is there some part of the old bootloader still in the MCUs memory?
If it is a complete replacement there should be some line in the CircuitPython bootloader which pulls PA10 high during boot.
Otherwise it might also be hidden in the first bootloader.

msivers
 
Posts: 4
Joined: Wed Sep 25, 2019 4:12 pm

Re: PA10 on Trinket M0 high at boot

by tannewt on Mon Mar 09, 2020 6:15 pm

There is no CircuitPython bootloader. There is only the UF2 bootloader that loads UF2 files.

What do you mean by bricked? One important thing is that the UF2 Bootloader is unprotected when you first flash it with a J-Link. After loading the bootloader so you get the *BOOT you should run the bootloader updater that was also built by loading the uf2 file for it. Let it run fully and then the bootloader should be protected.

Once you do that you should be able to load a CircuitPython UF2 and double click reset to re-enter the bootloader and get the *BOOT drive back.

I'd encourage you to join the Adafruit Discord: https://adafru.it/discord There are a number of folks there that can help more rapidly than the forums.

tannewt
 
Posts: 1536
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.