Skip to content

Commit b924f64

Browse files
tobbaddpgeorge
authored andcommitted
stmhal: Fix clock configuration for STM32L476-discovery; also add I2C2.
1 parent e89413e commit b924f64

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

stmhal/boards/STM32L476DISC/mpconfigboard.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
#define MICROPY_HW_ENABLE_DAC (0)
1717
#define MICROPY_HW_ENABLE_CAN (0)
1818

19-
// HSE is 8MHz
20-
#define MICROPY_HW_CLK_PLLM (2)
19+
// MSI is used and is 4MHz
20+
#define MICROPY_HW_CLK_PLLM (1)
2121
#define MICROPY_HW_CLK_PLLN (40)
2222
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV7)
23-
#define MICROPY_HW_CLK_PLLR (RCC_PLLP_DIV7)
23+
#define MICROPY_HW_CLK_PLLR (RCC_PLLR_DIV2)
2424
#define MICROPY_HW_CLK_PLLQ (RCC_PLLQ_DIV2)
2525

2626
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_4
@@ -32,6 +32,8 @@
3232
// I2C busses
3333
#define MICROPY_HW_I2C1_SCL (pin_B6)
3434
#define MICROPY_HW_I2C1_SDA (pin_B7)
35+
#define MICROPY_HW_I2C2_SCL (pin_B10)
36+
#define MICROPY_HW_I2C2_SDA (pin_B11)
3537
// We use an array of baudrates and corresponding TIMINGR values.
3638
//
3739
// The value 0x90112626 was obtained from the DISCOVERY_I2C1_TIMING constant

0 commit comments

Comments
 (0)