Nucleo-144 stm32F767zi

Post Reply
jacob-rf
Posts: 2
Joined: Thu Nov 12, 2020 3:35 pm

Nucleo-144 stm32F767zi

Post by jacob-rf »

Arduino_Core_STM32 works great for the Nucleo-144 STMF767 board.
But portF pin 11 is not accessible in the code.
Same for Port E pin 1.

Following Cmd will not compile:
1: pinMode(PF11, OUTPUT); //works on all routed pins. but not PF11
2: GPIOF->CRH = 0x33333333; //works on maple boards
3: PORTF->CRH = 0x33333333; //Wont work
4: PORTA->regs->CRH = 0x33333333;; //wont work

Guess it is a bug

BR
Last edited by jacob-rf on Thu Nov 12, 2020 4:42 pm, edited 1 time in total.
mlundin
Posts: 94
Joined: Wed Nov 04, 2020 1:20 pm
Answers: 6
Location: Sweden

Re: stm32F767 Generic use

Post by mlundin »

The STM32F7xx processors doesnt have a CRH register. Pin mode is set using the MODER register, and eventually for alternate functions the AFRL and AFRH registers ( sometimes coded as AFR[0] and AFR[1] ) .
Read the GPIO section in the reference manual for the relevant GPIO registers.

So setting PF11 to output mode would be, 2 bits per pin and output is mode 1

Code: Select all

GPIOF->MODER &= ~0x00C00000; // clear mode for pin 11
GPIOF->MODER |=  0x00400000; // set pin 11 to mode 1
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: stm32F767 Generic use

Post by fpiSTM »

jacob-rf wrote: Thu Nov 12, 2020 3:51 pm
Following Cmd will not compile:
1: pinMode(PF11, OUTPUT); //works on all routed pins. but not PF11

Guess it is a bug
This is not a bug. PF11 is simply not defined in the variant.
jacob-rf
Posts: 2
Joined: Thu Nov 12, 2020 3:35 pm

Re: Nucleo-144 stm32F767zi

Post by jacob-rf »

fpiSTM: Why should it not be defined on purpose? I would like to use it..

mlundin: Thanks for the help it works now. I needed to add port speed and enable the clk for the port too.

Code: Select all

RCC->AHB1ENR |= RCC_AHB1ENR_GPIOFEN;//peripheral clock enable for PortF
GPIOF->MODER |=  0x00400000; // set pin 11 to mode 1
GPIOF->OSPEEDR |=  0x00C00000; //set pin 11 to high speed
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Nucleo-144 stm32F767zi

Post by fpiSTM »

jacob-rf wrote: Thu Nov 12, 2020 9:16 pm fpiSTM: Why should it not be defined on purpose? I would like to use it..
Well, the variant has been made by a contributor:
https://github.com/stm32duino/Arduino_C ... 2/pull/300

I've only review and made some clean up.

I know several variant does not have all pins defined, I'm currently working on a rework to ease generic variant addition and provide access to all pins.
This will be fixed thanks my rework. But as said this is not a bug as variant can be defined as you want. ;)
Post Reply

Return to “PR's bugs and enhancements”