Hi,
In order to use STM32F4xx-I2C template on a STM32F401RE-NUCLEO board what should i change in the makefile?
I tried changing :
- linker script file in the makefile for F401RE-NUCLEO
- specific HAL board for F401RE-NUCLEO
with no luck, i receive a lot of compiler errors. Any hint?
STM32F4xx-I2C for STM32F401RE-NUCLEO
Moderator: RoccoMarco
Re: STM32F4xx-I2C for STM32F401RE-NUCLEO
Hi Tarx,
I thinks you just need to modify the following :
- The board file
- The linker
Wich version of ChibiOS are you using?
Giovanni, I made quick test hand I had the following errors:
With the version 16.1.5 I had the following errors:
With the trunk, I had the following error:
I didn't have that errors before
.
I'm trying to look after to see what is the problem.
I thinks you just need to modify the following :
- The board file
- The linker
Wich version of ChibiOS are you using?
Giovanni, I made quick test hand I had the following errors:
With the version 16.1.5 I had the following errors:
In file included from ../../../../os/hal/include/hal.h:32:0,
from ../../../../os/hal/src/hal.c:25:
../../../../os/hal/ports/STM32/STM32F4xx/hal_lld.h:956:2: error: #error "HSE frequency not defined"
#error "HSE frequency not defined"
^
../../../../os/hal/ports/STM32/STM32F4xx/hal_lld.h:1052:2: error: #error "STM32_PLLCLKIN outside acceptable range (STM32_PLLIN_MIN...STM32_PLLIN_MAX)"
#error "STM32_PLLCLKIN outside acceptable range (STM32_PLLIN_MIN...STM32_PLLIN_MAX)"
^
../../../../os/hal/ports/STM32/STM32F4xx/hal_lld.h:1115:2: error: #error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
#error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
^
../../../../os/hal/ports/STM32/STM32F4xx/hal_lld.h:1127:2: error: #error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)"
#error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)"
^
../../../../os/hal/ports/STM32/STM32F4xx/hal_lld.h:1354:2: error: #error "STM32_PLLI2SVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
#error "STM32_PLLI2SVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
^
In file included from ../../../../os/hal/include/i2c.h:85:0,
from ../../../../os/hal/include/hal.h:52,
from ../../../../os/hal/src/hal.c:25:
../../../../os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h:326:2: error: #error "I2C peripheral clock frequency out of range."
#error "I2C peripheral clock frequency out of range."
^
make: *** [build/obj/hal.o] Error
With the trunk, I had the following error:
Compiling osal.c
Compiling hal.c
In file included from ../../../../os/hal/include/hal.h:110:0,
from ../../../../os/hal/src/hal.c:25:
../../../../os/hal/ports/STM32/STM32F4xx/hal_lld.h:1386:2: error: #error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)"
#error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)"
^
../../../../os/hal/ports/STM32/STM32F4xx/hal_lld.h:1406:2: error: #error "STM32_SYSCLK above maximum rated frequency (STM32_SYSCLK_MAX)"
#error "STM32_SYSCLK above maximum rated frequency (STM32_SYSCLK_MAX)"
^
../../../../os/hal/ports/STM32/STM32F4xx/hal_lld.h:1486:2: error: #error "STM32_HCLK exceeding maximum frequency (STM32_SYSCLK_MAX)"
#error "STM32_HCLK exceeding maximum frequency (STM32_SYSCLK_MAX)"
^
make: *** [build/obj/hal.o] Error 1
I didn't have that errors before
I'm trying to look after to see what is the problem.
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: STM32F4xx-I2C for STM32F401RE-NUCLEO
Hi,
Make sure to take mcuconf.h from an F401 demo for Nucleo then change the makefile.
Giovanni
Make sure to take mcuconf.h from an F401 demo for Nucleo then change the makefile.
Giovanni
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Has thanked: 83 times
- Been thanked: 67 times
Re: STM32F4xx-I2C for STM32F401RE-NUCLEO
Hi,
probably the easiest way is
probably the easiest way is
- copy the default demo for STM32F401RE
- replace main.c
- enable I2C in halconf and mcuconf
- edit main.c making it compiling (most likely LEDs PIN/PORT are different and there is always a blinking thread)
Re: STM32F4xx-I2C for STM32F401RE-NUCLEO
Hi,
Giovanni, you are right, that resolve the problem
.
All that errors come from the difference between the mcuconf files.
Tarx, do not forget to activated i2C driver and assign i2C peripheral in order to use the I2C module.
Thank you Giovanni.
Giovanni, you are right, that resolve the problem
All that errors come from the difference between the mcuconf files.
Tarx, do not forget to activated i2C driver and assign i2C peripheral in order to use the I2C module.
Thank you Giovanni.