Some pins not usable when using ST-Link ?

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

Re: Some pins not usable when using ST-Link ?

Post by 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.
I agree. If someone uploads via bootloader, I cant see why they need the SWD pins enabled.

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

stevestrong
Posts: 1604
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Some pins not usable when using ST-Link ?

Post by stevestrong » Tue Jan 17, 2017 4:42 pm

RogerClark wrote:Perhaps I should change this back to the way it was.
Roger, I would be grateful.

On the other hand, when using STlink, enabling SWD should be done with the parameter "AFIO_DEBUG_SW_ONLY", and not with "AFIO_DEBUG_FULL_SWJ", since only SWD connector is used, not full JTAG. This way PB3/PB4 would be still available as freely usable pins in case of enabled SWD.

victor_pv
Posts: 1648
Joined: Mon Apr 27, 2015 12:12 pm

Re: Some pins not usable when using ST-Link ?

Post by victor_pv » Tue Jan 17, 2017 5:32 pm

stevestrong wrote:
RogerClark wrote:Perhaps I should change this back to the way it was.
Roger, I would be grateful.

On the other hand, when using STlink, enabling SWD should be done with the parameter "AFIO_DEBUG_SW_ONLY", and not with "AFIO_DEBUG_FULL_SWJ", since only SWD connector is used, not full JTAG. This way PB3/PB4 would be still available as freely usable pins in case of enabled SWD.
Steve, would you mind adding that information to a wiki page? much easier to find than having to dig in the forums. If you could add the list of pins that get affected by each option that would be great.

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

Re: Some pins not usable when using ST-Link ?

Post by 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
Posts: 1604
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Some pins not usable when using ST-Link ?

Post by 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.
I agree. If someone uploads via bootloader, I cant see why they need the SWD pins enabled.

Perhaps I should change this back to the way it was.
I would recommend removing the define "-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1" from line 201 of boards.txt.

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

Re: Some pins not usable when using ST-Link ?

Post by 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.

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

Re: Some pins not usable when using ST-Link ?

Post by 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.
I agree. If someone uploads via bootloader, I cant see why they need the SWD pins enabled.

Perhaps I should change this back to the way it was.
I would recommend removing the define "-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1" from line 201 of boards.txt.
Should be OK now

I've disabled the SWD pins on all board types when uploading via DFU (bootloader), as its best to keep things consistent.

unuldinei
Posts: 11
Joined: Tue Jul 21, 2015 8:32 pm
Location: Bucuresti RO
Contact:

Re: Some pins not usable when using ST-Link ?

Post by 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...

Code: Select all

afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY);
and not to jam the usb_serial.cpp file to get PA11 and PA12

Code: Select all

void USBSerial::begin(void) {
#if BOARD_HAVE_SERIALUSB
   // usb_cdcacm_enable(BOARD_USB_DISC_DEV, BOARD_USB_DISC_BIT);
   // usb_cdcacm_set_hooks(USB_CDCACM_HOOK_RX, rxHook);
   // usb_cdcacm_set_hooks(USB_CDCACM_HOOK_IFACE_SETUP, ifaceSetupHook);
#endif
}
Thanks for everything on this forum!

Post Reply