Skip to content

Commit 0484d81

Browse files
committed
Portenta: adapt HSE_VALUE to both beta and new boards
1 parent 8333932 commit 0484d81

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/system_stm32h7xx.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@
5252
#include <math.h>
5353
#include "nvic_addr.h" // MBED PATCH for Bootloader
5454

55-
#if defined (HSE_VALUE)
56-
#undef HSE_VALUE
57-
#endif /* HSE_VALUE */
55+
#if !defined (HSE_VALUE)
5856

59-
uint32_t HSE_VALUE = ((uint32_t)25000000);
57+
#endif /* HSE_VALUE */
6058

6159
#if !defined (CSI_VALUE)
6260
#define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
@@ -302,13 +300,6 @@ void SystemCoreClockUpdate (void)
302300
uint32_t pllp, pllsource, pllm, pllfracen, hsivalue, tmp;
303301
float_t fracn1, pllvco;
304302

305-
uint8_t* bootloader_data = (uint8_t*)(0x801F000);
306-
if (bootloader_data[0] != 0xA0 || bootloader_data[1] < 14) {
307-
HSE_VALUE = 27000000;
308-
} else {
309-
HSE_VALUE = bootloader_data[10] * 1000000;
310-
}
311-
312303
/* Get SYSCLK source -------------------------------------------------------*/
313304

314305
switch (RCC->CFGR & RCC_CFGR_SWS)

targets/targets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2703,7 +2703,7 @@
27032703
},
27042704
"hse_value": {
27052705
"help": "HSE default value is 27MHz in HAL",
2706-
"value": "25000000",
2706+
"value": "(isBetaBoard()?27000000:25000000)",
27072707
"macro_name": "HSE_VALUE"
27082708
},
27092709
"usb_speed": {

0 commit comments

Comments
 (0)