Skip to content
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

Add STM32H750xx support #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ STPROG_CLI ?= ~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Prog
OPTFLAGS ?= -Os

ifeq ($(OS),Windows_NT)
RM = del /Q
fixpath = $(strip $(subst /,\, $1))
ifneq ($(MSYSTEM),MINGW64)
RM = del /Q
fixpath = $(strip $(subst /,\, $1))
endif
else
RM = rm -f
fixpath = $(strip $1)
Expand Down Expand Up @@ -54,6 +56,7 @@ help all:
@echo ' stm32f429xi CDC loopback demo for STM32F429xI based boards'
@echo ' stm32f401xc CDC loopback demo for STM32F401xC based boards'
@echo ' stm32f401xe CDC loopback demo for STM32F401xE based boards'
@echo ' stm32h750xx CDC loopback demo for STM32H750xx based boards'
@echo ' cmsis Download CMSIS 5 and stm32.h into a $$(CMSIS) directory'
@echo ' doc DOXYGEN documentation'
@echo ' module static library module using following envars (defaults)'
Expand Down Expand Up @@ -292,6 +295,12 @@ stm32h743xx: clean
DEFINES='STM32H7 STM32H743xx USBD_VBUS_DETECT USBD_SOF_DISABLED' \
CFLAGS='-mcpu=cortex-m7'

stm32h750xx: clean
@$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32H7xx/Source/Templates/gcc/startup_stm32h750xx.s' \
LDSCRIPT='demo/stm32h750xx.ld' \
DEFINES='STM32H7 STM32H750xx USBD_SOF_DISABLED' \
CFLAGS='-mcpu=cortex-m7'

stm32f411xe stm32f411e-disco: clean
@$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f411xe.s' \
LDSCRIPT='demo/stm32f401xe.ld' \
Expand Down
2 changes: 1 addition & 1 deletion demo/cdc_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ static void cdc_init_usbd(void) {
#elif defined(STM32L476xx) || defined(STM32F429xx) || \
defined(STM32F105xC) || defined(STM32F107xC) || \
defined(STM32F446xx) || defined(STM32F411xE) || \
defined(STM32H743xx)
defined(STM32H743xx) || defined(STM32H750xx)
#define USB_HANDLER OTG_FS_IRQHandler
#define USB_NVIC_IRQ OTG_FS_IRQn
#elif defined(STM32F103x6)
Expand Down
2 changes: 1 addition & 1 deletion demo/cdc_startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static void cdc_init_rcc (void) {
_BST(GPIOA->AFR[1], (0x0A << 12) | (0x0A << 16));
/* Disabling USB Vddusb power isolation. Vusb connected to Vdd */
_BST(PWR->CR2, PWR_CR2_USV);
#elif defined(STM32H743xx)
#elif defined(STM32H743xx) || defined(STM32H750xx)
/* Enable USB supply */
_BST(PWR->CR3, PWR_CR3_SCUEN | PWR_CR3_LDOEN | PWR_CR3_USB33DEN);

Expand Down
8 changes: 8 additions & 0 deletions demo/stm32h750xx.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ENTRY(Reset_Handler)
MEMORY
{
ROM (rx): ORIGIN = 0x08000000, LENGTH = 128K
RAM (rwx): ORIGIN = 0x20000000, LENGTH = 128K
}

INCLUDE sections.ld
1 change: 1 addition & 0 deletions hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
| stm32f745xe | NUCO-V-F745VE + NUCLEO2USB | |
| stm32f401xe | WeAct STM32F401CEU6 | |
| stm32h743vt | Boring Tech STM32H743 | USB 5v connected to A9 |
| stm32h750xbh6 | FK750M5-XBH6 | |

[NUCLEO2USB SHIELD](https://github.com/dmitrystu/Nucleo2USB)
[NUCO-V](https://github.com/dmitrystu/nuco-v)
2 changes: 1 addition & 1 deletion inc/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
#define usbd_hw usbd_devfs
#endif

#elif defined(STM32H743xx)
#elif defined(STM32H743xx) || defined(STM32H750xx)
#define USBD_STM32H743FS

#if !defined(__ASSEMBLER__)
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ All requirements can be downloaded into a directory specified in environment var
<td>usbd_stm32f446_otghs.c</td>
</tr>
<tr>
<td>STM32H743</td>
<td>STM32H743 STM32H750</td>
<td nowrap>Doublebuffered<br/>6 endpoints<br/>VBUS detection<br/>SOF output</td>
<td>usbd_otgfs</td>
<td>usbd_stm32h743_otgfs.c</td>
Expand All @@ -125,7 +125,7 @@ All requirements can be downloaded into a directory specified in environment var
3. Tested with STM32L052K8, STM32L100RC, STM32L476RG, STM32F072C8, STM32F103C8, STM32F103CB,
STM32F303CC, STM32F303RE, STM32F429ZI, STM32F105RBT6, STM32F107VCT6, STM32L433CCT6, STM32F070CBT6,
STM32G431RB, STM32F411CEUx, STM32F405RG, STM32F446RE, STM32F373CC, STM32L053R8, GD32F103C8T6,
STM32F745VE, STM32F401CE, STM32H743.
STM32F745VE, STM32F401CE, STM32H743, STM32H750.
See [hardware.md](hardware.md) for details.

### Don't copy-paste the startup code from the demo without considering RCC and USB clock requirements.
Expand Down