2017-10-23 03:53 AM
Is it OK to map the same alternate function to multiple pins?
I'm using an STM32F767 DFSDM module and I want to output the DFSDM clock both on PC2 and PD10 (for PCB routing reasons, outputting the clock on PC2 would route neatly with DFSDM channels 0 and 4; and likewise also outputting the same clock on PD10 would make routing easy for channels 1 and 2 on PB12 and PB14).
I have tried it in the firmware and it works (I can see the clock on the scope) but ST32CubeMX does not allow me to do this. It only seems to allow the choice of one pin for a particular function.
Is this 'legit'?
2017-10-23 06:58 AM
Hello,
You have an option in STM32CubeMX that highlights in blue the alternate pins when there are some available:
You should press the <ctrl> key and click the pin of interest on STM32CubeMX chip view, if any alternate pins available, they will be shown in blue.
You can check the specific alternate function assignments for each pin which are detailed in the datasheet, in the table (STM32F765xx, STM32F767xx, STM32F768Ax and STM32F769xx alternate function mapping)Best Regards
Imen
2017-10-23 07:04 AM
Hello Imen,
Yes, I know that some pins have alternative(s) and I can choose between them with <ctrl> click. But when I choose an alternative, the original choice is removed.
What I want is to assign the same function to more than one pin.
I assume this is possible - I suppose at the silicon level there are some multiplexers connected to each pin that route the internal peripheral I/O signal to one pin or another; I can't see any reason why the same internal signal could not be routed to multiple pins. But the ST32CubeMX does not seem to allow me to do this. (Admittedly, probably not many people would want to do this, although who knows...)
2017-10-23 09:02 AM
Imen,
the question was not *how* to set the same AF to multiple pins in CubeMX.
The question was, *what happens* if multiple pins are set to the very same AF, in any means.
JW
2018-02-08 08:53 AM
Hello
Gaspar.Laszlo
,Sorry for my late answer.
I understand your point and confirm that CubeMX does not allow to use a same AF on 2 different pins.
I think that your point is interested and need to be kept in mind. Can I suggest you to put this idea in
https://community.st.com/community/stm32-community/stm32-forum/blog/2017/12/19/2018-stm32-wish-list
?Thanks in advance.
Jeanne
2018-02-08 01:04 PM
A great question about the chips capability - whether the library supports it is another story.
On okder chips with fixed remapping schemes assignig alternate alternate functions to multiple pins is obviously not possible.
On newer chips. ......
2018-02-09 12:06 AM
Hello Jeanne,
Although CubeMX does not allow the same AF to be mapped to two different pins, the processor itself does not have any problem doing it. I can confirm that on the STM32F767 I am using I can output the DFSDM clock simultaneously both on pins PC2 (where it is AF6) and PD3 (where it is AF3).
What is the point? - you may ask. The answer is PCB layout.On rare occasions you may want to have the same signal on pins that are on opposite sides of the chip; if your layout is complicated already this will save you having to route a signal across the processor area.
(Dhenry - I don't know if the standard peripheral library support this, I don't use it.)
A side comment: I do like the STM32 processors, but I have to say one thing I find disappointing is the port mapping of peripherals. Functionality is not distributed evenly. There are 'popular pins', available to a large number of peripherals and 'useless pins' that can only be used as GPIO. If you want to make use of a lot of the peripherals (which I guess is what they are there for...) invariably you end up scratching your head how you are going to map the whole lot onto the pins. In that sense the Microchip PIC24F family is a joy to use as they allow almost any peripheral to be mapped to almost any pin (with some notable exceptions). OK, I understand, you need a large multiplexer on the silicon but still... At least some middle ground, please...
2018-02-09 01:30 AM
Hello Jeanne,
Thanks for your e-mail. I have added some comments on the forum.
Best regards,
Laszlo
2018-02-09 01:54 AM
Hello
Gaspar.Laszlo
,I am very interested in the example you gave with the STM32F767 where you use the DFSDM out for pins PC2 and PD3 (I tried but I can't map the signal DFSDM1_CKOUT to both PC2 and PD3).Can you please send me your ioc file in order that I see what you are talking about.?
BR. Jeanne
2018-02-09 02:11 AM
Hi Jeanne,
I can send you the ioc file (see attached) - but I’m a bit confused. The whole point is that STM32CubeMX does not allow you to map DFSDM1_CKOUT to both PC2 and PD3 but the processor can do it.
So if you want to see it in practice, you would need to see the project source code files – which you can have if you like.
(Actually I don’t use STM32CubeMX for code generation, it’s only purpose is a “sanity check�?, so that I can catch any mistakes. Neither do I use the STM peripheral libraries, I use my own.)
Best regards,
Laszlo
________________ Attachments : BBD303 with FPGA.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxuO&d=%2Fa%2F0X0000000b3K%2FBSmztwDx0imfCVy0W0oR9CtezZvreUZRdabNS2.xiSc&asPdf=false