forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
port for WeAct Studio H723VG-LCD dev board #9550
Open
bshewan
wants to merge
3
commits into
adafruit:main
Choose a base branch
from
bshewan:weact-h723vg-lcd-port
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
GNU linker script for STM32H723 with filesystem, tcm | ||
*/ | ||
|
||
/* Entry Point */ | ||
ENTRY(Reset_Handler) | ||
|
||
_ld_default_stack_size = 24K; | ||
|
||
/* Specify the memory areas */ | ||
MEMORY | ||
{ | ||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K | ||
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* sector 0, 128K */ | ||
FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 384K /* sector 1-3, 128K */ | ||
FLASH_FIRMWARE (rx) : ORIGIN = 0x08080000, LENGTH = 512K /* sectors 4*128 + 8*128 */ | ||
DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K | ||
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 320K /* AXI SRAM */ | ||
SRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K /* AHB1 SRAM */ | ||
SRAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K /* AHB2 SRAM */ | ||
ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K | ||
} | ||
|
||
/* produce a link error if there is not this amount of RAM for these sections */ | ||
_minimum_stack_size = 24K; /*TODO: this can probably be bigger, but how big?*/ | ||
_minimum_heap_size = 16K; | ||
|
||
/* brainless copy paste for stack code. Results in ambiguous hard crash */ | ||
/* _ld_default_stack_size = 20K; */ | ||
|
||
/* Define tho top end of the stack. The stack is full descending so begins just | ||
above last byte of RAM. Note that EABI requires the stack to be 8-byte | ||
aligned for a call. */ | ||
_estack = ORIGIN(DTCM) + LENGTH(DTCM); | ||
|
||
/* RAM extents for the garbage collector */ | ||
_ram_start = ORIGIN(RAM); | ||
_ram_end = ORIGIN(RAM) + LENGTH(RAM); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
GNU linker script for STM32H723 with no filesystem, tcm | ||
*/ | ||
|
||
/* Entry Point */ | ||
ENTRY(Reset_Handler) | ||
|
||
_ld_default_stack_size = 24K; | ||
|
||
/* Specify the memory areas */ | ||
MEMORY | ||
{ | ||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K | ||
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* sector 0, 128K */ | ||
FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sectors 1-15, 15*128 */ | ||
DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K | ||
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 320K /* AXI SRAM */ | ||
SRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K /* AHB1 SRAM */ | ||
SRAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K /* AHB2 SRAM */ | ||
ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K | ||
} | ||
|
||
/* produce a link error if there is not this amount of RAM for these sections */ | ||
_minimum_stack_size = 24K; /*TODO: this can probably be bigger, but how big?*/ | ||
_minimum_heap_size = 16K; | ||
|
||
/* brainless copy paste for stack code. Results in ambiguous hard crash */ | ||
/* _ld_default_stack_size = 20K; */ | ||
|
||
/* Define tho top end of the stack. The stack is full descending so begins just | ||
above last byte of RAM. Note that EABI requires the stack to be 8-byte | ||
aligned for a call. */ | ||
_estack = ORIGIN(DTCM) + LENGTH(DTCM); | ||
|
||
/* RAM extents for the garbage collector */ | ||
_ram_start = ORIGIN(RAM); | ||
_ram_end = ORIGIN(RAM) + LENGTH(RAM); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// This file is part of the CircuitPython project: https://circuitpython.org | ||
// | ||
// SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#include "supervisor/board.h" | ||
#include "stm32h7xx_hal.h" | ||
|
||
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. | ||
|
||
void board_init(void) { | ||
|
||
} | ||
|
||
void external_flash_setup(void) { | ||
|
||
/**OCTOSPI1 GPIO Configuration | ||
PE2 ------> OCTOSPIM_P1_IO2 | ||
PB2 ------> OCTOSPIM_P1_CLK | ||
PD11 ------> OCTOSPIM_P1_IO0 | ||
PD12 ------> OCTOSPIM_P1_IO1 | ||
PD13 ------> OCTOSPIM_P1_IO3 | ||
PB6 ------> OCTOSPIM_P1_NCS | ||
*/ | ||
|
||
GPIO_InitTypeDef GPIO_InitStruct = {0}; | ||
|
||
GPIO_InitStruct.Pin = GPIO_PIN_2; | ||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | ||
GPIO_InitStruct.Pull = GPIO_NOPULL; | ||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | ||
GPIO_InitStruct.Alternate = GPIO_AF9_OCTOSPIM_P1; | ||
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); | ||
|
||
GPIO_InitStruct.Pin = GPIO_PIN_2; | ||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | ||
GPIO_InitStruct.Pull = GPIO_NOPULL; | ||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | ||
GPIO_InitStruct.Alternate = GPIO_AF9_OCTOSPIM_P1; | ||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); | ||
|
||
GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13; | ||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | ||
GPIO_InitStruct.Pull = GPIO_NOPULL; | ||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | ||
GPIO_InitStruct.Alternate = GPIO_AF9_OCTOSPIM_P1; | ||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); | ||
|
||
GPIO_InitStruct.Pin = GPIO_PIN_6; | ||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | ||
GPIO_InitStruct.Pull = GPIO_NOPULL; | ||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | ||
GPIO_InitStruct.Alternate = GPIO_AF10_OCTOSPIM_P1; | ||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); | ||
|
||
/* OCTOSPI1 interrupt Init */ | ||
HAL_NVIC_SetPriority(OCTOSPI1_IRQn, 0, 0); | ||
HAL_NVIC_EnableIRQ(OCTOSPI1_IRQn); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// This file is part of the CircuitPython project: https://circuitpython.org | ||
// | ||
// SPDX-FileCopyrightText: Copyright (c) 2020 Lucian Copeland for Adafruit Industries | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#pragma once | ||
|
||
// Micropython setup | ||
|
||
#define MICROPY_HW_BOARD_NAME "WeAct H723VG LCD" | ||
#define MICROPY_HW_MCU_NAME "STM32H723" | ||
|
||
#define FLASH_PAGE_SIZE (0x4000) | ||
|
||
// H7 and F7 MPU definitions | ||
#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_1MB | ||
#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_64KB | ||
#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB | ||
#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_320KB | ||
#define CPY_SRAM_SUBMASK 0x00 | ||
#define CPY_SRAM_START_ADDR 0x24000000 | ||
#define CFG_TUSB_OS OPT_OS_NONE | ||
|
||
#define HSE_VALUE ((uint32_t)25000000) | ||
#define LSE_VALUE ((uint32_t)32768) | ||
|
||
#define BOARD_HSE_SOURCE (RCC_HSE_ON) | ||
#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) | ||
#define BOARD_NO_VBUS_SENSE 1 | ||
#define BOARD_NO_USB_OTG_ID_SENSE 1 | ||
|
||
#define MICROPY_HW_LED_STATUS (&pin_PE03) | ||
|
||
// on-board SPI flash | ||
#define SPI_FLASH_MOSI_PIN (&pin_PD07) | ||
#define SPI_FLASH_MISO_PIN (&pin_PB04) | ||
#define SPI_FLASH_SCK_PIN (&pin_PB03) | ||
#define SPI_FLASH_CS_PIN (&pin_PD06) | ||
|
||
#if QSPI_FLASH_FILESYSTEM | ||
#define MICROPY_QSPI_DATA0 (&pin_PD11) | ||
#define MICROPY_QSPI_DATA1 (&pin_PD12) | ||
#define MICROPY_QSPI_DATA2 (&pin_PE02) | ||
#define MICROPY_QSPI_DATA3 (&pin_PD13) | ||
#define MICROPY_QSPI_SCK (&pin_PB02) | ||
#define MICROPY_QSPI_CS (&pin_PB06) | ||
#endif | ||
|
||
// usb? | ||
#define IGNORE_PIN_PA11 1 | ||
#define IGNORE_PIN_PA12 1 | ||
|
||
#define DEFAULT_I2C_BUS_SCL (&pin_PB08) | ||
#define DEFAULT_I2C_BUS_SDA (&pin_PB09) | ||
|
||
#define DEFAULT_SPI_BUS_SCK (&pin_PB13) | ||
#define DEFAULT_SPI_BUS_MOSI (&pin_PB15) | ||
#define DEFAULT_SPI_BUS_MISO (&pin_PB14) | ||
|
||
#define DEFAULT_UART_BUS_RX (&pin_PA10) | ||
#define DEFAULT_UART_BUS_TX (&pin_PA09) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
USB_VID = 0x0483 | ||
USB_PID = 0x5740 | ||
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a generic STM VID/PID. If you don't work for WeAct you can request a USB PID from: https://pid.codes/ If you do work for WeAct, then you should sublicense a unique PID from STM or acquire your own VID from the USB folks. |
||
USB_PRODUCT = "H723VG LCD" | ||
USB_MANUFACTURER = "WeAct Studio" | ||
|
||
INTERNAL_FLASH_FILESYSTEM = 0 | ||
QSPI_FLASH_FILESYSTEM = 1 | ||
# SPI_FLASH_FILESYSTEM = 1 | ||
|
||
MCU_SERIES = H7 | ||
MCU_VARIANT = STM32H723xx | ||
MCU_PACKAGE = LQFP100_x7 | ||
|
||
EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ" | ||
|
||
LD_COMMON = boards/common_tcm.ld | ||
LD_FILE = boards/STM32H723_nofs.ld | ||
|
||
CIRCUITPY_BLEIO_HCI = 0 | ||
|
||
# Typically the first module to create | ||
CIRCUITPY_MICROCONTROLLER = 1 | ||
# Typically the second module to create | ||
CIRCUITPY_DIGITALIO = 1 | ||
# Other modules: | ||
CIRCUITPY_ANALOGIO = 0 | ||
CIRCUITPY_PWMIO = 1 | ||
CIRCUITPY_BUSIO = 1 | ||
CIRCUITPY_COUNTIO = 0 | ||
CIRCUITPY_NEOPIXEL_WRITE = 0 | ||
CIRCUITPY_PULSEIO = 1 | ||
CIRCUITPY_OS = 1 | ||
CIRCUITPY_NVM = 0 | ||
CIRCUITPY_AUDIOBUSIO = 0 | ||
CIRCUITPY_AUDIOIO = 0 | ||
CIRCUITPY_ROTARYIO = 0 | ||
CIRCUITPY_RTC = 1 | ||
CIRCUITPY_SDCARDIO = 1 | ||
CIRCUITPY_SDIOIO = 1 | ||
CIRCUITPY_FRAMEBUFFERIO = 0 | ||
CIRCUITPY_FREQUENCYIO = 0 | ||
CIRCUITPY_I2CTARGET = 0 | ||
# Requires SPI, PulseIO (stub ok): | ||
CIRCUITPY_DISPLAYIO = 1 | ||
|
||
# These modules are implemented in shared-module/ - they can be included in | ||
# any port once their prerequisites in common-hal are complete. | ||
# Requires DigitalIO: | ||
CIRCUITPY_BITBANGIO = 0 | ||
# Requires neopixel_write or SPI (dotstar) | ||
CIRCUITPY_PIXELBUF = 0 | ||
# Requires OS | ||
CIRCUITPY_RANDOM = 1 | ||
# Requires OS, filesystem | ||
CIRCUITPY_STORAGE = 1 | ||
# Requires Microcontroller | ||
CIRCUITPY_TOUCHIO = 0 | ||
# Requires USB | ||
CIRCUITPY_USB_HID = 0 | ||
CIRCUITPY_USB_MIDI = 0 | ||
# Does nothing without I2C | ||
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 | ||
# No requirements, but takes extra flash | ||
CIRCUITPY_ULAB = 0 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the last byte used for?