Loading a sketch from the Arduino IDE into a Blue Pill or similar is confusing as all get out.?
toggle quoted message
Show quoted text
There are at least three totally different ways to do it, and the various "how I done it" webpages focus on only one of them, usually without mentioning which one.? Probably cuz the author doesn't know. Rudolf's webpage describes all three, I've included my notes below (in the reverse order of Rudolf's writeup).? The three methods are: 1) Use the SWD pins. Most ARM processors have some dedicated hardware baked into the chip for the SWD debugger. Requires a special cable assembly that plugs into a USB port on your host computer to speak SWD: ? ?? I've never messed with it, but is likely the most featureful debugging method, if you are into features. 2) Use the UART debugger permanently burned into processor ROM by ST at the factory. ? ?? It's always present, is ROM not flash in that it can't be erased.? Probably supported by ST processors only. I prefer this method, as I find a UART easy and familiar and I already have the hardware: ? ?? A description of that cp2102? ?USB-to-UART adapter is in post 50027, there are plenty of other such devices.? If things don't work, can first debug that USB-to-UART adapter by tying TXD to RXD for loopback mode, and try talking to it from something like a VT100? terminal emulation program.? If anybody still knows what that is. 3)? Use the USB port that's implemented in the chip to talk to your PC host. This seems to be the method most people focus on.? But the processor does not have code baked in for using the USB port, you have to first download a special bootloader to flash using one of the other two methods. Or buy one with the USB bootloader already programmed into flash.? The processor has some "boot pins" that allow you to boot from either the baked in debugger of method two or from flash.? If booting from flash, it could be the bootloader of method 3, or it could go directly to your application code. The bootloader of method three inspects yet another pin to figure out if it should stick around and execute commands coming in on the chip's USB port, or jump off into your application code.? I've probably made a couple omissions or mistakes here, as I haven't used the ARM chips that much. But did succeed in using both method 2 and method 3 on the Blue Pill? (a Matrix reference, in case you were wondering). Jerry, KE7ER On Wed, May 23, 2018 at 07:00 am, W3JDR wrote:
Rudolf |