Re: Trying Nucleo-64 STM32F411RE


Erwan Gouriou
 

Hi Piotr,

You should indeed first look at Zephyr documentation, and particularly i2c
API.
Then, regarding STM32 driver/IP, there are several sources that could help
you to develop I2C driver for STM32F4xx family
(as your driver should benefit to other SoCs from the F4 family):
-Zephyr native implementation of stm32lx i2c driver:
https://gerrit.zephyrproject.org/r/gitweb?p=zephyr.git;a=tree;f=drivers/i2c
-HAL implementation from STM32Cube SDK (that you could get here
http://www.st.com/en/embedded-software/stm32cubef4.html)
Inside SDK, you'll find i2c code examples using HAL
(Projects/xx/Examples/I2C/)
-stm32f411re Refence Manual for information about stm32f411re I2C (
http://www.st.com/en/microcontrollers/stm32f411re.html)

Then, you have two options:
-based on STM32Cube HAL, develop a generic STM32 driver that will benefit
to all STM32 based boards.
-develop a Zephyr "native" STM32F4 I2C API that will benefit to STM32F4
family devices (similar to stm32lx.c driver)

Either ways, note that you could use STM32Cube SDK
(ext/hal/st/stm32cube/stm32f4xx/soc/stm32f411xe.h) to benefit from
useful structures, macros and defines that provide abstraction capability
so you don't have to deal with subtle differences between
similar SoCs (such as stm32f401re and stm32f411re).

Good luck with your project
Erwan

On 14 January 2017 at 23:26, Piotr Król <piotr.krol(a)3mdeb.com> wrote:

On Mon, Jan 02, 2017 at 03:03:58PM +0100, Erwan Gouriou wrote:
Hi Piotr,
Hi Erwan,


There was an issue on F411RE clock initialisation steps.
I've submitted following change to correct it:
https://gerrit.zephyrproject.org/r/9571

Hope it helps.
This helps sample code works correctly. With that I can continue with my
target project, which is i2c driver for F411RE.

Can you point me to information how I should approach adding i2c driver
for this board ?

I assume first I should familiarize myself with Zephyr documentation and
contribution guidelines, but have you got any reference code for i2c
driver ?

Best Regards,
--
Piotr Król
Embedded Systems Consultant
http://3mdeb.com | @3mdeb_com

Join devel@lists.zephyrproject.org to automatically receive all group messages.