first i programmed the bootloader from atmel studio 7 then after that i tried to program from Arduino ide, packages are proper install but when i program and upload successfully code then controller doesn,t detect. currently using feather M0 board. and also tried restore bootloader with adafruit solution https://learn.adafruit.com/prope.... but doesn,t happen. Currently using own custom board replica of Adafruit Feather Mo.
Hi malikqasim,
If I understand correctly, you've got a custom board based on the Adafruit Feather M0, you've successfully uploaded the bootloader, but thereafter the board won't connect with your computer over USB?
Have you tried connecting your board to the USB without the programmer and double tapping (two presses in quick succession) the reset button? This places the microcontroller into bootloader mode and will cause it to open a new connection (COM port) on your computer.
If this doesn't work, is it possible to upload a simple "blink" sketch using your programmer? This will overwrite your bootloader, but will establish that your microcontroller is working correctly without the USB.
MartinL:
Hi malikqasim,If I understand correctly, you've got a custom board based on the Adafruit Feather M0, you've successfully uploaded the bootloader, but thereafter the board won't connect with your computer over USB?
Have you tried connecting your board to the USB without the programmer and double tapping (two presses in quick succession) the reset button? This places the microcontroller into bootloader mode and will cause it to open a new connection (COM port) on your computer.
If this doesn't work, is it possible to upload a simple "blink" sketch using your programmer? This will overwrite your bootloader, but will establish that your microcontroller is working correctly without the USB.
MartinL,
i successfully uploaded the code and board is also being detect over usb without programmer. And it is also being detect in arduino ide but probelm is after i upload simple sketch, board is not showing on port and is not being connect over usb on computer.
Hi malikqasim,
If your board is able to upload code over its USB port, but is subsequently unable to run the sketch then it might possibly be a problem with your board's external 32.768kHz crystal (XOSC32K)?
The Adafruit's UF2 bootloader operates without an external crystal, since it instead uses the SAMD21's internal 32.768kHz oscillator (OSC32K). The microcontroller switches over to the crystal when the sketch starts. If there's a problem with the crystal, the board successfully uploads the code, but the sketch stalls and effectively fails to run.
If you have access to an oscilloscope then it might be worth probing the crystal. On my custom board using an Abracon ABS07 32.768kHz crystal, I get a 500mV sine wave. (Although the scope probe capacitance may affect the crystal's output).
Another way to check if the crystal is at fault, is to go to the Adafruit's "boards.txt" file, go to the entry for the Feather M0 (or Feather M0 Express, whichever one you're using) and add the switch -DCRYSTALLESS to the "build.extra_flags" line. This will cause the board to use the internal 32k oscillator instead of the 32k external crystal while running the sketch.
MartinL:
Another way to check if the crystal is at fault, is to go to the Adafruit's "boards.txt" file, go to the entry for the Feather M0 (or Feather M0 Express, whichever one you're using) and add the switch -DCRYSTALLESS to the "build.extra_flags" line. This will cause the board to use the internal 32k oscillator instead of the 32k external crystal while running the sketch.
Hi MartinL,
i tried last paragraph but didn,t work.
i tried last paragraph but didn,t work.
Trouble shooting is just a gradual process of elimiation. At least the issue probably isn't to do with the crystal. If you haven't already, it's probably best to remove the -DCRYSTALLESS entry. Just make sure you're compiling for the same board as the entry in the "boards.txt" file: Adafruit Feather M0 OR Adafruit Feather M0 Express.
Are you managing to upload your sketch without your programmer?
If you plug your board in to your computer (without your programmer) does it immediately connect to a COM port?
If you double tap your reset button does your board connect to a different COM port?
MartinL:
Trouble shooting is just a gradual process of elimiation. At least the issue probably isn't to do with the crystal. If you haven't already, it's probably best to remove the -DCRYSTALLESS entry. Just make sure you're compiling for the same board as the entry in the "boards.txt" file: Adafruit Feather M0 OR Adafruit Feather M0 Express.Are you managing to upload your sketch without your programmer?
If you plug your board in to your computer (without your programmer) does it immediately connect to a COM port?
If you double tap your reset button does your board connect to a different COM port?
removed -DCRYSTALLESS.
i,m managing to upload without programmer.
board is correct Adafruit Feather MO.
YES immediately connect to computer without programmer.
After double tap board is on same port
After double tap board is on same port
Ok, so you have a COM port after double tapping the reset button.
Do you have a COM port after a single press of the reset button?
Also, are you attempting to run a simple sketch that you know will work? If possible, I suggest using the standard "blink" sketch.
Is your board using an identical microcontroller to the Feather M0 and not a similar variant. Namely, are you using the SAMD21G18A on your custom board?
Hi malikqasam,
If you've got a schematic of your board that you could post it would be helpful, as it would allow not only myself, but also others on the forum spot if anything is amiss.