From 8752d76b6722d61880ceeecc97624dd7d80577c0 Mon Sep 17 00:00:00 2001 From: zylx Date: Wed, 30 May 2018 10:22:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[gcc]=EF=BC=9A=E4=BF=AE=E6=94=B9GCC?= =?UTF-8?q?=E5=88=86=E6=95=A3=E5=8A=A0=E8=BD=BD=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Libraries/gcc/MIMXRT1052xxxxx_flexspi_nor.ld | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bsp/imxrt1052-evk/Libraries/gcc/MIMXRT1052xxxxx_flexspi_nor.ld b/bsp/imxrt1052-evk/Libraries/gcc/MIMXRT1052xxxxx_flexspi_nor.ld index b0178bdcdd..b8c229ae3c 100644 --- a/bsp/imxrt1052-evk/Libraries/gcc/MIMXRT1052xxxxx_flexspi_nor.ld +++ b/bsp/imxrt1052-evk/Libraries/gcc/MIMXRT1052xxxxx_flexspi_nor.ld @@ -53,8 +53,8 @@ STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400; /* Specify the memory areas */ MEMORY { - m_boot_data (RX) : ORIGIN = 0x60000000, LENGTH = 0x00000400 - m_image_vertor_table (RX) : ORIGIN = 0x60001000, LENGTH = 0x00000400 + m_boot_data (RX) : ORIGIN = 0x60000000, LENGTH = 0x00001000 + m_image_vertor_table (RX) : ORIGIN = 0x60001000, LENGTH = 0x00001000 m_interrupts (RX) : ORIGIN = 0x60002000, LENGTH = 0x00000400 m_text (RX) : ORIGIN = 0x60002400, LENGTH = 0x1F7FDC00 @@ -72,12 +72,14 @@ SECTIONS { .boot_data : { - KEEP(*(.bootdata)) + KEEP(*(.boot_hdr.conf)) } > m_boot_data .image_vertor_table : { - KEEP(*(.ivt)) + KEEP(*(.boot_hdr.ivt)) + KEEP(*(.boot_hdr.boot_data)) + KEEP(*(.boot_hdr.dcd_data)) } > m_image_vertor_table /* The startup code goes first into internal RAM */ From dab7477312df6cb3ca019624a61ff25d6b37aedc Mon Sep 17 00:00:00 2001 From: user Date: Wed, 30 May 2018 14:47:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[stm32f10x-HAL]=20Fixed=20the=20problem=20o?= =?UTF-8?q?f=20including=20functions=20in=20RT=5FASSERT()|=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=BA=86=EF=BC=9A=E5=BD=93=E5=B1=8F=E8=94=BD=E5=AE=8F?= =?UTF-8?q?=E5=AE=9A=E4=B9=89RT=5FDEBUG=E6=97=B6=EF=BC=8CRT=5FASSERT()?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=87=BD=E6=95=B0=E8=BF=90=E8=A1=8C=E4=B8=8D?= =?UTF-8?q?=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/stm32f10x-HAL/drivers/board.c | 7 +++++-- bsp/stm32f10x-HAL/drivers/drv_usart.c | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bsp/stm32f10x-HAL/drivers/board.c b/bsp/stm32f10x-HAL/drivers/board.c index d520411984..12d5b7d80f 100644 --- a/bsp/stm32f10x-HAL/drivers/board.c +++ b/bsp/stm32f10x-HAL/drivers/board.c @@ -49,6 +49,7 @@ void HAL_MspInit(void) void SystemClock_Config(void) { + rt_err_t result; RCC_OscInitTypeDef RCC_OscInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct; /**Initializes the CPU, AHB and APB busses clocks @@ -60,7 +61,8 @@ void SystemClock_Config(void) RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; - RT_ASSERT(HAL_RCC_OscConfig(&RCC_OscInitStruct) == HAL_OK); + result = HAL_RCC_OscConfig(&RCC_OscInitStruct); + RT_ASSERT(result == HAL_OK); /**Initializes the CPU, AHB and APB busses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; @@ -68,7 +70,8 @@ void SystemClock_Config(void) RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - RT_ASSERT(HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) == HAL_OK); + result = HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2); + RT_ASSERT(result == HAL_OK); /**Configure the Systick interrupt time */ HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / RT_TICK_PER_SECOND); diff --git a/bsp/stm32f10x-HAL/drivers/drv_usart.c b/bsp/stm32f10x-HAL/drivers/drv_usart.c index 80bf5578d8..771f4d62a1 100644 --- a/bsp/stm32f10x-HAL/drivers/drv_usart.c +++ b/bsp/stm32f10x-HAL/drivers/drv_usart.c @@ -267,6 +267,7 @@ INIT_BOARD_EXPORT(rt_hw_usart_init); static void MX_USART_UART_Init(UART_HandleTypeDef *uartHandle) { + rt_err_t result; uartHandle->Init.BaudRate = 115200; uartHandle->Init.WordLength = UART_WORDLENGTH_8B; uartHandle->Init.StopBits = UART_STOPBITS_1; @@ -274,7 +275,8 @@ static void MX_USART_UART_Init(UART_HandleTypeDef *uartHandle) uartHandle->Init.Mode = UART_MODE_TX_RX; uartHandle->Init.HwFlowCtl = UART_HWCONTROL_NONE; uartHandle->Init.OverSampling = UART_OVERSAMPLING_16; - RT_ASSERT(HAL_UART_Init(uartHandle) == HAL_OK); + result = HAL_UART_Init(uartHandle); + RT_ASSERT(result == HAL_OK); } /* USART2 init function */