mattairtech / ArduinoCore-samd

This is a fork from arduino/ArduinoCore-samd on GitHub. This will be used to maintain Arduino support for SAM D|L|C (M0+ and M4F) boards including the MattairTech Xeno Mini and the MT-D21E (see https://www.mattairtech.com/). It adds support for new devices like the D51, L21, C21, and D11. It also adds new clock sources, like a high speed crystal or internal oscillator.
103 stars 43 forks source link

SAMC UART Bootloader does not work #52

Open fdasbfg opened 5 months ago

fdasbfg commented 5 months ago

I have a custom board with SAMC21E, and I am trying to get the UART bootloader working. I would like to use SERCOM1, and reconfigured everything to use the correct pins. I can upload the new binary file and the LED blinks like it should, but I can't upload code using arduino.

To try and get to the bottom of the problem I made an Atmel Studio project to see if I could debug the issue. After a lot of trial and error I managed to copy settings from the makefile into atmel studio's built in toolchain manager, as just using an external makefile only shows raw assembly, no source file. I can now debug like normal and watch the code run from the source files.

I can send a "#" over serial and the "serial_sharp_received" function returns true and the "sam_ba_monitor_run" function starts and the code seems to just sit waiting for more data over serial, the "serial_is_rx_ready" function. This makes me think everything is at least configured properly, the proper clock settings, sercom settings, and baudrate at least.

Any ideas on where to go next would be greatly appreciated, because I have no idea where to go from here!