BPill and Stlink2

Post Reply
User avatar
Pito
Posts: 1593
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

BPill and Stlink2

Post by Pito » Fri Aug 12, 2016 2:55 pm

I have got the stlink2 clone (latest fw and also older ones) and with BPill I see following:
1. when I try to connect stlink to BP which includes bootloader or other sw flashed in, it does not connect (cannot find the target), manual reset must be provided and then it finds BP
2. when I clean the flash it finds BP straight
3. when I download bootloader or sw (ie from Cube+Keil) in the BP then goto 1 :)
4. also debugging in ie Keil via stlink hangs usually after few steps.

Am I doing something wrong or it is a normal behavior with these cheapoes?
Pukao Hats Cleaning Services Ltd.

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

Re: BPill and Stlink2

Post by RogerClark » Fri Aug 12, 2016 10:13 pm

If there was an Arduino sketch in the BluePill which you last uploaded via the bootloader, the SWD pins are reconfigured in the sketch to be GPIO

So you have to use Connect Under Reset with the STLInk uploader, and hold the BP in reset manually until you tell STLink to upload, them release reset.

Or pull Boot0 high.

However once you have uploaded new code, that does not reassign the SWD pins to GPIO you should be able to upload any time without Boot0 high or using Connect under reset

Try uploading an Arduino sketch via STLink as this changes the code in the sketch so that SWD stays as SWD

Post Reply