text fixes

This commit is contained in:
Hierophect 2019-09-09 11:58:27 -04:00
parent 426ddb356e
commit 129615a724
3 changed files with 39 additions and 37 deletions

View File

@ -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 */

View File

@ -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

View File

@ -33,6 +33,8 @@
#include "stm32f4xx_hal.h"
void init_usb_hardware(void) {
//TODO: if future chips overload this with options, move to peripherals management.
GPIO_InitTypeDef GPIO_InitStruct = {0};
/**USB_OTG_FS GPIO Configuration
PA10 ------> USB_OTG_FS_ID
@ -63,11 +65,13 @@ void init_usb_hardware(void) {
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
#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();