Skip to content

Commit 8001918

Browse files
flowergrassdpgeorge
authored andcommitted
stmhal: Add STM32F769DISC board files.
With minor changes to adc.c and storage.c to support the F769.
1 parent 3dd04de commit 8001918

8 files changed

Lines changed: 767 additions & 2 deletions

File tree

stmhal/adc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
#define VBAT_DIV (2)
9393
#elif defined(STM32F427xx) || defined(STM32F429xx) || \
9494
defined(STM32F437xx) || defined(STM32F439xx) || \
95-
defined(STM32F746xx) || defined(STM32F767xx)
95+
defined(STM32F746xx) || defined(STM32F767xx) || \
96+
defined(STM32F769xx)
9697
#define VBAT_DIV (4)
9798
#elif defined(STM32L476xx)
9899
#define VBAT_DIV (3)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
//This board is only confirmed to operate using openocd.
2+
// To use openocd run "OPENOCD_CONFIG=boards/openocd_stm32f7.cfg" in
3+
// the make command.
4+
#define MICROPY_HW_BOARD_NAME "F769DISC"
5+
#define MICROPY_HW_MCU_NAME "STM32F769"
6+
7+
#define MICROPY_HW_HAS_SWITCH (1)
8+
#define MICROPY_HW_HAS_FLASH (1)
9+
#define MICROPY_HW_HAS_SDCARD (1)
10+
#define MICROPY_HW_HAS_MMA7660 (0)
11+
#define MICROPY_HW_HAS_LIS3DSH (0)
12+
#define MICROPY_HW_HAS_LCD (0)
13+
#define MICROPY_HW_ENABLE_RNG (1)
14+
#define MICROPY_HW_ENABLE_RTC (1)
15+
#define MICROPY_HW_ENABLE_TIMER (1)
16+
#define MICROPY_HW_ENABLE_SERVO (0)
17+
#define MICROPY_HW_ENABLE_DAC (0)
18+
#define MICROPY_HW_ENABLE_CAN (1)
19+
20+
// HSE is 25MHz
21+
// VCOClock = HSE * PLLN / PLLM = 25 MHz * 432 / 25 = 432 MHz
22+
// SYSCLK = VCOClock / PLLP = 432 MHz / 2 = 216 MHz
23+
// USB/SDMMC/RNG Clock = VCOClock / PLLQ = 432 MHz / 9 = 48 MHz
24+
#define MICROPY_HW_CLK_PLLM (25)
25+
#define MICROPY_HW_CLK_PLLN (432)
26+
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
27+
#define MICROPY_HW_CLK_PLLQ (9)
28+
29+
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_7 // 210-216 MHz needs 7 wait states
30+
31+
// UART config
32+
#define MICROPY_HW_UART1_TX (pin_A9)
33+
#define MICROPY_HW_UART1_RX (pin_A10)
34+
#define MICROPY_HW_UART5_TX (pin_C12)
35+
#define MICROPY_HW_UART5_RX (pin_D2)
36+
#define MICROPY_HW_UART_REPL PYB_UART_1
37+
#define MICROPY_HW_UART_REPL_BAUD 115200
38+
39+
// I2C busses
40+
#define MICROPY_HW_I2C1_SCL (pin_B8)
41+
#define MICROPY_HW_I2C1_SDA (pin_B9)
42+
#define MICROPY_HW_I2C3_SCL (pin_H7)
43+
#define MICROPY_HW_I2C3_SDA (pin_H8)
44+
45+
// TODO These should go in i2c.c
46+
#define MICROPY_HW_I2C_BAUDRATE_TIMING {{100000, 0x40912732}}
47+
#define MICROPY_HW_I2C_BAUDRATE_DEFAULT 100000
48+
#define MICROPY_HW_I2C_BAUDRATE_MAX 100000
49+
50+
// SPI
51+
#define MICROPY_HW_SPI2_NSS (pin_A11)
52+
#define MICROPY_HW_SPI2_SCK (pin_A12)
53+
#define MICROPY_HW_SPI2_MISO (pin_B14)
54+
#define MICROPY_HW_SPI2_MOSI (pin_B15)
55+
56+
// USRSW is pulled low. Pressing the button makes the input go high.
57+
#define MICROPY_HW_USRSW_PIN (pin_I11)
58+
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
59+
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
60+
#define MICROPY_HW_USRSW_PRESSED (1)
61+
62+
// LEDs
63+
#define MICROPY_HW_LED1 (pin_J13) // red
64+
#define MICROPY_HW_LED2 (pin_J5) // green
65+
#define MICROPY_HW_LED3 (pin_A12) // green
66+
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
67+
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
68+
69+
// SD card detect switch
70+
#define MICROPY_HW_SDCARD_DETECT_PIN (pin_I15)
71+
#define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_PULLUP)
72+
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
73+
74+
// USB config (CN13 - USB OTG FS)
75+
/*#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_J12)*/
76+
#define MICROPY_HW_USB_OTG_ID_PIN (pin_J12)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MCU_SERIES = f7
2+
CMSIS_MCU = STM32F769xx
3+
AF_FILE = boards/stm32f769_af.csv
4+
LD_FILE = boards/stm32f769.ld
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
A0,PA0
2+
A1,PF10
3+
A2,PF9
4+
A3,PF8
5+
A4,PF7
6+
A5,PF6
7+
D0,PC7
8+
D1,PC6
9+
D2,PG6
10+
D3,PB4
11+
D4,PG7
12+
D5,PA8
13+
D6,PH6
14+
D7,PI3
15+
D8,PI2
16+
D9,PA15
17+
D10,PI0
18+
D11,PB15
19+
D12,PB14
20+
D13,PI1
21+
D14,PB9
22+
D15,PB8
23+
LED1,PJ13
24+
LED2,PJ5
25+
LED3,PA12
26+
SW,PI11
27+
TP1,PH2
28+
TP2,PI8
29+
TP3,PH15
30+
AUDIO_INT,PD6
31+
AUDIO_SDA,PH8
32+
AUDIO_SCL,PH7
33+
EXT_SDA,PB9
34+
EXT_SCL,PB8
35+
EXT_RST,PG3
36+
SD_SW,PI15
37+
LCD_BL_CTRL,PK3
38+
LCD_INT,PI13
39+
LCD_SDA,PH8
40+
LCD_SCL,PH7
41+
OTG_FS_POWER,PD5
42+
OTG_FS_OVER_CURRENT,PD4
43+
OTG_HS_OVER_CURRENT,PE3
44+
USB_VBUS,PJ12
45+
USB_ID,PA8
46+
USB_DM,PA11
47+
USB_DP,PA12
48+
UART1_TX,PA9
49+
UART1_RX,PA10
50+
UART5_TX,PC12
51+
UART5_RX,PD2

0 commit comments

Comments
 (0)