also, you should convert an ST-Link into a Black Magic Probe, because we support that programmer in the CLI via openocd here's a link about it microcontrollerelectronics.com/how-to-convert-an-stm32f103c8t6-into-a-black-magic-probe/
@@ubidefeo Oh nice!! That's exactly what I need. Custom board! And thanks for some lead into using ST-Link. I have the ST-Link V2 and the STM32 Discovery Board with ST-Link. I'll try the Black Magic probe option.
@@sayanee hi Sayanee, do we really need to Rebuild the .bin even if using default settings? Can i just use the .bin file from repo straight away? Please make video about creating custom board!!
@@bhargavmistry1274 Uh! Indeed the repository does have a *.bin file github.com/arduino/ArduinoCore-samd/tree/master/bootloaders/zero. Well, upload it and see if it works for you. I always like to generate these files as I can know how they were built even if it's the default. Personal preference :) Custom board is definitely in for a future video 🙏🏼
I really love your videos, I got out of electronics back when PIC controllers were a thing and you had to imagine in your head what PWM signals looked like as no one could afford much tools or technology in general. Now I am amazed with your Logic Analyzer video and videos like this one how easy it has become for people today. Wish this was around when I was a kid I might have gone in the engineering side, for now I'll have to think of projects for myself and build my own gear to make it happen. Just picked up Arduino to teach my daughters engineering principles, circuit design and analysis, sensors, C++ and the rest and I picked up ESP32-WROOM-32D DevKitC v4 boards for daddy to play with. I cannot believe everything these chips do today. I'll have to really study the logic analyzer more in depth and learn how to get good at it. If you make any more I'm in the first row watching right away. Cheers, Liked, Subscribed.
Haha, I started with a PIC micro-controller in my electrical engineering undergrad 15 years back too! www.flickr.com/photos/sweska/109635690/ I guess we are from the same era :) Totally agree that the bar for entry has been lowered today than how we got started. My daughter is too young, but thanks for the list of inspirations. When she's old enough I hope she will also get to learn this cool stuff in a more fun way than we did.
@@sayanee Mine are 6 and 7. They don't knew they are learning all this advanced stuff they are just having fun doing different learning projects with dad. The bright flashing lights, noise making stuff etc that is what catches them, less so the more technical advanced aspects. If I see in losing them I move it back to the fun things that capture their attention. No material science, band gaps, electron shells and energy states or anything more or less life that just hey let's build this and then ask hey what else could we use this for in real life so they start dreaming up applications and hey girls maybe if we build this and everyone wants one we could make lots of money and be able to get lots of toys, typical wide eye excited kids let their imaginations go crazy expanding on possibilities. They may get hooked 😊 at night they say goodnight to us and the cats and then to Mr. Arduino on the way up to bed. Too cute. The culmination of simple lights and buttons and piezo is recreating the Simon game from the late 70s and 80s. Being kids they really liked that.
@@pd8559 "They don't knew they are learning all this advanced stuff they are just having fun doing different learning projects with dad." #parentinggoal :) Thanks for sharing!
Jlink needs to know the supplyvoltage of the Target processor to make sure the voltagelevels of SWDIO and SWDCLK will not damage the target. This is done by providing VRef FROM the Target TO the JLink programmer. So VRef is an Input pin on JLink. Connect Vref to the supplyvoltage of the target, in your case 1V6. There wont be any SWD data and controlsignals on the pins if you leave VRef open and so nothing happens: JLink cant detect the target, it cant flash the memory and it cant verify.
I know this video is a few years old, but I'm also looking to do this for a project I'm working on. Does the "crystal-less" build set the internal clock to 48MHz or is it at some other speed? I
Hi, I have recently got a custom PCB designed with the STM32 blue pill core (STM32F103C8T6). I know it's possible to install Arduino IDE with the blue pill board, but how to install it with a custom PCB? What hardware would I need. Is having a ST link v2 enough? My custom PCB has a USB and SWD pins set aside, along with Reset. Any links also would be appreciated.
Appreciate yours clear presentation very much. I would like to ask if it possible to flashing the SAMD21G18 bootloader using the J-Link EDU as well (I'm not experienced with boot loading) .
Yes!! And I just tried with the J-Link Edu Mini on my current project: hutscape.com/oak/examples/bootloader I have to admit that bootloading is difficult for me as well :( Somehow it worked after I left Vtref unconnected on the SWD pin 🤷🏻♀
I don't know why these chip manufacturers don't sell chips with built-in bootloader. Its so much headache sometimes especially if you are building your custom pcb with those MCU chips. However, STM32 chips come with builtin bootloader, don't they? Also, I never knew how the MCU would function without an external oscillator. I would just read in the datasheet that it has an internal oscillator but never knew how to use it. Thankyou.
8:58 I don't think you can the VID and PID. For example, if you search for "2341" on this list here www.linux-usb.org/usb.ids, it will point to Arduino SA. For the board name, you can change it in one of the source files here in Step 4 and 5: hutscape.com/pine/examples/arduino-bootloader-samd21g#create-the-bootloader-file Hope that helps!
Uh, that's because my circuit does not include a crystal and I don't need it for my functionality. If you need the crystal, please include it and remove the crystalless option. Check 16.6.2 External Multipurpose Crystal Oscillator (XOSC) Operation of the datasheet for more information: cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/Atmel-42181-SAM-D21_Datasheet.pdf
Might be a silly question, but regarding the target voltage, why don't you just power the board externally shorting the grounds so the edu mini see's 3.3v?
I vaguely remember that I did try this, but no success 😑 I'm going to try again soon for my next project! And this time both the PCB as well as the SWD are of 3.3V. So hopefully, one less barrier.
Thanks again, your videos are really helpful. I'm moving from Arduino IDE to nRF Connect VS Code, so I found that I need this J-Link programmer for it. But one thing wasn't clear to me is does this J-link is enough to program Adafruit Bluefruit nRF52832 module directly or do I need nRF SDK also?
I have never done that, sorry! Flashing the bootloader can be so frustrating for each type of microcontroller and platform. Could you try posting your question on the Nordic Semiconductor forums? This is what I would also do: devzone.nordicsemi.com/ I hope you figure it out!
Hi mate! Thanks for the video and information. I'm developing a own Arduino board based on ATSAMD21E18 and I want to know what is the equivalent command on windows of your "make" command.
The details of my simple "make" command can be taken from the Makefile for a simple blinky for samd21g: github.com/hutscape/hutscape.github.io/blob/master/_tutorials/blinky-samd21g/Makefile It consists of "make lint" with cpplint, which you might want to omit if you are not already using cpplint for your other C/C++ projects. For windows, I think you can use the Python pip to install: pypi.org/project/cpplint/ The command "make all" and "make flash" consist of arduino-cli. You can download the Windows version of arduino-cli here: arduino.github.io/arduino-cli/latest/installation/#download. The command "make clean" is simply removing the build folder. I have no chance to use it on the Windows, but I hope this gives you some clue!
Unfortunately you published your video after I also already bought a J-Link EDU Mini! No success in programming my ATSAMD21E18A with it yet - and I'm running at 3.3V. Not sure what's going on! The micro doesn't seem to boot properly so I'm guessing it may be something to do with the BOOTPROT fuse bits? You didn' mention fuse bits in your video, though.
@@wimdezwijger7023 well, I am using the J-link, Atmel studio and the Seeeduino Xiao bootloader. everything seems OK, the file Is uploaded and the upload Is verified but the custom made assembly does not boot as the original Xiao starts... No LEDs are blinking, nor the Xiao is visible for the Arduino IDE. No COM ports are visible... All lines are connected, including the reset and 3V3 (to Vref). *** Just to reply to myself... I did it with the same setup. The issue was in missing the GND... I succeeded to upload bootloader with j-link edu.
Nice video ! I am currently designing a custom board based on SAMD21 and I'd like to flash in the bootloader of the Arduino Zero. But does that mean I need to have exactly the same pinout as the Arduino Zero ? Thanks for your help !
If you want to only find out what pins are required for flashing the bootloader, then only 01:54 power, ground, reset, LEDs, SWD pins are required. Arduino Zero or other dev boards have many other pinouts based on other features they might have on board. You need to extract out the ones you require. Do a cross-check with other open schematics with SAMD21 dev boards as I show in 01:54 as well.
Tried the ST-link OCD/GDB route myself and it refuses to upload anything on the board. Don't waste time trying. I end up getting me a Jlink mini like yours. Debugging with it is so much easier than using "printf" to the serial console.
Same SAMD21G like yours but a DEV board I got from Seeedstudio (www.seeedstudio.com/Wio-Lite-W600-p-4155.html). I tried to use the built-in ST-link debugger from an old STM32Discovery board I have.
Really enjoying your videos.
These are the videos I wish were there before I spent days banging my head on the wall to learn this stuff :D
Have you actually created a core / board definition for your custom board?
We have a ton of documentation about it :)
also, you should convert an ST-Link into a Black Magic Probe, because we support that programmer in the CLI via openocd
here's a link about it microcontrollerelectronics.com/how-to-convert-an-stm32f103c8t6-into-a-black-magic-probe/
@@ubidefeo Oh nice!! That's exactly what I need. Custom board!
And thanks for some lead into using ST-Link. I have the ST-Link V2 and the STM32 Discovery Board with ST-Link. I'll try the Black Magic probe option.
@@sayanee hi Sayanee, do we really need to Rebuild the .bin even if using default settings? Can i just use the .bin file from repo straight away?
Please make video about creating custom board!!
@@bhargavmistry1274 Uh! Indeed the repository does have a *.bin file github.com/arduino/ArduinoCore-samd/tree/master/bootloaders/zero. Well, upload it and see if it works for you. I always like to generate these files as I can know how they were built even if it's the default. Personal preference :)
Custom board is definitely in for a future video 🙏🏼
great! most useful. I tried J-Link EDU Mini to write SAMD21 one year ago. It was successful. Though I forgot everything now.
Your videos are truly some of the best instruction available on these topics. Thank you for all of your hard work!
I really love your videos, I got out of electronics back when PIC controllers were a thing and you had to imagine in your head what PWM signals looked like as no one could afford much tools or technology in general. Now I am amazed with your Logic Analyzer video and videos like this one how easy it has become for people today. Wish this was around when I was a kid I might have gone in the engineering side, for now I'll have to think of projects for myself and build my own gear to make it happen. Just picked up Arduino to teach my daughters engineering principles, circuit design and analysis, sensors, C++ and the rest and I picked up ESP32-WROOM-32D DevKitC v4 boards for daddy to play with. I cannot believe everything these chips do today. I'll have to really study the logic analyzer more in depth and learn how to get good at it. If you make any more I'm in the first row watching right away. Cheers, Liked, Subscribed.
Haha, I started with a PIC micro-controller in my electrical engineering undergrad 15 years back too! www.flickr.com/photos/sweska/109635690/ I guess we are from the same era :)
Totally agree that the bar for entry has been lowered today than how we got started. My daughter is too young, but thanks for the list of inspirations. When she's old enough I hope she will also get to learn this cool stuff in a more fun way than we did.
@@sayanee Mine are 6 and 7. They don't knew they are learning all this advanced stuff they are just having fun doing different learning projects with dad. The bright flashing lights, noise making stuff etc that is what catches them, less so the more technical advanced aspects. If I see in losing them I move it back to the fun things that capture their attention. No material science, band gaps, electron shells and energy states or anything more or less life that just hey let's build this and then ask hey what else could we use this for in real life so they start dreaming up applications and hey girls maybe if we build this and everyone wants one we could make lots of money and be able to get lots of toys, typical wide eye excited kids let their imaginations go crazy expanding on possibilities. They may get hooked 😊 at night they say goodnight to us and the cats and then to Mr. Arduino on the way up to bed. Too cute. The culmination of simple lights and buttons and piezo is recreating the Simon game from the late 70s and 80s. Being kids they really liked that.
@@pd8559 "They don't knew they are learning all this advanced stuff they are just having fun doing different learning projects with dad." #parentinggoal :) Thanks for sharing!
This video is fantastic ,no magic tech mumbo jumbo just how to accomplish what is needed to completed the task.
Jlink needs to know the supplyvoltage of the Target processor to make sure the voltagelevels of SWDIO and SWDCLK will not damage the target. This is done by providing VRef FROM the Target TO the JLink programmer. So VRef is an Input pin on JLink. Connect Vref to the supplyvoltage of the target, in your case 1V6. There wont be any SWD data and controlsignals on the pins if you leave VRef open and so nothing happens: JLink cant detect the target, it cant flash the memory and it cant verify.
Thanks so much for posting this! Following your video I was able to bring a board back from the dead :D
Great video, thanks for sharing
Very good info, thanks! I ended up on that same stack overflow page this morning :-\
I know this video is a few years old, but I'm also looking to do this for a project I'm working on. Does the "crystal-less" build set the internal clock to 48MHz or is it at some other speed? I
Hello, I see this error whenever i try to connect
ERROR: Failed to connect.
Could not establish a connection to target.
- ERROR: Connect failed
Excellent. Very well presented and explained.
Thankyou mam very much I was really struggling with bootloaders ..this helped me to sort my doubts, ..your videos are always very informative 😃😃😃
Great video! Very well done and thanks.
Hi,
I have recently got a custom PCB designed with the STM32 blue pill core (STM32F103C8T6). I know it's possible to install Arduino IDE with the blue pill board, but how to install it with a custom PCB?
What hardware would I need. Is having a ST link v2 enough? My custom PCB has a USB and SWD pins set aside, along with Reset.
Any links also would be appreciated.
Is it enough to use swdio, swdclk, gnd, vdd
leaving the reset unconnected?
Will the jlink be able to program the samd21 in that case?
Seems mention the edu mini. Why it cannot be used not mentioned.
Appreciate yours clear presentation very much. I would like to ask if it possible to flashing the SAMD21G18 bootloader using the J-Link EDU as well (I'm not experienced with boot loading) .
Yes!! And I just tried with the J-Link Edu Mini on my current project: hutscape.com/oak/examples/bootloader
I have to admit that bootloading is difficult for me as well :( Somehow it worked after I left Vtref unconnected on the SWD pin 🤷🏻♀
@@sayanee Thank you very much. I'll follow your guidlines . Appreciated.
Thank you for this video it helped me alot
thank you for the great content, but what should i edit for a custom PCB?
Level Shifter for edulite??
Hello lady how to readback bootloader with jlink segger
I have the less expensive jlink-edu mini (
Yes!!! I tried the J-Link Edu Mini for my current PCB too :)
I don't know why these chip manufacturers don't sell chips with built-in bootloader. Its so much headache sometimes especially if you are building your custom pcb with those MCU chips. However, STM32 chips come with builtin bootloader, don't they?
Also, I never knew how the MCU would function without an external oscillator. I would just read in the datasheet that it has an internal oscillator but never knew how to use it. Thankyou.
Great video! How do you change VID, PID and board name to your custom one?
8:58 I don't think you can the VID and PID. For example, if you search for "2341" on this list here www.linux-usb.org/usb.ids, it will point to Arduino SA.
For the board name, you can change it in one of the source files here in Step 4 and 5: hutscape.com/pine/examples/arduino-bootloader-samd21g#create-the-bootloader-file
Hope that helps!
Hi great video! But why was the "D-crystalless" part added in the code. Can you elaborate a bit?
Uh, that's because my circuit does not include a crystal and I don't need it for my functionality. If you need the crystal, please include it and remove the crystalless option.
Check 16.6.2 External Multipurpose Crystal Oscillator (XOSC) Operation of the datasheet for more information: cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/Atmel-42181-SAM-D21_Datasheet.pdf
Can we run Arduino IDE and program codes(.ino files) as usual on the custom board as we would with an Arduino board by doing this?
Yep! Absolutely. I have done it a few times and wrote own the steps: hutscape.com/oak/code/custom-arduino
@@sayanee thank you. Please let me know if you plan on making a video regarding the same
Might be a silly question, but regarding the target voltage, why don't you just power the board externally shorting the grounds so the edu mini see's 3.3v?
I vaguely remember that I did try this, but no success 😑
I'm going to try again soon for my next project! And this time both the PCB as well as the SWD are of 3.3V. So hopefully, one less barrier.
Thanks again, your videos are really helpful.
I'm moving from Arduino IDE to nRF Connect VS Code, so I found that I need this J-Link programmer for it. But one thing wasn't clear to me is does this J-link is enough to program Adafruit Bluefruit nRF52832 module directly or do I need nRF SDK also?
I have never done that, sorry!
Flashing the bootloader can be so frustrating for each type of microcontroller and platform. Could you try posting your question on the Nordic Semiconductor forums? This is what I would also do: devzone.nordicsemi.com/
I hope you figure it out!
@@sayanee Got it, they said it does works directly. Need to solder SWD Connector on the module and use J-Link Programmer directly.
Hi mate! Thanks for the video and information. I'm developing a own Arduino board based on ATSAMD21E18 and I want to know what is the equivalent command on windows of your "make" command.
The details of my simple "make" command can be taken from the Makefile for a simple blinky for samd21g: github.com/hutscape/hutscape.github.io/blob/master/_tutorials/blinky-samd21g/Makefile
It consists of "make lint" with cpplint, which you might want to omit if you are not already using cpplint for your other C/C++ projects. For windows, I think you can use the Python pip to install: pypi.org/project/cpplint/
The command "make all" and "make flash" consist of arduino-cli. You can download the Windows version of arduino-cli here: arduino.github.io/arduino-cli/latest/installation/#download.
The command "make clean" is simply removing the build folder.
I have no chance to use it on the Windows, but I hope this gives you some clue!
Unfortunately you published your video after I also already bought a J-Link EDU Mini! No success in programming my ATSAMD21E18A with it yet - and I'm running at 3.3V. Not sure what's going on! The micro doesn't seem to boot properly so I'm guessing it may be something to do with the BOOTPROT fuse bits? You didn' mention fuse bits in your video, though.
Make sure to connect VRef to target supplyvoltage of 3v3
@@wimdezwijger7023 well, I am using the J-link, Atmel studio and the Seeeduino Xiao bootloader. everything seems OK, the file Is uploaded and the upload Is verified but the custom made assembly does not boot as the original Xiao starts... No LEDs are blinking, nor the Xiao is visible for the Arduino IDE. No COM ports are visible... All lines are connected, including the reset and 3V3 (to Vref).
*** Just to reply to myself... I did it with the same setup. The issue was in missing the GND... I succeeded to upload bootloader with j-link edu.
Nice video ! I am currently designing a custom board based on SAMD21 and I'd like to flash in the bootloader of the Arduino Zero. But does that mean I need to have exactly the same pinout as the Arduino Zero ? Thanks for your help !
If you want to only find out what pins are required for flashing the bootloader, then only 01:54 power, ground, reset, LEDs, SWD pins are required. Arduino Zero or other dev boards have many other pinouts based on other features they might have on board. You need to extract out the ones you require.
Do a cross-check with other open schematics with SAMD21 dev boards as I show in 01:54 as well.
Hello lady pls make video on mm32spin27pf how to flash
super thank u very much, no my VTref is not 0.00V anymore!
Great!, thanks a lot
Great video. Well done and thanks a lot. I am going to test how to burn arduino bootloader to atsamd21. Best Regards..
Great!! I like it
This segger J-Link, the _black box_ is fake. 5:24
thank you
Tried the ST-link OCD/GDB route myself and it refuses to upload anything on the board. Don't waste time trying. I end up getting me a Jlink mini like yours. Debugging with it is so much easier than using "printf" to the serial console.
Oh nice! Thanks for sharing. Which mcu did you try with ST-Link?
Same SAMD21G like yours but a DEV board I got from Seeedstudio (www.seeedstudio.com/Wio-Lite-W600-p-4155.html). I tried to use the built-in ST-link debugger from an old STM32Discovery board I have.
Teşekkürler
2:06 I really taught my screen was dirty.
Haha!! I guess it's the video rendering upon export. It's so faded that I couldn't notice it at first.
wow very detailed , subscribe
Great to see, bautiful woman inrterested of electronics, very rare :)
You should use a Windows computer and your videos will get more traction.
Ya what even is a Mac?