Skip to content

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

Merged
merged 3 commits into from
Jan 25, 2018

Conversation

superna9999
Copy link
Collaborator

This PR adds minimal support for the STM32F072-EVAL Evaluation board.

# Kconfig - ST Microelectronics STM32F072XB MCU
#
# Copyright (c) 2017 BayLibre, SAS
# Author: Neil Armstron <[email protected]>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove Author line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix

@@ -0,0 +1,7 @@
/*
* Copyright (c) Bobby Noelte
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to Baylibre here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix

@@ -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)
Copy link
Member

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 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will have a look

Copy link
Collaborator Author

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

Copy link
Member

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)

Copy link
Collaborator Author

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.

Copy link
Member

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?

Copy link
Collaborator Author

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 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Collaborator Author

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]>
Copy link
Member

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?

Copy link
Collaborator Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UART2 maybe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix

@superna9999 superna9999 force-pushed the for-pr/stm32f072_eval branch from 5478548 to 06bfc71 Compare November 27, 2017 15:49
Copy link
Contributor

@dbkinder dbkinder left a 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
Copy link
Contributor

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"

Copy link
Collaborator Author

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
Copy link
Contributor

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"

Copy link
Collaborator Author

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.
Copy link
Contributor

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"

Copy link
Collaborator Author

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
Copy link
Contributor

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"

Copy link
Collaborator Author

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
Copy link
Contributor

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"

Copy link
Collaborator Author

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
Copy link
Contributor

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)

Copy link
Collaborator Author

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.
Copy link
Contributor

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"

Copy link
Collaborator Author

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,
Copy link
Contributor

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..."

Copy link
Collaborator Author

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,
Copy link
Contributor

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"

Copy link
Collaborator Author

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.
Copy link
Contributor

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"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@superna9999 superna9999 force-pushed the for-pr/stm32f072_eval branch from 06bfc71 to 246389d Compare November 28, 2017 09:10
@superna9999
Copy link
Collaborator Author

Can the STM32 tag be added ?
Howcome I can change tags to other PRs but not mines ?? is this a wanted policy ?

@pfalcon pfalcon added the platform: STM32 ST Micro STM32 label Nov 28, 2017
@pfalcon
Copy link
Collaborator

pfalcon commented Nov 28, 2017

Can the STM32 tag be added ?

Done

@nashif nashif added this to the v1.11.0 milestone Nov 28, 2017
@@ -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)
Copy link
Member

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?

@superna9999 superna9999 force-pushed the for-pr/stm32f072_eval branch from 246389d to 55b8095 Compare December 5, 2017 14:10
@galak galak added the area: ARM ARM (32-bit) Architecture label Dec 6, 2017
erwango
erwango previously approved these changes Dec 6, 2017
@superna9999 superna9999 force-pushed the for-pr/stm32f072_eval branch from 55b8095 to 0d0295e Compare December 7, 2017 08:31
@superna9999 superna9999 changed the title Add support for the STM32F071-EVAL Board Add support for the STM32F072-EVAL Board Dec 7, 2017
@superna9999 superna9999 changed the base branch from master to arm December 7, 2017 08:31
@superna9999
Copy link
Collaborator Author

@galak I just rebased on arm branch and fixed merge conflicts, it may still conflict with #5199

@superna9999 superna9999 changed the base branch from arm to master December 11, 2017 15:07
@superna9999 superna9999 force-pushed the for-pr/stm32f072_eval branch 2 times, most recently from f0a9535 to 2b46442 Compare December 11, 2017 15:13
@superna9999 superna9999 changed the base branch from master to arm December 11, 2017 15:13
@galak galak self-assigned this Dec 12, 2017
@erwango
Copy link
Member

erwango commented Jan 12, 2018

@superna9999: #5515 is now merged on master and also available on main branch. You can rebase now.

@codecov-io
Copy link

codecov-io commented Jan 12, 2018

Codecov Report

Merging #5171 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55d3ce1...e8100c3. Read the comment docs.

@superna9999 superna9999 changed the base branch from master to arm January 12, 2018 15:30
@superna9999
Copy link
Collaborator Author

recheck

string
default stm32f072xb

config FLASH_PAGE_SIZE
Copy link
Contributor

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?

Copy link
Contributor

@mbolivar mbolivar left a 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?

@galak
Copy link
Collaborator

galak commented Jan 13, 2018

Can we fix the commit message issue

@superna9999 superna9999 changed the base branch from arm to master January 15, 2018 08:37
@superna9999
Copy link
Collaborator Author

superna9999 commented Jan 15, 2018

@galak all my commit messages are correct, and the reported commit in the error "ca4123d537" is none of my commits.

@dwagenk
Copy link
Contributor

dwagenk commented Jan 15, 2018

I can't find commit ca4123d537 anywhere in the repo. Recheck?

@erwango
Copy link
Member

erwango commented Jan 15, 2018

@nashif : Seems Shippable is blocked by a ghost commit:
Commit ca4123d537: 1: UC6 Body has no content, should at least have 1 line.
Can you have a look?

@dwagenk
Copy link
Contributor

dwagenk commented Jan 18, 2018

@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]>
@superna9999 superna9999 force-pushed the for-pr/stm32f072_eval branch from d0df482 to e8100c3 Compare January 18, 2018 12:51
@superna9999
Copy link
Collaborator Author

@dwagenk done thanks
@galak all is ok, I just rebased on master

@galak
Copy link
Collaborator

galak commented Jan 23, 2018

@erwango you good with this?

@galak
Copy link
Collaborator

galak commented Jan 23, 2018

@dbkinder docs look good?

@pfalcon
Copy link
Collaborator

pfalcon commented Jan 25, 2018

@dbkinder : Ping about docs. Thanks.

Copy link
Contributor

@dbkinder dbkinder left a 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!

@galak galak merged commit 7474ad6 into zephyrproject-rtos:master Jan 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture area: Boards platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants