SPI Query about PA4, real or a non-issue

External hardware connected to the STM32 board
Post Reply
zmemw16
Posts: 1674
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

SPI Query about PA4, real or a non-issue

Post by zmemw16 » Wed Aug 30, 2017 5:41 pm

thought better a new thread, so
the 'legacy' advice in my head says don't use pa4 as it 'has' / 'had' an issue, set as output and high, use another pin.
i'd call it playing safe.

whether it has or hasn't, i picked up from somewhere that it was an actual problem, istr that on avr when using a different pin for ss required the ss pin set as an output and high. maybe that's the source?
so is it an 'official st acknowledged problem or a non-issue?
srp

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

Re: SPI Query about PA4, real or a non-issue

Post by stevestrong » Wed Aug 30, 2017 6:36 pm

From my STM32-related experience so far I can tell that this is a non-issue.

When using SPI1 with SdFat or TFT lib, I always use PA4 as chip select, and never had any problem with that.
This of course involves that it is correctly set to output mode (in main loop or in the selected lib) before using it.

zmemw16
Posts: 1674
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: SPI Query about PA4, real or a non-issue

Post by zmemw16 » Wed Aug 30, 2017 8:13 pm

thoughts on how it came about ?
srp

racemaniac
Posts: 695
Joined: Sat Nov 07, 2015 9:09 am

Re: SPI Query about PA4, real or a non-issue

Post by racemaniac » Wed Aug 30, 2017 8:45 pm

iirc, it's if you use it via the SPI peripheral, it supports managing its own SS pin, but that is bugged. But if you declare it as a normal output, and just toggle it yourself, it's ofcourse no problem at all.

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

Re: SPI Query about PA4, real or a non-issue

Post by RogerClark » Wed Aug 30, 2017 9:18 pm

There used to be an issue with the SPI hardware overriding the control of PA4 as its designated as NSS

Changes were made to the core to attempt to overcome this, at least 6 months ago, but people were not sure whether the fix worked, as it is a workaround for a "feature" (bug) in the silicon.

However it sounds like the fix did work

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

Re: SPI Query about PA4, real or a non-issue

Post by victor_pv » Thu Aug 31, 2017 2:43 pm

Like Steve I have been using as software Chip Select managing is a any other pin without any problem, so it was working for me too.
There are some threads in the forum discussing about the hardware bug and the solution for more details, but the short answer is that seems to work just fine in the current core.

zmemw16
Posts: 1674
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: SPI Query about PA4, real or a non-issue

Post by zmemw16 » Thu Aug 31, 2017 4:46 pm

summary then
1. use as a gpio output and handle spi cs ourselves
2. is it then a hal issue when using the hal library calls ?
3. how do the stm32f4 generics handle spi cs ? are they written to handle spi cs itself as per 1 ?
4. how do the 'official cores' handle it ?
5. does the hardware section need sub-sections of libmaple and hal :lol:

stephen

Post Reply