Most elegant way to upload ?

Post Reply
madias
Posts: 813
Joined: Mon Apr 27, 2015 11:26 am
Location: Vienna, Austria

Most elegant way to upload ?

Post by madias » Mon Nov 09, 2015 10:04 pm

Ok, I tried many upload methods out with all the advantages and disadvantages: (done on OSX)
1) Bootloader: Most elegant, but if it stuck holding reset and or perp. bootloader (total problematic in finished devices because you loose a pin for button, next extras out.. plus random problems with my macbook (needs restarts))
2) Serial: Really no benefit compared to ST-Link (Boot 1 =GND, Boot 0=3VCC...manual RST, slow)
3) ST-Link: Most speed, but you need at least a Boot0 pin out (or switch) and a RST button/cable (if you wont turn every time the finished device on/off)
So my question is, is there a more elegant way of uploading? (I have two chepos ST-Link clones at home bought for BMP, so does BMP work something better?) So I would see an uploader with automatic settings, like putting boot0 high/low, gives RST.....

User avatar
RogerClark
Posts: 7134
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Most elegant way to upload ?

Post by RogerClark » Mon Nov 09, 2015 10:16 pm

Matthias,

Have you seen the work that @jcw has been doing to make a new Serial based bootloader. I don't know if this resolves any of your issues.

Re: Stlink
ST-Link: Most speed, but you need at least a Boot0 pin out (or switch) and a RST button/cable (if you wont turn every time the finished device on/off)
You only need to have boot0 low if the SWD pins are disabled (they are by default unless the compile is STLINK), but if you have a reset cable attached, it should be possible to connect under reset, so it doesnt matter whether the SWD pins are enabled in the code that is running


I'm using BMP some of the time, but I have just had to modify it, because by default it seems to halt the processor when I plug in for the first time (cold boot), after I upload it runs, and is OK until I unplug or power cycle the PC

But I fixed this, at least for my nRF51 target board

madias
Posts: 813
Joined: Mon Apr 27, 2015 11:26 am
Location: Vienna, Austria

Re: Most elegant way to upload ?

Post by madias » Tue Nov 10, 2015 11:17 pm

Thank you Roger, I forget, that I'd the bootloader on the device, so it was only one time necessary to put boot0 high. So ST-Link is now my first choice!
Bootloaders are not a good thing for my macbook (I wrote my symptoms more than one, but I believe I'm the only one with this issues - to much hardware/driver/os specific to bug anyone with it :) )

jcw
Posts: 171
Joined: Mon Oct 26, 2015 8:16 am

Re: Most elegant way to upload ?

Post by jcw » Sat Nov 14, 2015 9:02 am

Speaking of ST-Link and BMP - would it be possible to flash the BMP code on one of those ST-Link sticks?
The proper question is probably: is there a variant already available with the matching pin assignments?

One issue might be the choice of pins to bring out (only 4 available on the header:

* 2x SWD + RX/TX, or
* 2x SWD + RESET, or
* 2x SWD + RESET + RX (i.e. debug-serial-out-only, but with support for resetting the target)

I've got a few of those sticks here, wouldn't mind trying this. Have not yet dealt with BMP custom builds, though.

User avatar
RogerClark
Posts: 7134
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Most elegant way to upload ?

Post by RogerClark » Sat Nov 14, 2015 10:00 am

There is already a build target (PROBE_HOST) for those STLink dongles.

But you would need to solder directly to the MCU for the UART and reset etc.

I think you would be better off buying more of those small F103T boards

jcw
Posts: 171
Joined: Mon Oct 26, 2015 8:16 am

Re: Most elegant way to upload ?

Post by jcw » Sat Nov 14, 2015 10:10 am

Aha - do you know which target to use for this? I don't see which one in the platforms/ folder.

As for soldering: SWD already done, I'm just trying to figure out the pins ... 2nd from left is GND, 4th is +3.3V.
Attachments
DSC_5234.jpg
DSC_5234.jpg (52.59 KiB) Viewed 894 times

jcw
Posts: 171
Joined: Mon Oct 26, 2015 8:16 am

Re: Most elegant way to upload ?

Post by jcw » Sat Nov 14, 2015 10:25 am

Hrm... tried both ways with SWDIO and SWCLK. Looks like SWD is disabled. Not surprising.
But that does complicate things. Would also have to break out BOOT0 or RESET.
Has anyone tried this before? (it's hard to google for ST-Link, too many irrelevant hits)

User avatar
RogerClark
Posts: 7134
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Most elegant way to upload ?

Post by RogerClark » Sat Nov 14, 2015 10:44 am

I think the trick is to plug it in just at the right time.

The Windows STLink program has about a 1/2 sec timeout, and its possible to plug it in and press the connect button just at the right time to get it to connect.

I remember reflashing the bootloader onto one of those, and it can be done.

jcw
Posts: 171
Joined: Mon Oct 26, 2015 8:16 am

Re: Most elegant way to upload ?

Post by jcw » Sat Nov 14, 2015 11:24 am

Ok, I'll try this. A boot loader would be great on this: would give us 1 LED and 4 I/O pins, for arbitrary sketches.

User avatar
ahull
Posts: 1627
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Most elegant way to upload ?

Post by ahull » Sat Nov 14, 2015 11:30 am

That reminds me.... I started doing something similar a couple of months back, but various other more important things put a halt to it.

Image

I'll need to dig it out of my pile, and complete the job.
- Andy Hull -

Post Reply