-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Add support for the STM32F072-EVAL Board #5171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the STM32F072-EVAL Board #5171
Conversation
524ad34
to
5478548
Compare
# Kconfig - ST Microelectronics STM32F072XB MCU | ||
# | ||
# Copyright (c) 2017 BayLibre, SAS | ||
# Author: Neil Armstron <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove Author line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix
dts/arm/st/stm32f072.dtsi
Outdated
@@ -0,0 +1,7 @@ | |||
/* | |||
* Copyright (c) Bobby Noelte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to Baylibre here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix
drivers/clock_control/Kconfig.stm32
Outdated
@@ -106,7 +106,7 @@ config CLOCK_STM32_PLL_PREDIV | |||
|
|||
config CLOCK_STM32_PLL_PREDIV1 | |||
int "PREDIV1 Prescaler" | |||
depends on CLOCK_STM32_PLL_SRC_HSE && (SOC_STM32F091XB || SOC_STM32F091XC) | |||
depends on CLOCK_STM32_PLL_SRC_HSE && (SOC_STM32F091XB || SOC_STM32F091XC || SOC_STM32F072XB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that valid for all F0X ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will have a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems only needed by the following parts:
stm32f030xc.h
stm32f042x6.h
stm32f048xx.h
stm32f070x6.h
stm32f070xb.h
stm32f071xb.h
stm32f072xb.h
stm32f078xx.h
stm32f091xc.h
stm32f098xx.h
And is not needed by:
stm32f030x6.h
stm32f030x8.h
stm32f031x6.h
stm32f038xx.h
stm32f051x8.h
stm32f058xx.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I think we should define a sub series or a CONFIG(CLOCK_STM32_PLL_PREDIV1_SUPPORT?) option to deal with this. Such as you've done for I2C.
(Unless you can find a clean way to get info from soc/stm32f0....h file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the socs supporting PREDIV1 declares RCC_PLLSRC_PREDIV1_SUPPORT, and it's only when the SoC has an HSE.
So we can say we remove the && (SOC_STM32F091XB || ...) and consider the config will be correct.
If someone tries to enable HSE on a invalid SoC, it won't harm because the code won't use the PREDIV1 value and the SoC will take the HSI source be default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, will work.
To avoid later confusion, could you document it config help section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean add a help block under CLOCK_STM32_PLL_PREDIV1 config ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok done
# Kconfig - STM32F072-EVAL board configuration | ||
# | ||
# Copyright (c) 2017 BayLibre, SAS | ||
# Author: Neil Armstrong <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove Author line. Apply everywhere.
Or did I missed a copyright policy update in the project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's me who missed an update since I always format my file headers like that other multiple project.
Anyway seems my previous zephyr commits didn't have the author line...
will remove !
Serial Port | ||
=========== | ||
|
||
STM32F072-EVAL Discovery kit has up to 4 UARTs. The Zephyr console output is assigned to UART1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UART2 maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix
5478548
to
06bfc71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggested doc edits
******** | ||
|
||
The STM32F072-EVAL Discovery kit features an ARM Cortex-M0 based STM32F072VBT6 MCU | ||
with a wide range of connectivity support and configurations Here are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a period after "configurations"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
with a wide range of connectivity support and configurations Here are | ||
some highlights of the STM32F072-EVAL board: | ||
|
||
- Four 5 V power supply options: power jack, ST-LINK/V2 USB connector, user USB connector or daughter board |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comma after "user USB connector"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
some highlights of the STM32F072-EVAL board: | ||
|
||
- Four 5 V power supply options: power jack, ST-LINK/V2 USB connector, user USB connector or daughter board | ||
- Stereo audio jack which supports a headset with microphone connected to DAC and ADC of STM32F072VBT6. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comma before "which"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- Reset and tamper buttons | ||
- Four color user LEDs and two LEDs as MCU low power alarm | ||
- Extension connector for daughter board or wrapping board | ||
- MCU voltage choice fixed 3.3 V or adjustable from 1.65 V to 3.6 V |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a colon (:) after "choice"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- CRC calculation unit | ||
- DMA Controller | ||
- HDMI CEC Controller | ||
- 24 capacitive sensing channels for touchkey, linear and rotary touch sensors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comma after "linear"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- DMA Controller | ||
- HDMI CEC Controller | ||
- 24 capacitive sensing channels for touchkey, linear and rotary touch sensors | ||
- Up to 87 fast I/Os, 68 I/Os with 5V tolerant capability and 19 with independent supply |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change I/Os,
to I/Os:
(colon instead of comma)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| IWDG | on-chip | independent watchdog | | ||
+-----------+------------+-------------------------------------+ | ||
|
||
Other hardware features are not yet supported on Zephyr porting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change "on Zephyr porting" to "on this Zephyr porting"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
System Clock | ||
============ | ||
|
||
STM32F072-EVAL System Clock could be driven by internal or external oscillator, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to "by an internal..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
============ | ||
|
||
STM32F072-EVAL System Clock could be driven by internal or external oscillator, | ||
as well as main PLL clock. By default System clock is driven by PLL clock at 48MHz, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to "the main PLL clock", "the System clock", and "the PLL clock"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
STM32F072-EVAL System Clock could be driven by internal or external oscillator, | ||
as well as main PLL clock. By default System clock is driven by PLL clock at 48MHz, | ||
driven by 8MHz high speed internal clock. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to "by an 8MHz"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
06bfc71
to
246389d
Compare
Can the STM32 tag be added ? |
Done |
drivers/clock_control/Kconfig.stm32
Outdated
@@ -106,7 +106,7 @@ config CLOCK_STM32_PLL_PREDIV | |||
|
|||
config CLOCK_STM32_PLL_PREDIV1 | |||
int "PREDIV1 Prescaler" | |||
depends on CLOCK_STM32_PLL_SRC_HSE && (SOC_STM32F091XB || SOC_STM32F091XC) | |||
depends on CLOCK_STM32_PLL_SRC_HSE && (SOC_STM32F091XB || SOC_STM32F091XC || SOC_STM32F072XB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, will work.
To avoid later confusion, could you document it config help section?
246389d
to
55b8095
Compare
55b8095
to
0d0295e
Compare
f0a9535
to
2b46442
Compare
@superna9999: #5515 is now merged on master and also available on main branch. You can rebase now. |
835313d
to
d0df482
Compare
Codecov Report
@@ Coverage Diff @@
## master #5171 +/- ##
======================================
Coverage 51.3% 51.3%
======================================
Files 441 441
Lines 42259 42259
Branches 8061 8061
======================================
Hits 21680 21680
Misses 20060 20060
Partials 519 519 Continue to review full report at Codecov.
|
recheck |
string | ||
default stm32f072xb | ||
|
||
config FLASH_PAGE_SIZE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at the F0 flash driver yet, but if this value isn't coming from DT, why not just use FLASH_PAGE_SIZE as defined in drivers/include/stm32f0xx_hal_flash_ex.h?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems sane for now. I guess the buttons etc. will move to DT gradually as discussed elsewhere?
Can we fix the commit message issue |
@galak all my commit messages are correct, and the reported commit in the error "ca4123d537" is none of my commits. |
I can't find commit ca4123d537 anywhere in the repo. Recheck? |
@nashif : Seems Shippable is blocked by a ghost commit: |
@superna9999 should work now, at least it works for me in #5405 where I used your commits, rebased them onto master and added stm32f072b_disco board configuration |
Support the ST STM32F072xB SoC. Signed-off-by: Neil Armstrong <[email protected]>
Remove SoCs part dependency of CLOCK_STM32_PLL_PREDIV1 config since it will only be used on parts having an HSE oscillator, ignored otherwise. Signed-off-by: Neil Armstrong <[email protected]>
Add the STM32F072-EVAL Board minimal support. Signed-off-by: Neil Armstrong <[email protected]>
d0df482
to
e8100c3
Compare
@erwango you good with this? |
@dbkinder docs look good? |
@dbkinder : Ping about docs. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for docs, thanks!
This PR adds minimal support for the STM32F072-EVAL Evaluation board.