Skip to content

Commit ce3fc30

Browse files
committed
STM32F1 STM32Cube FW V1.6.1 => V1.8.0
1 parent f13b06a commit ce3fc30

File tree

3 files changed

+59
-77
lines changed

3 files changed

+59
-77
lines changed

targets/TARGET_STM/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ This table summarizes the STM32Cube versions currently used in Mbed OS master br
6262
| STM32 Serie | Cube version | Github source |
6363
|-------------|--------------|---------------------------------------------------|
6464
| F0 | 1.9.0 | https://github.com/STMicroelectronics/STM32CubeF0 |
65-
| F1 | 1.6.1 | https://github.com/STMicroelectronics/STM32CubeF1 |
65+
| F1 | 1.8.0 | https://github.com/STMicroelectronics/STM32CubeF1 |
6666
| F2 | 1.6.0 | https://github.com/STMicroelectronics/STM32CubeF2 |
6767
| F3 | 1.9.0 | https://github.com/STMicroelectronics/STM32CubeF3 |
6868
| F4 | 1.19.0 | https://github.com/STMicroelectronics/STM32CubeF4 |

targets/TARGET_STM/TARGET_STM32F1/STM32Cube_FW/stm32f1xx_hal_conf.h

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,13 @@
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
11+
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
12+
* All rights reserved.</center></h2>
1213
*
13-
* Redistribution and use in source and binary forms, with or without modification,
14-
* are permitted provided that the following conditions are met:
15-
* 1. Redistributions of source code must retain the above copyright notice,
16-
* this list of conditions and the following disclaimer.
17-
* 2. Redistributions in binary form must reproduce the above copyright notice,
18-
* this list of conditions and the following disclaimer in the documentation
19-
* and/or other materials provided with the distribution.
20-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
21-
* may be used to endorse or promote products derived from this software
22-
* without specific prior written permission.
23-
*
24-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14+
* This software component is licensed by ST under BSD 3-Clause license,
15+
* the "License"; You may not use this file except in compliance with the
16+
* License. You may obtain a copy of the License at:
17+
* opensource.org/licenses/BSD-3-Clause
3418
*
3519
******************************************************************************
3620
*/
@@ -53,12 +37,14 @@ extern "C" {
5337
#define HAL_MODULE_ENABLED
5438
#define HAL_ADC_MODULE_ENABLED
5539
#define HAL_CAN_MODULE_ENABLED
40+
/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
5641
#define HAL_CEC_MODULE_ENABLED
5742
#define HAL_CORTEX_MODULE_ENABLED
5843
#define HAL_CRC_MODULE_ENABLED
5944
#define HAL_DAC_MODULE_ENABLED
6045
#define HAL_DMA_MODULE_ENABLED
6146
#define HAL_ETH_MODULE_ENABLED
47+
#define HAL_EXTI_MODULE_ENABLED
6248
#define HAL_FLASH_MODULE_ENABLED
6349
#define HAL_GPIO_MODULE_ENABLED
6450
#define HAL_HCD_MODULE_ENABLED
@@ -142,6 +128,30 @@ extern "C" {
142128
#define USE_RTOS 0U
143129
#define PREFETCH_ENABLE 1U
144130

131+
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
132+
#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
133+
#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
134+
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
135+
#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
136+
#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
137+
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
138+
#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
139+
#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
140+
#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
141+
#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
142+
#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
143+
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
144+
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
145+
#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
146+
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
147+
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
148+
#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
149+
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
150+
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
151+
#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
152+
#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
153+
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
154+
145155
/* ########################## Assert Selection ############################## */
146156
/**
147157
* @brief Uncomment the line below to expanse the "assert_param" macro in the
@@ -164,14 +174,8 @@ extern "C" {
164174
/* Definition of the Ethernet driver buffers size and count */
165175
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
166176
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
167-
168-
#ifdef MBED_CONF_STM32_EMAC_ETH_RXBUFNB
169-
#define ETH_RXBUFNB MBED_CONF_STM32_EMAC_ETH_RXBUFNB /* Rx buffers of size ETH_RX_BUF_SIZE */
170-
#endif
171-
172-
#ifdef MBED_CONF_STM32_EMAC_ETH_TXBUFNB
173-
#define ETH_TXBUFNB MBED_CONF_STM32_EMAC_ETH_TXBUFNB /* Tx buffers of size ETH_TX_BUF_SIZE */
174-
#endif
177+
#define ETH_RXBUFNB 8U /* 8 Rx buffers of size ETH_RX_BUF_SIZE */
178+
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
175179

176180
/* Section 2: PHY configuration section */
177181

@@ -243,6 +247,10 @@ extern "C" {
243247
#include "stm32f1xx_hal_gpio.h"
244248
#endif /* HAL_GPIO_MODULE_ENABLED */
245249

250+
#ifdef HAL_EXTI_MODULE_ENABLED
251+
#include "stm32f1xx_hal_exti.h"
252+
#endif /* HAL_EXTI_MODULE_ENABLED */
253+
246254
#ifdef HAL_DMA_MODULE_ENABLED
247255
#include "stm32f1xx_hal_dma.h"
248256
#endif /* HAL_DMA_MODULE_ENABLED */
@@ -255,6 +263,10 @@ extern "C" {
255263
#include "stm32f1xx_hal_can.h"
256264
#endif /* HAL_CAN_MODULE_ENABLED */
257265

266+
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
267+
#include "Legacy/stm32f1xx_hal_can_legacy.h"
268+
#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
269+
258270
#ifdef HAL_CEC_MODULE_ENABLED
259271
#include "stm32f1xx_hal_cec.h"
260272
#endif /* HAL_CEC_MODULE_ENABLED */
@@ -361,19 +373,7 @@ extern "C" {
361373

362374
/* Exported macro ------------------------------------------------------------*/
363375
#ifdef USE_FULL_ASSERT
364-
// MBED patch: all targets use the same assert file
365-
#include "stm32_assert.h"
366-
/**
367-
* @brief The assert_param macro is used for function's parameters check.
368-
* @param expr: If expr is false, it calls assert_failed function
369-
* which reports the name of the source file and the source
370-
* line number of the call that failed.
371-
* If expr is true, it returns no value.
372-
* @retval None
373-
*/
374-
//#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
375-
/* Exported functions ------------------------------------------------------- */
376-
//void assert_failed(uint8_t *file, uint32_t line);
376+
#include "stm32_assert.h" // MBED patch
377377
#else
378378
#define assert_param(expr) ((void)0U)
379379
#endif /* USE_FULL_ASSERT */

targets/TARGET_STM/TARGET_STM32F1/STM32Cube_FW/system_stm32f1xx.c

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
******************************************************************************
33
* @file system_stm32f1xx.c
44
* @author MCD Application Team
5-
* @version V4.2.0
6-
* @date 31-March-2017
75
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
86
*
97
* 1. This file provides two functions and one global variable to be called from
@@ -35,29 +33,13 @@
3533
******************************************************************************
3634
* @attention
3735
*
38-
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
36+
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
37+
* All rights reserved.</center></h2>
3938
*
40-
* Redistribution and use in source and binary forms, with or without modification,
41-
* are permitted provided that the following conditions are met:
42-
* 1. Redistributions of source code must retain the above copyright notice,
43-
* this list of conditions and the following disclaimer.
44-
* 2. Redistributions in binary form must reproduce the above copyright notice,
45-
* this list of conditions and the following disclaimer in the documentation
46-
* and/or other materials provided with the distribution.
47-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
48-
* may be used to endorse or promote products derived from this software
49-
* without specific prior written permission.
50-
*
51-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
52-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
53-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
54-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
55-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
56-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
57-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
58-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
59-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39+
* This software component is licensed by ST under BSD 3-Clause license,
40+
* the "License"; You may not use this file except in compliance with the
41+
* License. You may obtain a copy of the License at:
42+
* opensource.org/licenses/BSD-3-Clause
6143
*
6244
******************************************************************************
6345
*/
@@ -130,15 +112,15 @@
130112
* @{
131113
*/
132114

133-
/*******************************************************************************
134-
* Clock Definitions
135-
*******************************************************************************/
136-
#if defined(STM32F100xB) ||defined(STM32F100xE)
137-
uint32_t SystemCoreClock = 24000000U; /*!< System Clock Frequency (Core Clock) */
138-
#else /*!< HSI Selected as System Clock source */
139-
uint32_t SystemCoreClock = 72000000U; /*!< System Clock Frequency (Core Clock) */
140-
#endif
141-
115+
/* This variable is updated in three ways:
116+
1) by calling CMSIS function SystemCoreClockUpdate()
117+
2) by calling HAL API function HAL_RCC_GetHCLKFreq()
118+
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
119+
Note: If you use this function to configure the system clock; then there
120+
is no need to call the 2 first functions listed above, since SystemCoreClock
121+
variable is updated automatically.
122+
*/
123+
uint32_t SystemCoreClock = 16000000;
142124
const uint8_t AHBPrescTable[16U] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
143125
const uint8_t APBPrescTable[8U] = {0, 0, 0, 0, 1, 2, 3, 4};
144126

0 commit comments

Comments
 (0)