stm32: Fix STM32G4 USB

STM32G4 USB controller requires 8 or 16-bit access, not 32-bit

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
This commit is contained in:
Alex Maclean 2023-12-15 19:43:58 +00:00 committed by KevinOConnor
parent 547bfbf818
commit 71ab6240f2
1 changed files with 6 additions and 1 deletions

View File

@ -15,7 +15,7 @@
#include "internal.h" // GPIO #include "internal.h" // GPIO
#include "sched.h" // DECL_INIT #include "sched.h" // DECL_INIT
#if CONFIG_MACH_STM32F1 || CONFIG_MACH_STM32G4 #if CONFIG_MACH_STM32F1
// Transfer memory is accessed with 32bits, but contains only 16bits of data // Transfer memory is accessed with 32bits, but contains only 16bits of data
typedef volatile uint32_t epmword_t; typedef volatile uint32_t epmword_t;
#define WSIZE 2 #define WSIZE 2
@ -25,6 +25,11 @@
typedef volatile uint16_t epmword_t; typedef volatile uint16_t epmword_t;
#define WSIZE 2 #define WSIZE 2
#define USBx_IRQn USB_IRQn #define USBx_IRQn USB_IRQn
#elif CONFIG_MACH_STM32G4
// Transfer memory is accessed with 16bits and contains 16bits of data
typedef volatile uint16_t epmword_t;
#define WSIZE 2
#define USBx_IRQn USB_LP_IRQn
#elif CONFIG_MACH_STM32G0 #elif CONFIG_MACH_STM32G0
// Transfer memory is accessed with 32bits and contains 32bits of data // Transfer memory is accessed with 32bits and contains 32bits of data
typedef volatile uint32_t epmword_t; typedef volatile uint32_t epmword_t;