Some pins not usable when using ST-Link ?

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

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

Postby 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: 722
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

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

Postby 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: 945
Joined: Mon Apr 27, 2015 12:12 pm

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

Postby 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: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Postby 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: 722
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

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

Postby 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: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Postby 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: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Postby 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.


Return to “STLink”

Who is online

Users browsing this forum: No registered users and 1 guest