Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/flipperdevices/libusb_stm32.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Melnikov <aam335@gmail.com>2020-12-05 23:17:35 +0300
committerGitHub <noreply@github.com>2020-12-05 23:17:35 +0300
commit16c4279f8691f19480ab4486b00dbc980ae492a7 (patch)
treea5d18edd3016144bd69e2810f03c41c18aae3e0b
parent503cedd8d2dec6cd3686bf23fb2bdcee04c9f9a0 (diff)
stm32f401,stm32x411 fix and demos (#74)
* stm32f401/f411 demo * 401/411 works fine with 405 driver
-rw-r--r--Makefile9
-rw-r--r--demo/cdc_startup.c3
-rw-r--r--demo/stm32f401xc.ld8
-rw-r--r--inc/usb.h2
4 files changed, 19 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index a76cbc4..4d39f8a 100644
--- a/Makefile
+++ b/Makefile
@@ -240,4 +240,11 @@ stm32f405xg_hs: clean
@$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f405xx.s' \
LDSCRIPT='demo/stm32f405xg.ld' \
DEFINES='STM32F4 STM32F405xx USBD_SOF_DISABLED USBD_PRIMARY_OTGHS' \
- CFLAGS='-mcpu=cortex-m4' \ No newline at end of file
+ CFLAGS='-mcpu=cortex-m4'
+
+
+stm32f401xc: clean
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f401xc.s' \
+ LDSCRIPT='demo/stm32f401xc.ld' \
+ DEFINES='STM32F4 STM32F401xC USBD_SOF_DISABLED' \
+ CFLAGS='-mcpu=cortex-m4' \ No newline at end of file
diff --git a/demo/cdc_startup.c b/demo/cdc_startup.c
index 5deb17b..a8705d3 100644
--- a/demo/cdc_startup.c
+++ b/demo/cdc_startup.c
@@ -113,7 +113,8 @@ static void cdc_init_rcc (void) {
_BMD(GPIOA->MODER, (0x03 << 22) | (0x03 << 24), (0x02 << 22) | (0x02 << 24)); // MCO
-#elif defined(STM32F429xx) || defined(STM32F405xx)
+#elif defined(STM32F429xx) || defined(STM32F405xx) \
+ || defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
/* set flash latency 2WS */
_BMD(FLASH->ACR, FLASH_ACR_LATENCY, FLASH_ACR_LATENCY_2WS);
/* setting up PLL 16MHz HSI, VCO=144MHz, PLLP = 72MHz PLLQ = 48MHz */
diff --git a/demo/stm32f401xc.ld b/demo/stm32f401xc.ld
new file mode 100644
index 0000000..891ee35
--- /dev/null
+++ b/demo/stm32f401xc.ld
@@ -0,0 +1,8 @@
+ENTRY(Reset_Handler)
+MEMORY
+{
+ ROM (rx): ORIGIN = 0x08000000, LENGTH = 256K
+ RAM (rwx): ORIGIN = 0x20000000, LENGTH = 64K
+}
+
+INCLUDE sections.ld
diff --git a/inc/usb.h b/inc/usb.h
index 034af9f..f77f931 100644
--- a/inc/usb.h
+++ b/inc/usb.h
@@ -102,7 +102,7 @@
#endif
#endif //__ASSEMBLER__
-#elif defined(STM32F411xE)
+#elif defined(STM32F411xE) || defined(STM32F401xC) || defined(STM32F401xE)
#define USBD_STM32F429FS
#if !defined(__ASSEMBLER__)