cancel
Showing results for 
Search instead for 
Did you mean: 

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

iheb
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

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.

View solution in original post

1 REPLY 1
PatrickF
ST Employee

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.