Page 1 of 2

Starting to add Nucleo F334R8

Posted: Wed Oct 01, 2014 1:42 pm
by jcw
I noticed that the STM32F334 wasn't in the list of chips yet, so I started adding the necessary headers - I basically started from the STM32F30x files and the Nucleo F103RB board files, assuming that these would be closest to the desired result.

Going fine so far, but I'm hitting an error I can't quite figure out...

Code: Select all

Compiling hal.c                                                                         
In file included from ../chibios/os/hal/include/st.h:50:0,                             
                 from ../chibios/os/hal/include/hal.h:64,                             
                 from ../chibios/os/hal/src/hal.c:29:                                 
../chibios/os/hal/ports/STM32/LLD/TIMv1/st_lld.h:69:2: error: #error "TIM2 not present"
 #error "TIM2 not present"                                                             


I suspect that somewhere there's still an old path reference lurking in there?

(Feel free to add into the repo, of course - I can resubmit once this is solved)

-jcw

Re: Starting to add Nucleo F334R8

Posted: Wed Oct 01, 2014 1:53 pm
by Giovanni
The F334 should already be supported after the inclusion of the new headers, isn't it? you have to use the same paths of the F30x (which should be renamed to F3xx).

Giovanni

Re: Starting to add Nucleo F334R8

Posted: Wed Oct 01, 2014 1:58 pm
by jcw
Ah - I was confused because there is an F30x and an F37x, so I thought the logical step would be to add F33x?

Ok, I'll try the F30x route, thanks.

-jcw

Re: Starting to add Nucleo F334R8

Posted: Wed Oct 01, 2014 2:22 pm
by Giovanni
F37x is a special case, it is different from the others. All other devices have the same clock tree and a common set of peripherals.

Giovanni

Re: Starting to add Nucleo F334R8

Posted: Wed Oct 01, 2014 8:38 pm
by jcw
No joy, I'm still getting the "TIM2 not present" error.

Attached the board definitions I'm now using, along with these lines in my Makefile:

Code: Select all

include $(CHIBIOS)/os/hal/boards/ST_NUCLEO_F334R8/board.mk
include $(CHIBIOS)/os/hal/ports/STM32/STM32F30x/platform.mk
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f30x.mk

# Define linker script file here
LDSCRIPT= $(PORTLD)/STM32F334x8.ld


FWIW, the "STM32F334x8.ld" file is as follows, though that point is not being reached yet:

Code: Select all

MEMORY
{
    flash : org = 0x08000000, len = 64k
    ram : org = 0x20000000, len = 12k
    ccmram : org = 0x10000000, len = 4k
}

INCLUDE rules.ld


What am I missing? I do not see any substantial differences between ST_NUCLEO_F334R8 and say ST_NUCLEO_F401RE board files.

-jcw

Re: Starting to add Nucleo F334R8

Posted: Wed Oct 01, 2014 8:41 pm
by Giovanni
Is the device identification macro correct?

Re: Starting to add Nucleo F334R8

Posted: Wed Oct 01, 2014 9:00 pm
by jcw
I think so, this is in STM32F30x/cmparams.h:

Code: Select all

#if !defined (STM32F301x8) && !defined (STM32F318xx) &&                     \
    !defined (STM32F302x8) && !defined (STM32F302xC) &&                     \
    !defined (STM32F303x8) && !defined (STM32F303xC) &&                     \
    !defined (STM32F358xx) && !defined (STM32F334x8) &&                     \
    !defined (STM32F328xx)
#include "board.h"
#endif


This is in my project: #define STM32F30x_MCUCONF

And this is in ST_NUCLEO_F334R8/board.h: #define STM32F334x8

-jcw

Re: Starting to add Nucleo F334R8

Posted: Thu Oct 02, 2014 4:27 pm
by Giovanni
I am porting the Nucleo demos to 3.0 and did some rework on the F3 HAL, I will give F334 a try in the weekend.

Giovanni

Re: Starting to add Nucleo F334R8

Posted: Thu Oct 02, 2014 5:35 pm
by Giovanni
Found the problem with the F334, added a demo but it is untested.

Giovanni

Re: Starting to add Nucleo F334R8

Posted: Fri Oct 03, 2014 1:53 am
by jcw
Woohoo - the demo and my test project are now compiling! Will test further soon, thank you!

-jcw