Skip to content
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

Nucleo f030r8 #1103

Closed
Closed

Conversation

MaciejDebski
Copy link

ZEP-2492
boards: provide support for Nucleo-64 F030R8

@MaciejDebski
Copy link
Author

@apodogrocki, @erwango, @ydamigos
Would you be so kind as to review my code, please?

Copy link
Collaborator

@ydamigos ydamigos left a comment

Choose a reason for hiding this comment

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

After the introduction of pinctrl nodes and uart pinctrl configuration in stm32 socs DT files, the F0 family should follow the same approach. Please consider to add also a stm32f0.dtsi file for the F0 series.


Overview
********
STM32 Nucleo-64 development board with STM32F030R8 MCU, supports Arduino and ST morpho connectivity.
Copy link
Contributor

Choose a reason for hiding this comment

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

The STM32 ...


The STM32 Nucleo board provides an affordable and flexible way for users to try out new concepts,
and build prototypes with the STM32 microcontroller, choosing from the various
combinations of performance, power consumption and features.
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 the "and"

expansion of the STM32 Nucleo open development platform with a wide choice of
specialized shields.

The STM32 Nucleo board does not require any separate probe as it integrates the ST-LINK/V2-1
Copy link
Contributor

Choose a reason for hiding this comment

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

recommend deleting "does not require any separate probe as it"

========

Nucleo F030R8 board includes an ST-LINK/V2-1 embedded debug tool interface.
This interface is supported by the openocd version included in Zephyr SDK.
Copy link
Contributor

Choose a reason for hiding this comment

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

in the Zephyr SDK.

Flashing an application to Nucleo F030R8
----------------------------------------

The sample application `blinky` is being used in this tutorial:
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

 :ref:`blinky-sample`

----------------------------------------

The sample application `blinky` is being used in this tutorial:

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend deleting this code block (and change the colon ":" on the previous line to end with a period.


$ make BOARD=nucleo_f030r8 flash

Run a serial host program to connect with your Nucleo board:
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking, do you need to connect a serial host for this app? What's written to the console?

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.

a few recommended changes

@galak galak self-assigned this Aug 14, 2017
Copy link
Collaborator

@galak galak left a comment

Choose a reason for hiding this comment

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

The hal import should separate the import of code from the adding Kconfig/Makefile for building it.

Also, the commit message should include the source (where to find the HAL)

Example:

commit 0015544
Author: Erwan Gouriou erwan.gouriou@linaro.org
Date: Wed Nov 9 15:23:39 2016 +0100

stm32cube: Introduce STM32Cube for STM32F2xx series

With this commit we provide header and HAL/LL files for all STM32F2
SoCs.
Using STM32Cube provides generic access to all families, maximizes
code reuse across different STM32 families and helps taking benefit
of a mature SDK

Origin: STM32Cube
URL: http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef2.html
Purpose: Introduction of STM32F2xx STM32Cube definitions
and Abstraction Layers
Maintained-by: External

Original STM32Cube tree structure has been modified to a minimum
structure for a better fit into Zephyr. hal is split into 2 parts:
-driver: initially Drivers/STM32F2xx_HAL_Driver, contains HAL and LL
-soc: initially Drivers/CMSIS/Device/ST/STM32F2xx, contains stm32f2xx
socs header files

Change-Id: I78a4716d495ce3f3038a442e19a0403f0f00506c
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>

@nashif
Copy link
Member

nashif commented Aug 14, 2017

Also, the commit message should include the source (where to find the HAL)

please look at CONTRIBUTING.rst or https://www.zephyrproject.org/doc/contribute/contribute_guidelines.html#identifying-contribution-origin

Copy link
Collaborator

@galak galak left a comment

Choose a reason for hiding this comment

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

Some changes/issues with the interrupt changes

@@ -6,20 +6,21 @@ ccflags-$(CONFIG_PINMUX_QMSI) += -I$(CONFIG_QMSI_INSTALL_PATH)/include
obj-$(CONFIG_PINMUX_MCUX) += pinmux_mcux.o
obj-$(CONFIG_PINMUX_STM32) += stm32/pinmux_stm32.o
obj-$(CONFIG_PINMUX_BEETLE) += beetle/pinmux_board_v2m_beetle.o
obj-$(CONFIG_BOARD_NUCLEO_F103RB) += stm32/pinmux_board_nucleo_f103rb.o
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure why the changes, here. But lets put the board pinmux in boards/arm/nucleo_f030r8/pinmux.c

Copy link
Author

Choose a reason for hiding this comment

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

The changes are just to put the nucleo boards in order.
As for pinmux, I will follow the include/dt-bindings convention, and I will leave the boards/ as it is in the rest of nucleos.

Copy link
Member

Choose a reason for hiding this comment

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

STM32 boards pinmux code has been moved recenlty with #1301 (merged in ARM branch for now).
Please update according to this change (maybe rebase on ARM branch to do so)

Copy link
Author

Choose a reason for hiding this comment

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

@erwango I moved the drivers/pinmux/stm32/pinmux_board_nucleo_f030r8.c to boards/arm/nucleo_f030r8/pinmux.c. Is that what you mean?

Copy link
Member

@erwango erwango Sep 5, 2017

Choose a reason for hiding this comment

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

Yes, and then you should not need to impact pinmux makefile anymore.
You could also rework commit title as this one is no more specific to nucleo f030 board

@@ -13,6 +13,36 @@ config EXTI_STM32
help
Enable EXTI driver for STM32 line of MCUs

if SOC_SERIES_STM32F0X
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need this if? We dont for any other of the STM32 SoC families

@@ -270,7 +304,6 @@ static inline void __stm32_exti_isr_15_10(void *arg)
__stm32_exti_isr(10, 16, arg);
}

#ifdef CONFIG_SOC_SERIES_STM32F4X
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like this shouldn't be removed

Seems like #if defined(CONFIG_SOC_SERIES_STM32F0X) || defined(CONFIG_SOC_SERIES_STM32F4X)

@galak galak added this to the v1.10 milestone Aug 16, 2017
@MaciejDebski MaciejDebski force-pushed the nucleo_f030r8 branch 2 times, most recently from 359bdf4 to 416d9b6 Compare August 22, 2017 14:28
@galak
Copy link
Collaborator

galak commented Aug 30, 2017

@MaciejDebski is this now working for you with the pinmux/dts changes?

@MaciejDebski
Copy link
Author

@galak Yes, I did manage to make it work for new pinmux/dts in the end, but there were a problem on the way, totally somewhere else. Some small snippet of code concerning aliasing flash memory in my cortex, which was added recently by someone else, was messing everything up. I described it in this months zephyr-devel, in the mail named: Adding Nucleo-F030R8 support to Zephyr - runtime error.

I still have to post issue on github, but I am not going to change my pull request code, it should be all good. Is it OK?

@MaciejDebski
Copy link
Author

@nashif Thank you for your help, it is fixed now!

@MaciejDebski
Copy link
Author

@galak HAL libs and Kconfig/Makefile are now separated. Thank you.

@MaciejDebski
Copy link
Author

@dbkinder All the recommended changes are implemented, thank you!

@MaciejDebski
Copy link
Author

@ydamigos The new approach to pinmux/dts is implemented, thank you!

#include <stm32f0xx.h>

/* IO pin functions */
enum stm32f0x_pin_config_mode {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still need this enumeration?

@MaciejDebski
Copy link
Author

@ydamigos enum in arch/arm/soc/st_stm32/stm32f0/soc.h was not necessary to compile. Updated. Thank you.

@@ -223,7 +236,9 @@ static int stm32_clock_control_init(struct device *dev)

/* Disable other clocks */
LL_RCC_HSE_Disable();
#ifndef CONFIG_SOC_SERIES_STM32F0X
Copy link
Member

Choose a reason for hiding this comment

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

Remove the #ifdef here, as you defined LL_RCC_MSI_Disable in stm32_f0_ll_clock.c file
It helps reducing the use of ifdef in this generic file (when doable)

@@ -239,7 +254,10 @@ static int stm32_clock_control_init(struct device *dev)

/* Disable other clocks */
LL_RCC_HSI_Disable();

#ifndef CONFIG_SOC_SERIES_STM32F0X
Copy link
Member

Choose a reason for hiding this comment

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

Same here

LL_RCC_MSI_Disable();
#endif /* CONFIG_SOC_SERIES_STM32F0X */
Copy link
Member

Choose a reason for hiding this comment

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

same here

<< RCC_CFGR_PLLMUL_Pos);
#if defined(RCC_PLLSRC_PREDIV1_SUPPORT)
/* PREDIV support is a specific RCC configuration present on */
/* following SoCs: STM32F302XE, STM32F303xE and STM32F398xx */
Copy link
Member

Choose a reason for hiding this comment

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

Update comment

Maciej Debski added 10 commits September 14, 2017 17:48
The commit delivers HAL/LL static library source files for STM32F0 SoC.
Using STM32Cube provides generic access to all families, maximizes
code reuse across different STM32 families and helps taking benefits
of a mature SDK.

Origin: STM32Cube
URL: http://www.st.com/en/embedded-software/stm32cubef0.html
Purpose: Introduction of STM32F0xx STM32Cube definitions
and Abstraction Layers
Maintained-by: External

Original STM32Cube tree structure has been modified to a minimum
structure for a better fit into Zephyr. HAL is split into 2 parts:
-driver: initially Drivers/STM32F0xx_HAL_Driver, contains HAL and LL
-soc: initially Drivers/CMSIS/Device/ST/STM32F0xx, contains stm32f0xx
SoCs header files.

JIRA: ZEP-2492

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
JIRA: ZEP-2492

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
JIRA: ZEP-2492

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
JIRA: ZEP-2492

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
JIRA: ZEP-2492

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
JIRA: ZEP-2492

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
JIRA: ZEP-2492

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
JIRA: ZEP-2492

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
JIRA: ZEP-2492

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
JIRA: ZEP-2492

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
@MaciejDebski
Copy link
Author

@superna9999
Updated to 1.9, thank you!

Some SOCs (e.g. STM32F0) can map the flash to address 0 and
the flash base address at the same time. Prevent writing to
duplicate flash address which stops the SOC.

Allow Cortex M SOCs to create their own vector table relocation
function.

Provide a relocation function for STM32F0x SOCs.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
@superna9999
Copy link
Collaborator

Hi @MaciejDebski @galak

the issue about missing memory was discusses on the mailing-list, it should be solved since all other points were solved.

@b0661
Copy link
Collaborator

b0661 commented Oct 4, 2017

Hello @MaciejDebski @superna9999

the commit b0661@30e4e71 should make the pull request pass CI.

@superna9999 You mentioned that the missing memory was already discussed on the mailing list and solved. I did not find the solution. Don´t we need the commit above?

@MaciejDebski Do you plan to integrate the commit? If you like I can create a combined pull request that takes your pull request as the basis https://github.com/b0661/zephyr/tree/stm32f0_nucleos

Regards
Bobby

@superna9999
Copy link
Collaborator

@b0661 In was referencing the solution you provide in this commit

@superna9999
Copy link
Collaborator

@MaciejDebski Would you want @b0661 or me to take over this PR (while keeping your authorship) if you don't have enough time ?
We have at least 2 more F0 SoCs/Boards to submit following this PR

@apodogrocki
Copy link
Contributor

apodogrocki commented Oct 9, 2017 via email

@superna9999 superna9999 mentioned this pull request Oct 11, 2017
@erwango
Copy link
Member

erwango commented Oct 11, 2017 via email

@apodogrocki
Copy link
Contributor

apodogrocki commented Oct 11, 2017 via email

@erwango
Copy link
Member

erwango commented Oct 11, 2017 via email

@superna9999
Copy link
Collaborator

@galak can you close this PR ? I sent a new one on #4260

@galak galak closed this Oct 12, 2017
nagineni pushed a commit to nagineni/zephyr that referenced this pull request Nov 20, 2017
…rtos#1103)

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants