summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHierophect <hierophect@gmail.com>2019-09-09 11:58:27 -0400
committerHierophect <hierophect@gmail.com>2019-09-09 11:58:27 -0400
commit129615a7246f76e27bf99e8033b44e6885dd7cd6 (patch)
tree35a46c08d10a9918e222771cba901c5472483ed2
parent426ddb356ec45f4c75e9e6956d9f0ddf7d223cc2 (diff)
text fixes
-rw-r--r--ports/stm32f4/boards/STM32F412ZGTx_FLASH.ld4
-rw-r--r--ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk2
-rw-r--r--ports/stm32f4/supervisor/usb.c70
3 files changed, 39 insertions, 37 deletions
diff --git a/ports/stm32f4/boards/STM32F412ZGTx_FLASH.ld b/ports/stm32f4/boards/STM32F412ZGTx_FLASH.ld
index bf7014ad1..e0586709e 100644
--- a/ports/stm32f4/boards/STM32F412ZGTx_FLASH.ld
+++ b/ports/stm32f4/boards/STM32F412ZGTx_FLASH.ld
@@ -1,5 +1,5 @@
/*
- GNU linker script for STM32F411 via Micropython
+ GNU linker script for STM32F412
*/
/* Specify the memory areas */
@@ -51,8 +51,6 @@ SECTIONS
. = ALIGN(4);
*(.text*) /* .text* sections (code) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- /* *(.glue_7) */ /* glue arm to thumb code */
- /* *(.glue_7t) */ /* glue thumb to arm code */
. = ALIGN(4);
_etext = .; /* define a global symbol at end of code */
diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk
index c7a87a993..e9ba93805 100644
--- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk
+++ b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk
@@ -3,7 +3,7 @@ USB_PID = 0x572B
USB_PRODUCT = "STM32F412ZG Discovery Board - CPy"
USB_MANUFACTURER = "STMicroelectronics"
-USB_CDC_AND_MSC_ONLY = 1
+USB_DEVICES = "CDC,MSC"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
diff --git a/ports/stm32f4/supervisor/usb.c b/ports/stm32f4/supervisor/usb.c
index 034d5801b..3a4d62659 100644
--- a/ports/stm32f4/supervisor/usb.c
+++ b/ports/stm32f4/supervisor/usb.c
@@ -33,42 +33,46 @@
#include "stm32f4xx_hal.h"
void init_usb_hardware(void) {
- GPIO_InitTypeDef GPIO_InitStruct = {0};
- /**USB_OTG_FS GPIO Configuration
- PA10 ------> USB_OTG_FS_ID
- PA11 ------> USB_OTG_FS_DM
- PA12 ------> USB_OTG_FS_DP
- */
- __HAL_RCC_GPIOA_CLK_ENABLE();
+ //TODO: if future chips overload this with options, move to peripherals management.
- /* Configure DM DP Pins */
- GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12;
- GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ /**USB_OTG_FS GPIO Configuration
+ PA10 ------> USB_OTG_FS_ID
+ PA11 ------> USB_OTG_FS_DM
+ PA12 ------> USB_OTG_FS_DP
+ */
+ __HAL_RCC_GPIOA_CLK_ENABLE();
- /* Configure VBUS Pin */
- GPIO_InitStruct.Pin = GPIO_PIN_9;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ /* Configure DM DP Pins */
+ GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12;
+ GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /* This for ID line debug */
- GPIO_InitStruct.Pin = GPIO_PIN_10;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ /* Configure VBUS Pin */
+ GPIO_InitStruct.Pin = GPIO_PIN_9;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /* Configure POWER_SWITCH IO pin (F412 ONLY)*/
- GPIO_InitStruct.Pin = GPIO_PIN_8;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
+ /* This for ID line debug */
+ GPIO_InitStruct.Pin = GPIO_PIN_10;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /* Peripheral clock enable */
- __HAL_RCC_USB_OTG_FS_CLK_ENABLE();
+#ifdef STM32F412Zx
+ /* Configure POWER_SWITCH IO pin (F412 ONLY)*/
+ GPIO_InitStruct.Pin = GPIO_PIN_8;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
+#endif
+
+ /* Peripheral clock enable */
+ __HAL_RCC_USB_OTG_FS_CLK_ENABLE();
}