Skip to main content
iheb
Associate III
November 11, 2023
Solved

Route FMC default alternate function to an other accessible pin in Device tree

  • November 11, 2023
  • 1 reply
  • 1456 views

Dear ST community,
I am currently trying to install an 8bit 8080 LCD , and i figured out that it needs FMC $ to be set up in devicetree in order to interface with it using DRM in Linux. i have the following device tree pinctrl nodes setup 

 

	fmc_pins_mx: fmc_mx-0 {
		pins {
			pinmux = <STM32_PINMUX('D', 0, AF12)>, /* FMC_D2 */
					 <STM32_PINMUX('D', 1, AF12)>, /* FMC_D3 */
					 <STM32_PINMUX('D', 4, AF12)>, /* FMC_NOE */
					 <STM32_PINMUX('D', 5, AF12)>, /* FMC_NWE */
					 <STM32_PINMUX('D', 7, AF12)>, /* FMC_NE1 */
					 <STM32_PINMUX('D', 14, AF12)>, /* FMC_D0 */
					 <STM32_PINMUX('D', 15, AF12)>, /* FMC_D1 */
					 <STM32_PINMUX('E', 7, AF12)>, /* FMC_D4 */
					 <STM32_PINMUX('E', 8, AF12)>, /* FMC_D5 */
					 <STM32_PINMUX('E', 9, AF12)>, /* FMC_D6 */
					 <STM32_PINMUX('E', 10, AF12)>, /* FMC_D7 */
					 <STM32_PINMUX('F', 0, AF12)>, /* FMC_A0 */
					 <STM32_PINMUX('G', 9, AF12)>; /* FMC_NE2 */
			bias-disable;
			drive-push-pull;
			slew-rate = <1>;
		};
	};

	fmc_sleep_pins_mx: fmc_sleep_mx-0 {
		pins {
			pinmux = <STM32_PINMUX('D', 0, ANALOG)>, /* FMC_D2 */
					 <STM32_PINMUX('D', 1, ANALOG)>, /* FMC_D3 */
					 <STM32_PINMUX('D', 4, ANALOG)>, /* FMC_NOE */
					 <STM32_PINMUX('D', 5, ANALOG)>, /* FMC_NWE */
					 <STM32_PINMUX('D', 7, ANALOG)>, /* FMC_NE1 */
					 <STM32_PINMUX('D', 14, ANALOG)>, /* FMC_D0 */
					 <STM32_PINMUX('D', 15, ANALOG)>, /* FMC_D1 */
					 <STM32_PINMUX('E', 7, ANALOG)>, /* FMC_D4 */
					 <STM32_PINMUX('E', 8, ANALOG)>, /* FMC_D5 */
					 <STM32_PINMUX('E', 9, ANALOG)>, /* FMC_D6 */
					 <STM32_PINMUX('E', 10, ANALOG)>, /* FMC_D7 */
					 <STM32_PINMUX('F', 0, ANALOG)>, /* FMC_A0 */
					 <STM32_PINMUX('G', 9, ANALOG)>; /* FMC_NE2 */
		};
	};

my problem is that i have pins from d4 to d7 are not accessible in my board, i am writing you to ask if there is a way to change the pins on AF12 and point them out to an other accessible pins? 
(i have indeed tried cube-mx but it doesn't offer any other choice since this particular peripheral have no other alternate function options.)
Thank you

This topic has been closed for replies.
Best answer by PatrickF

HI @iheb ,

unfortunately, there is no other options to route pins elsewhere.
Maybe you could use D15-D8 and define the FMC in 16-bits and make uses of upper byte only (in pinmux too).  This will make D0-D7 not routed to any pins.
This is not available in CubeMx, pinmux section should be modified manually.

For SW point of view, might need to do tricky changes in the drivers (shift data and do 16-bits access), but maybe doable if you have no other options.

Regards.

1 reply

PatrickF
PatrickFBest answer
Technical Moderator
November 13, 2023

HI @iheb ,

unfortunately, there is no other options to route pins elsewhere.
Maybe you could use D15-D8 and define the FMC in 16-bits and make uses of upper byte only (in pinmux too).  This will make D0-D7 not routed to any pins.
This is not available in CubeMx, pinmux section should be modified manually.

For SW point of view, might need to do tricky changes in the drivers (shift data and do 16-bits access), but maybe doable if you have no other options.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.NEW ! Sidekick STM32 AI agent, see here