Skip to content

Cannot use PG9 as digital pin with NUCLEO-H743ZI2 #1276

Closed
@pierremolinaro

Description

@pierremolinaro
  • OS: Mac OS X
  • Arduino IDE version: 1.8.13
  • STM32 core version: 1.9.0
  • Board Name: NUCLEO-H743ZI2

Describe the bug
I try to use PG9 as digital output :

  • pinMode (PG9, OUTPUT) ; in setup;
  • digitalWrite (PE9, HIGH) ; has no effect, pin is not a high level digital output.

Bug Fix
I think the bug is in the ~/Library/Arduino15/packages/STM32/hardware/stm32/1.9.0/variants/NUCLEO_H743ZI/variant.h file.

Line 174 is : #define NUM_DIGITAL_PINS 99, and line 164 is #define PG9 99. PG9 is the last pin, so NUM_DIGITAL_PINS should be equal to 100.

So changing the line 174 to #define NUM_DIGITAL_PINS 100 solves the bug.

Note
I think the line 176 #define NUM_DIGITAL_PINS 97 (for NUCLEO_H743ZI) should be also changed to #define NUM_DIGITAL_PINS 98, for the same reason : last pin is PG12 (#97).

Best regards,

Pierre Molinaro

Activity

added this to the 2.0.0 milestone on Jan 12, 2021
fpistm

fpistm commented on Jan 12, 2021

@fpistm
Member

Hi @pierremolinaro

you're right it should be 100.
This will be fixed with the #1091

pierremolinaro

pierremolinaro commented on Jan 12, 2021

@pierremolinaro
Author

Thank you very much. Note also that NUM_DIGITAL_PINS should be 98 for NUCLEO_H743ZI.

Best regards,

Pierre Molinaro

added a commit that references this issue on Feb 12, 2021
c225c81
added a commit that references this issue on Feb 17, 2021
7da49e0
added 2 commits that reference this issue on Mar 15, 2021
30e541c
ade0a1e
added a commit that references this issue on Mar 16, 2021
0b3a6ff
added 4 commits that reference this issue on Mar 22, 2021
33b8067
a0edfc5
9526f17
8ea306a

16 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Cannot use PG9 as digital pin with NUCLEO-H743ZI2 · Issue #1276 · stm32duino/Arduino_Core_STM32