linguini1 commented on code in PR #18397: URL: https://github.com/apache/nuttx/pull/18397#discussion_r2810010743
########## boards/arm/stm32h7/nucleo-h753zi/Kconfig: ########## @@ -0,0 +1,1285 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +menu "Board Clock Configuration" + +choice + prompt "HSE clock source" + default NUCLEO_H753ZI_HSE_8MHZ + help + Select the HSE clock source for the Nucleo-H753ZI board. + 8 MHz: ST-LINK MCO (default, no hardware modification) + 25 MHz: External crystal X3 (requires hardware modification) + +config NUCLEO_H753ZI_HSE_8MHZ + bool "8 MHz from ST-LINK MCO" + help + Default Nucleo-H753ZI configuration. + Uses 8 MHz clock from ST-LINK MCO output (PH0-OSC_IN). + Solder Bridge Configuration: + SB45=ON, SB44=OFF, SB46=OFF, SB3=OFF, SB4=OFF + This is the factory default - no hardware changes needed. + System clocks with 8 MHz HSE: + - SYSCLK: 400 MHz + - HCLK: 200 MHz + - APB1/2/3/4: 100 MHz + - FDCAN: 25 MHz (via PLL2Q) + +config NUCLEO_H753ZI_HSE_25MHZ + bool "25 MHz external crystal X3" + help + Uses 25 MHz external crystal on X3 footprint. + Solder Bridge Configuration: + SB3=ON, SB4=ON, SB45=OFF, SB44=OFF, SB46=OFF + WARNING: Requires hardware modification: + - Install 25 MHz crystal at X3 footprint + - Reconfigure solder bridges as indicated above + System clocks with 25 MHz HSE: + - SYSCLK: 400 MHz + - HCLK: 200 MHz + - APB1/2/3/4: 100 MHz + - FDCAN: 25 MHz (direct from HSE) + +endchoice + +config STM32H7_BOARD_HSE_FREQUENCY + int + default 8000000 if NUCLEO_H753ZI_HSE_8MHZ + default 25000000 if NUCLEO_H753ZI_HSE_25MHZ + depends on STM32H7_HSE + +endmenu + +config NUCLEO_H753ZI_GPIO_DRIVER + bool "Enable Nucleo H753ZI board GPIO driver" + default n + select DEV_GPIO + help + This option enables the low-level GPIO driver for the + Nucleo H753ZI board. Other features like buttons or LEDs + will depend on this driver. + +choice + prompt "LED Control Mode" + default NUCLEO_H753ZI_LEDS_AUTO + help + Select how the onboard LEDs should be controlled. + +config NUCLEO_H753ZI_LEDS_AUTO + bool "Automatic LEDs (Kernel controlled)" + help + LEDs are automatically controlled by the kernel to indicate + system status (boot stages, interrupts, panics, etc.). + The LEDs will show: + - GREEN: System ready, signals + - ORANGE: Heap allocation, IRQs + - RED: Assertions, panics, idle + NOTE: You still need to manually enable: + Board Selection -> Board LED Status support + +config NUCLEO_H753ZI_LEDS_USER + bool "User-controlled LEDs" + select USERLED + select USERLED_LOWER + select BOARD_LATE_INITIALIZE + help + LEDs are controlled by user applications via /dev/userleds. + Applications can turn individual LEDs on/off as needed. + Kernel status indication is disabled. + NOTE: You must manually disable: + Board Selection -> Board LED Status support (to avoid + conflicts) + +config NUCLEO_H753ZI_LEDS_DISABLED + bool "LEDs disabled" + help + LED functionality is completely disabled to save resources. + NOTE: You should manually disable: + Board Selection -> Board LED Status support + +endchoice + +menu "Button Configuration" + +config NUCLEO_H753ZI_BUTTON_SUPPORT + bool "Enable button support" + default n + select ARCH_BUTTONS + help + Enable GPIO button support for the Nucleo-H753ZI board. + +config NUCLEO_H753ZI_BUTTON_COUNT + int "Number of buttons" + depends on NUCLEO_H753ZI_BUTTON_SUPPORT + default 1 + range 1 32 + help + Total number of buttons to configure (1-32). + The STM32H7 button driver supports up to 32 buttons using + a 32-bit bitmask for button states. + +config NUCLEO_H753ZI_BUTTON_BUILTIN + bool "Include built-in user button (PC13)" + depends on NUCLEO_H753ZI_BUTTON_SUPPORT + default y + help + Include the built-in blue user button connected to PC13. + This button will always be assigned as button index 0. + If enabled, you need (BUTTON_COUNT - 1) additional pins. + If disabled, you need exactly BUTTON_COUNT pins. + +config NUCLEO_H753ZI_BUTTON_PINS + string "Button GPIO pin list" + depends on NUCLEO_H753ZI_BUTTON_SUPPORT + default "" + help + Comma-separated list of GPIO pins for buttons. + Format: PORT+PIN (e.g., "PF15,PG14,PG9,PE0,PA0,PB12") + Number of pins required: + - With built-in: (BUTTON_COUNT - 1) pins + - Without built-in: BUTTON_COUNT pins + Example for 5 buttons with built-in enabled: + "PF15,PG14,PG9,PE0" + Common Nucleo-H753ZI pins: + Arduino Headers: PF15(D2), PG14(D1), PG9(D0), PE0(D34) + Morpho Headers: PA0-PA15, PB0-PB15, PC0-PC15, PD0-PD15, + PE0-PE15, PF0-PF15, PG0-PG15, PH0-PH1 + Note: All buttons assume pull-down resistor configuration. + +config NUCLEO_H753ZI_BUTTON_VALIDATION + bool "Validate pin configuration at compile time" + depends on NUCLEO_H753ZI_BUTTON_SUPPORT + default y + help + Perform compile-time validation of GPIO pin assignments. + +endmenu + +menu "SPI Configuration" + depends on STM32H7_SPI + +comment "SPI interfaces now use per-sensor CS registration system" +comment "No CS pins configured at SPI level - sensors register their own CS pins" + +if STM32H7_SPI1 + +menu "SPI1 Configuration" + +config NUCLEO_H753ZI_SPI1_ENABLE + bool "Enable SPI1" + default n + help + Enable SPI1 with configurable pins. + CS pins are now registered per-sensor. + +choice + prompt "SPI1 Pin Set" + depends on NUCLEO_H753ZI_SPI1_ENABLE + default NUCLEO_H753ZI_SPI1_PINSET_1 + help + Select which set of pins to use for SPI1. + Choose based on availability and board layout. + +config NUCLEO_H753ZI_SPI1_PINSET_1 + bool "Pin Set 1: PA5(SCK), PA6(MISO), PA7(MOSI)" + help + SPI1 Pin Set 1 (Arduino SPI connector compatible): + - SCK: PA5 (D13 - Arduino SCK) + - MISO: PA6 (D12 - Arduino MISO) + - MOSI: PA7 (D11 - Arduino MOSI) + This is the standard Arduino SPI pinout. + +config NUCLEO_H753ZI_SPI1_PINSET_2 + bool "Pin Set 2: PB3(SCK), PB4(MISO), PB5(MOSI)" + help + SPI1 Pin Set 2: + - SCK: PB3 + - MISO: PB4 + - MOSI: PB5 + +config NUCLEO_H753ZI_SPI1_PINSET_3 + bool "Pin Set 3: PG11(SCK), PG9(MISO), PD7(MOSI)" + help + SPI1 Pin Set 3: + - SCK: PG11 + - MISO: PG9 + - MOSI: PD7 + +endchoice + +endmenu + +endif + +if STM32H7_SPI2 + +menu "SPI2 Configuration" + +config NUCLEO_H753ZI_SPI2_ENABLE + bool "Enable SPI2" + default n + help + Enable SPI2 with configurable pins. + CS pins are now registered per-sensor. + +choice + prompt "SPI2 Pin Set" + depends on NUCLEO_H753ZI_SPI2_ENABLE + default NUCLEO_H753ZI_SPI2_PINSET_1 + help + Select which set of pins to use for SPI2. + +config NUCLEO_H753ZI_SPI2_PINSET_1 + bool "Pin Set 1: PB13(SCK), PB14(MISO), PB15(MOSI)" + help + SPI2 Pin Set 1: + - SCK: PB13 + - MISO: PB14 + - MOSI: PB15 + +config NUCLEO_H753ZI_SPI2_PINSET_2 + bool "Pin Set 2: PA12(SCK), PC2(MISO), PC1(MOSI)" + help + SPI2 Pin Set 2: + - SCK: PA12 + - MISO: PC2 + - MOSI: PC1 + +config NUCLEO_H753ZI_SPI2_PINSET_3 + bool "Pin Set 3: PD3(SCK), PC2(MISO), PC3(MOSI)" + help + SPI2 Pin Set 3: + - SCK: PD3 + - MISO: PC2 + - MOSI: PC3 + +endchoice + +endmenu Review Comment: Yeah, unfortunately things slip by and there are many "old" boards that don't have the best practices. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
