Skip to content

Commit ee0bfc9

Browse files
committed
2 parents 39bb741 + 3c9aa02 commit ee0bfc9

21 files changed

Lines changed: 126 additions & 128 deletions

File tree

boards.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Nucleo_144.menu.pnum.NUCLEO_F207ZG.build.cmsis_lib_gcc=arm_cortexM3l_math
3737
Nucleo_144.menu.pnum.NUCLEO_F429ZI=Nucleo F429ZI
3838
Nucleo_144.menu.pnum.NUCLEO_F429ZI.node=NODE_F429ZI
3939
Nucleo_144.menu.pnum.NUCLEO_F429ZI.upload.maximum_size=2097152
40-
Nucleo_144.menu.pnum.NUCLEO_F429ZI.upload.maximum_data_size=262144
40+
Nucleo_144.menu.pnum.NUCLEO_F429ZI.upload.maximum_data_size=196608
4141
Nucleo_144.menu.pnum.NUCLEO_F429ZI.build.mcu=cortex-m4
4242
Nucleo_144.menu.pnum.NUCLEO_F429ZI.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
4343
Nucleo_144.menu.pnum.NUCLEO_F429ZI.build.board=NUCLEO_F429ZI
@@ -398,7 +398,7 @@ Nucleo_64.menu.pnum.NUCLEO_L476RG.build.cmsis_lib_gcc=arm_cortexM4lf_math
398398

399399
# PNUCLEO_WB55RG board
400400
Nucleo_64.menu.pnum.PNUCLEO_WB55RG=P-Nucleo WB55RG
401-
Nucleo_64.menu.pnum.PNUCLEO_WB55RG.node=NODE_WB55RG
401+
Nucleo_64.menu.pnum.PNUCLEO_WB55RG.node="NODE_WB55RG,NOD_WB55RG"
402402
Nucleo_64.menu.pnum.PNUCLEO_WB55RG.upload.maximum_size=524288
403403
Nucleo_64.menu.pnum.PNUCLEO_WB55RG.upload.maximum_data_size=196604
404404
Nucleo_64.menu.pnum.PNUCLEO_WB55RG.build.mcu=cortex-m4
@@ -571,7 +571,7 @@ Disco.menu.pnum.DISCO_F100RB.build.cmsis_lib_gcc=arm_cortexM3l_math
571571
Disco.menu.pnum.DISCO_F407VG=STM32F407G-DISC1
572572
Disco.menu.pnum.DISCO_F407VG.node=DIS_F407VG
573573
Disco.menu.pnum.DISCO_F407VG.upload.maximum_size=1048576
574-
Disco.menu.pnum.DISCO_F407VG.upload.maximum_data_size=196608
574+
Disco.menu.pnum.DISCO_F407VG.upload.maximum_data_size=131072
575575
Disco.menu.pnum.DISCO_F407VG.build.mcu=cortex-m4
576576
Disco.menu.pnum.DISCO_F407VG.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
577577
Disco.menu.pnum.DISCO_F407VG.build.board=DISCO_F407VG
@@ -1137,23 +1137,23 @@ GenF4.menu.pnum.Generic_F423CH.build.variant=Generic_F4x3Cx
11371137
# Generic F417VG
11381138
GenF4.menu.pnum.Generic_F417VG=Generic F417VG
11391139
GenF4.menu.pnum.Generic_F417VG.upload.maximum_size=1048576
1140-
GenF4.menu.pnum.Generic_F417VG.upload.maximum_data_size=196608
1140+
GenF4.menu.pnum.Generic_F417VG.upload.maximum_data_size=131072
11411141
GenF4.menu.pnum.Generic_F417VG.build.board=GENERIC_F417VG
11421142
GenF4.menu.pnum.Generic_F417VG.build.product_line=STM32F417xx
11431143
GenF4.menu.pnum.Generic_F417VG.build.variant=Generic_F4x7Vx
11441144

11451145
# Generic F417VE
11461146
GenF4.menu.pnum.Generic_F417VE=Generic F417VE
11471147
GenF4.menu.pnum.Generic_F417VE.upload.maximum_size=524288
1148-
GenF4.menu.pnum.Generic_F417VE.upload.maximum_data_size=196608
1148+
GenF4.menu.pnum.Generic_F417VE.upload.maximum_data_size=131072
11491149
GenF4.menu.pnum.Generic_F417VE.build.board=GENERIC_F417VE
11501150
GenF4.menu.pnum.Generic_F417VE.build.product_line=STM32F417xx
11511151
GenF4.menu.pnum.Generic_F417VE.build.variant=Generic_F4x7Vx
11521152

11531153
# Generic F415RG
11541154
GenF4.menu.pnum.Generic_F415RG=Generic F415RG
11551155
GenF4.menu.pnum.Generic_F415RG.upload.maximum_size=1048576
1156-
GenF4.menu.pnum.Generic_F415RG.upload.maximum_data_size=196608
1156+
GenF4.menu.pnum.Generic_F415RG.upload.maximum_data_size=131072
11571157
GenF4.menu.pnum.Generic_F415RG.build.board=GENERIC_F415RG
11581158
GenF4.menu.pnum.Generic_F415RG.build.product_line=STM32F415xx
11591159
GenF4.menu.pnum.Generic_F415RG.build.variant=Generic_F4x5RG
@@ -1180,7 +1180,7 @@ GenF4.menu.pnum.Generic_F413CH.upload.maximum_size=1572864
11801180
GenF4.menu.pnum.Generic_F413CH.upload.maximum_data_size=327680
11811181
GenF4.menu.pnum.Generic_F413CH.build.board=GENERIC_F413CH
11821182
GenF4.menu.pnum.Generic_F413CH.build.product_line=STM32F413xx
1183-
GenF4.menu.pnum.Generic_F413CH.build.variant=Generic_F4x3Rx
1183+
GenF4.menu.pnum.Generic_F413CH.build.variant=Generic_F4x3Cx
11841184

11851185
# Generic F413CG
11861186
GenF4.menu.pnum.Generic_F413CG=Generic F413CG
@@ -1289,23 +1289,23 @@ GenF4.menu.pnum.Generic_F410C8.build.variant=Generic_F410Cx
12891289
# Generic F407VG
12901290
GenF4.menu.pnum.Generic_F407VG=Generic F407VG
12911291
GenF4.menu.pnum.Generic_F407VG.upload.maximum_size=1048576
1292-
GenF4.menu.pnum.Generic_F407VG.upload.maximum_data_size=196608
1292+
GenF4.menu.pnum.Generic_F407VG.upload.maximum_data_size=131072
12931293
GenF4.menu.pnum.Generic_F407VG.build.board=GENERIC_F407VG
12941294
GenF4.menu.pnum.Generic_F407VG.build.product_line=STM32F407xx
12951295
GenF4.menu.pnum.Generic_F407VG.build.variant=Generic_F4x7Vx
12961296

12971297
# Generic F407VE
12981298
GenF4.menu.pnum.Generic_F407VE=Generic F407VE
12991299
GenF4.menu.pnum.Generic_F407VE.upload.maximum_size=524288
1300-
GenF4.menu.pnum.Generic_F407VE.upload.maximum_data_size=196608
1300+
GenF4.menu.pnum.Generic_F407VE.upload.maximum_data_size=131072
13011301
GenF4.menu.pnum.Generic_F407VE.build.board=GENERIC_F407VE
13021302
GenF4.menu.pnum.Generic_F407VE.build.product_line=STM32F407xx
13031303
GenF4.menu.pnum.Generic_F407VE.build.variant=Generic_F4x7Vx
13041304

13051305
# Generic F405RG
13061306
GenF4.menu.pnum.Generic_F405RG=Generic F405RG
13071307
GenF4.menu.pnum.Generic_F405RG.upload.maximum_size=1048576
1308-
GenF4.menu.pnum.Generic_F405RG.upload.maximum_data_size=196608
1308+
GenF4.menu.pnum.Generic_F405RG.upload.maximum_data_size=131072
13091309
GenF4.menu.pnum.Generic_F405RG.build.board=GENERIC_F405RG
13101310
GenF4.menu.pnum.Generic_F405RG.build.product_line=STM32F405xx
13111311
GenF4.menu.pnum.Generic_F405RG.build.variant=Generic_F4x5RG
@@ -1613,7 +1613,7 @@ LoRa.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
16131613
# PRNTR_F407_V1 board
16141614
3dprinter.menu.pnum.PRNTR_F407_V1=PRNTR F407 v1
16151615
3dprinter.menu.pnum.PRNTR_F407_V1.upload.maximum_size=524288
1616-
3dprinter.menu.pnum.PRNTR_F407_V1.upload.maximum_data_size=196608
1616+
3dprinter.menu.pnum.PRNTR_F407_V1.upload.maximum_data_size=131072
16171617
3dprinter.menu.pnum.PRNTR_F407_V1.build.mcu=cortex-m4
16181618
3dprinter.menu.pnum.PRNTR_F407_V1.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
16191619
3dprinter.menu.pnum.PRNTR_F407_V1.build.board=PRNTR_F407_V1
@@ -1625,7 +1625,7 @@ LoRa.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
16251625
# PRNTR_V2 board
16261626
3dprinter.menu.pnum.PRNTR_V2=PRNTR v2
16271627
3dprinter.menu.pnum.PRNTR_V2.upload.maximum_size=524288
1628-
3dprinter.menu.pnum.PRNTR_V2.upload.maximum_data_size=196608
1628+
3dprinter.menu.pnum.PRNTR_V2.upload.maximum_data_size=131072
16291629
3dprinter.menu.pnum.PRNTR_V2.build.mcu=cortex-m4
16301630
3dprinter.menu.pnum.PRNTR_V2.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
16311631
3dprinter.menu.pnum.PRNTR_V2.build.board=PRNTR_V2

cores/arduino/HardwareTimer.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,20 @@ void HardwareTimer::setMode(uint32_t channel, TimerModes_t mode, PinName pin)
690690
}
691691
}
692692

693+
/**
694+
* @brief Retrieves channel mode configured
695+
* @param channel: Arduino channel [1..4]
696+
* @retval returns configured mode
697+
*/
698+
TimerModes_t HardwareTimer::getMode(uint32_t channel)
699+
{
700+
if ((1 <= channel) && (channel <= TIMER_CHANNELS)) {
701+
return _ChannelMode[channel - 1];
702+
} else {
703+
return TIMER_DISABLED;
704+
}
705+
}
706+
693707
/**
694708
* @brief Enable or disable preloading for overflow value
695709
* When disabled, changes to the overflow value take effect

cores/arduino/HardwareTimer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ class HardwareTimer {
118118
void setMode(uint32_t channel, TimerModes_t mode, PinName pin = NC); // Configure timer channel with specified mode on specified pin if available
119119
void setMode(uint32_t channel, TimerModes_t mode, uint32_t pin);
120120

121+
TimerModes_t getMode(uint32_t channel); // Retrieve configured mode
122+
121123
void setPreloadEnable(bool value); // Configure overflow preload enable setting
122124

123125
uint32_t getCaptureCompare(uint32_t channel, TimerCompareFormat_t format = TICK_COMPARE_FORMAT); // return Capture/Compare register value of specified channel depending on format provided

libraries/SrcWrapper/src/stm32/analog.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,7 @@ void pwm_start(PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareForma
10281028
{
10291029
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin, PinMap_PWM);
10301030
HardwareTimer *HT;
1031+
TimerModes_t previousMode;
10311032
uint32_t index = get_timer_index(Instance);
10321033
if (HardwareTimer_Handle[index] == NULL) {
10331034
HardwareTimer_Handle[index]->__this = new HardwareTimer((TIM_TypeDef *)pinmap_peripheral(pin, PinMap_PWM));
@@ -1037,10 +1038,15 @@ void pwm_start(PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareForma
10371038

10381039
uint32_t channel = STM_PIN_CHANNEL(pinmap_function(pin, PinMap_PWM));
10391040

1040-
HT->setMode(channel, TIMER_OUTPUT_COMPARE_PWM1, pin);
1041+
previousMode = HT->getMode(channel);
1042+
if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) {
1043+
HT->setMode(channel, TIMER_OUTPUT_COMPARE_PWM1, pin);
1044+
}
10411045
HT->setOverflow(PWM_freq, HERTZ_FORMAT);
10421046
HT->setCaptureCompare(channel, value, resolution);
1043-
HT->resume();
1047+
if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) {
1048+
HT->resume();
1049+
}
10441050
}
10451051
/**
10461052
* @brief This function will disable the PWM

variants/BLACK_F407XX/variant.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ WEAK void SystemClock_Config(void)
222222
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
223223
_Error_Handler(__FILE__, __LINE__);
224224
}
225+
226+
/* Ensure CCM RAM clock is enabled */
227+
__HAL_RCC_CCMDATARAMEN_CLK_ENABLE();
228+
225229
}
226230

227231
#ifdef __cplusplus

variants/BLUE_F407VE_Mini/variant.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ WEAK void SystemClock_Config(void)
205205
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
206206
_Error_Handler(__FILE__, __LINE__);
207207
}
208+
209+
/* Ensure CCM RAM clock is enabled */
210+
__HAL_RCC_CCMDATARAMEN_CLK_ENABLE();
211+
208212
}
209213

210214
#ifdef __cplusplus

variants/DISCO_F407VG/ldscript.ld

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414
**
1515
** Target : STMicroelectronics STM32
1616
**
17-
**
18-
** Distribution: The file is distributed as is, without any warranty
17+
** Distribution: The file is distributed “as is,” without any warranty
1918
** of any kind.
2019
**
2120
*****************************************************************************
2221
** @attention
2322
**
24-
** <h2><center>&copy; COPYRIGHT(c) 2014 Ac6</center></h2>
23+
** <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
2524
**
2625
** Redistribution and use in source and binary forms, with or without modification,
2726
** are permitted provided that the following conditions are met:
@@ -30,7 +29,7 @@
3029
** 2. Redistributions in binary form must reproduce the above copyright notice,
3130
** this list of conditions and the following disclaimer in the documentation
3231
** and/or other materials provided with the distribution.
33-
** 3. Neither the name of Ac6 nor the names of its contributors
32+
** 3. Neither the name of STMicroelectronics nor the names of its contributors
3433
** may be used to endorse or promote products derived from this software
3534
** without specific prior written permission.
3635
**
@@ -54,15 +53,15 @@ ENTRY(Reset_Handler)
5453
/* Highest address of the user mode stack */
5554
_estack = 0x20020000; /* end of RAM */
5655
/* Generate a link error if heap and stack don't fit into RAM */
57-
_Min_Heap_Size = 0x200;; /* required amount of heap */
58-
_Min_Stack_Size = 0x400;; /* required amount of stack */
56+
_Min_Heap_Size = 0x200; /* required amount of heap */
57+
_Min_Stack_Size = 0x400; /* required amount of stack */
5958

6059
/* Specify the memory areas */
6160
MEMORY
6261
{
63-
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
6462
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
6563
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
64+
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
6665
}
6766

6867
/* Define output sections */
@@ -77,7 +76,7 @@ SECTIONS
7776
} >FLASH
7877

7978
/* The program code and other data goes into FLASH */
80-
.text ALIGN(4):
79+
.text :
8180
{
8281
. = ALIGN(4);
8382
*(.text) /* .text sections (code) */
@@ -94,7 +93,7 @@ SECTIONS
9493
} >FLASH
9594

9695
/* Constant data goes into FLASH */
97-
.rodata ALIGN(4):
96+
.rodata :
9897
{
9998
. = ALIGN(4);
10099
*(.rodata) /* .rodata sections (constants, strings, etc.) */
@@ -184,12 +183,12 @@ SECTIONS
184183
/* User_heap_stack section, used to check that there is enough RAM left */
185184
._user_heap_stack :
186185
{
187-
. = ALIGN(4);
186+
. = ALIGN(8);
188187
PROVIDE ( end = . );
189188
PROVIDE ( _end = . );
190189
. = . + _Min_Heap_Size;
191190
. = . + _Min_Stack_Size;
192-
. = ALIGN(4);
191+
. = ALIGN(8);
193192
} >RAM
194193

195194

variants/DISCO_F407VG/variant.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ WEAK void SystemClock_Config(void)
190190
/* Enable the Flash prefetch */
191191
__HAL_FLASH_PREFETCH_BUFFER_ENABLE();
192192
}
193+
194+
/* Ensure CCM RAM clock is enabled */
195+
__HAL_RCC_CCMDATARAMEN_CLK_ENABLE();
196+
193197
}
194198

195199
#ifdef __cplusplus

variants/DIYMORE_F407VGT/variant.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ WEAK void SystemClock_Config(void)
206206
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
207207
_Error_Handler(__FILE__, __LINE__);
208208
}
209+
210+
/* Ensure CCM RAM clock is enabled */
211+
__HAL_RCC_CCMDATARAMEN_CLK_ENABLE();
212+
209213
}
210214

211215
#ifdef __cplusplus

variants/FEATHER_F405/variant.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ WEAK void SystemClock_Config(void)
132132
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
133133
_Error_Handler(__FILE__, __LINE__);
134134
}
135+
136+
/* Ensure CCM RAM clock is enabled */
137+
__HAL_RCC_CCMDATARAMEN_CLK_ENABLE();
138+
135139
}
136140

137141
#ifdef __cplusplus

0 commit comments

Comments
 (0)