STMicroelectronics / STM32CubeH7

STM32Cube MCU Full Package for the STM32H7 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
https://www.st.com/en/embedded-software/stm32cubeh7.html
Other
490 stars 302 forks source link

BSP driver for STM32H743I/753I -EVAL, fix for using LEDs without the I2C I/O extender #201

Closed pavel-a closed 5 months ago

pavel-a commented 2 years ago

This patch fixes LEDs directly connected to GPIOs when the I2C I/O extender is disabled. File: Drivers/BSP/STM32H743I-EVAL/stm32h743i_eval.c

https://github.com/STMicroelectronics/STM32CubeH7/blob/e9472e471cc8974c4a2596fc86e565241871c20e/Drivers/BSP/STM32H743I-EVAL/stm32h743i_eval.c#L99-L108 Describe the set-up

Describe the bug I needed to reuse the I2C for the I/O extender for other purpose, so removed #define USE_BSP_IO_CLASS Then two LEDs connected directly to MCU (red and green) stopped working.
Fix proposed below.
Maybe this applies to other similar boards.

How To Reproduce see above

Additional context

The fragment above should be:

static const  uint32_t LED_PIN[LEDn] = {LED1_PIN,
#if (USE_BSP_IO_CLASS > 0)
                                        LED2_PIN,
#else
                                       0,
#endif
                                        LED3_PIN,
#if (USE_BSP_IO_CLASS > 0)
                                        LED4_PIN
#else
                                       0,
#endif
                                       };

Patch below:


diff --git a/Drivers/BSP/STM32H743I-EVAL/stm32h743i_eval.c b/Drivers/BSP/STM32H743I-EVAL/stm32h743i_eval.c
index eb5a8c9b..6628ba70 100644
--- a/Drivers/BSP/STM32H743I-EVAL/stm32h743i_eval.c
+++ b/Drivers/BSP/STM32H743I-EVAL/stm32h743i_eval.c
@@ -99,10 +99,14 @@ static GPIO_TypeDef* LED_PORT[LEDn] = {
 static const  uint32_t LED_PIN[LEDn] = {LED1_PIN,
 #if (USE_BSP_IO_CLASS > 0)
                                         LED2_PIN,
+#else
+                                        0,
 #endif
                                         LED3_PIN,
 #if (USE_BSP_IO_CLASS > 0)
                                         LED4_PIN
+#else
+                                        0,
 #endif
                                        };

-- 
RKOUSTM commented 2 years ago

Hi @pavel-a,

Thank you for your report. An internal tracker has been logged and a fix will be implemented and made available in the frame of a future release.

Thank you again for you report.

With regards,

RKOUSTM commented 2 years ago

ST Internal Reference: 126180

ALABSTM commented 5 months ago

Fixed in commit b9d11df3020deef82310c88f3d8590d076b43ef7