Spark Logic

Some pins not usable when using ST-Link ?

rolo644u Thu May 26, 2016 4:59 pm

I’m experiencing a strange effect when using ST-LINK as upload tool. Some I/O pins are not usable (PB3, PB4, PA15, PA12, PA11). I test this with a simple blink sketch, using the standard digitalWrite command. All other pins work fine. Same on all my STM boards (2x Maple Mini and 2x Blue Pill).
Using the bootloader as upload tool the missing pins work, except PA12 and PA11, these are now in use for the USB so left alone.
I can’t get my head arround it, why is this ? I was thinking that the same code is flashed in both methods, only using a different transport method.
Are these pins reserved for something else or am I missing something basic info here ?

Replies

Rick Kimball Mon Jan 16, 2017 5:54 pm

Which board are you using?

stevestrong Mon Jan 16, 2017 6:43 pm

I really don’t see why the used board would be here relevant.
But anyway, I am using alternatively Maple Mini clone or Blue Pill. I am using the pill alternatively with DFU (if I need 5V and USB serial) or STlink if I want to debug, very rarely.

Rick Kimball Mon Jan 16, 2017 6:48 pm

stevestrong wrote:I don’t see why the used board would be here relevant.
But anyway, I am using alternatively Maple Mini clone or Blue Pill. I am using the pill alternatively with DFU (if I need 5V and USB serial) or STlink if I want to debug, very rarely.

stevestrong Mon Jan 16, 2017 7:02 pm

Yes, I am using PB2 (BOOT1) together with PB0..7 as data pins for 8 bit parallel display interface, the problematic case was PB4 which didn’t toggle because of enabled debug interface.
And I wouldn’t wonder if someone would use PA0/PA8..15 as data pins instead. I mean, why not, if it is available on the board? Even if it would cancel the serial 1 and serial USB functionality, on which one could again discuss infinitely…
Sorry, Rick, but I still don’t see what do you want to say, why the used board would be here relevant.

Rick Kimball Mon Jan 16, 2017 7:06 pm

stevestrong wrote:Sorry, Rick, but I still don’t see what do you want to say, why the used board would be here relevant.

stevestrong Mon Jan 16, 2017 7:07 pm

OK, so please let know what is the “majority way” to use a board, where is specified.
Especially, where is the user warned that he cannot to use PB4 because of the enabled JTAG (debug) interface, which seems to have priority over DFU/serial USB. :?
And I wouldn’t mind to (maybe) enable JTAG pins (where PB4 is involved), if the pill would have a JTAG interface connector…
But the pill only has mounted SWD interface connector, which would only involve PA13/14, but not PB3/PB4 at all.

Rick Kimball Mon Jan 16, 2017 7:23 pm

stevestrong wrote:OK, so please let know what is the “majority way”, where is specified.

martinayotte Mon Jan 16, 2017 9:12 pm

stevestrong wrote:But the pill only has mounted SWD interface connector, which would only involve PA13/14, but not PB3/PB4 at all.

stevestrong Tue Jan 17, 2017 7:58 am

Yes, I am aware of this.
Still, when using DFU upload method, the full JTAG debug pins are assigned for debugging even if only SWD connector is on board, and I don’t really see why would be this useful for “majority users”, someone can please explain.

RogerClark Tue Jan 17, 2017 10:01 am

stevestrong wrote:Yes, I am aware of this.
Still, when using DFU upload method, the full JTAG debug pins are assigned for debugging even if only SWD connector is on board, and I don’t really see why would be this useful for “majority users”, someone can please explain.

stevestrong Tue Jan 17, 2017 4:42 pm

RogerClark wrote:Perhaps I should change this back to the way it was.

victor_pv Tue Jan 17, 2017 5:32 pm

stevestrong wrote:RogerClark wrote:Perhaps I should change this back to the way it was.

RogerClark Tue Jan 17, 2017 8:33 pm

@stevstrong

Ok. I will take a look at the code.

I have never actually changed the C code that makes the SWD pins available as GPIO. I only changed the Boards.txt settings.

I presume that the C code was either written by Leaflabs when they originally wrote the core.

stevestrong Sat Feb 25, 2017 5:45 pm

Roger, just a gently remainder in order to do something in this direction, if you still consider it makes sense:

RogerClark wrote:stevestrong wrote:Yes, I am aware of this.
Still, when using DFU upload method, the full JTAG debug pins are assigned for debugging even if only SWD connector is on board, and I don’t really see why would be this useful for “majority users”, someone can please explain.

RogerClark Sat Feb 25, 2017 7:59 pm

Thanks for the reminder. I may be able just to revert the commit which changed this, or just pull the previous commit and copy the boards.txt into the master / head, as I dont think anything else has changed in that file.

RogerClark Sun Feb 26, 2017 2:30 am

stevestrong wrote:Roger, just a gently remainder in order to do something in this direction, if you still consider it makes sense:

RogerClark wrote:stevestrong wrote:Yes, I am aware of this.
Still, when using DFU upload method, the full JTAG debug pins are assigned for debugging even if only SWD connector is on board, and I don’t really see why would be this useful for “majority users”, someone can please explain.

unuldinei Sat May 06, 2017 1:06 pm

Hi, my reasons for canceled DFU are :
– In windows 8.1 x64 DFU is not work very well, is a pain;
– I want solder the 7 segments LCD directly and ugly to the BluePill pcb, see the nice foto on my desk, :);
Image
russian photo hosting site
– running RTC from board and LCD what a easy platform for many applications!…

So please, please… I need the PA11 and PA12 in GPIO mode :( in a simple way like JTAG disable…
afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY);

Sign in to reply