Page 1 of 2

HAL driver support for the STM32F2xx ("F-2") line

Posted: Sun Jun 26, 2011 12:56 am
by GHF
Hi, I've been playing with ChibiOS for some time, and now I can't live without it. The RTOS basics work exactly as expected, but even more importantly the drivers (at least for for STM32) are amazingly complete, if a bit on the bleeding-edge side in terms of "tested-ness." Even so, having comprehensive peripheral support integrated into the RTOS has made the STM32 my platform of choice for anything not needing an MMU.

One of my next applications requires more memory than the MD-line STM32s I've been using, and so I've been looking at ST's XL line with up to 96K RAM and the F-2 line with up to 128K RAM. The higher RAM and nearly double clock of the F-2s caught my eye, but I'm dubious about using it without knowing there's a solid software base for it.

Is anyone familiar with the STM32F2xx parts? Are peripheral registers (for example) similar or way off-the-charts different from the STM32F10x? If you've used it, do you think that porting ChibiOS's HAL drivers is feasible?

Re: HAL driver support for the STM32F2xx ("F-2") line

Posted: Sun Jun 26, 2011 6:41 am
by Giovanni
Hi,

Thanks for appreciation, device drivers support is evolving and minor problems are expected. The HAL testing is improving, the unstable version has test applications for most device drivers, fixes are always backported to the stable version.

About the STM32, XL devices are already supported and F2 devices support is planned.

The STM32F2 family has significant differences compared to the classic STM32 (it fixes most of the minor annoyances found in STM32 classic):
  • GPIO has been enhanced and now AFIO is integral part of GPIO, now each single pin can be reconfigured up to 16 different alternate functions (it requires a whole different PAL driver implementation).
  • The DMA channels now can be associated to multiple peripherals and are no more hardwired to fixed request lines (this has impact on drivers using DMA).
  • The part has the same enhanced PWR management found in the STM32L.
  • The ADC has been enhanced. Now it is possible to sample using different resolutions and it is twice faster.

There are a lot of other minor improvements too, in general the peripherals are updated versions of the ones present in the STM32.

Most of the above changes are found also in the STM32L, in the repository there is already provisional support for the STM32L and the F2 port will benefit from this. The main problem is that I have been unable to find any hardware for F2 so far but the port itself should not take long.

Giovanni

Re: HAL driver support for the STM32F2xx ("F-2") line

Posted: Sun Jun 26, 2011 10:38 pm
by GHF
Hmm, good point about the lack of hardware. I was looking around for a F-2 dev board after posting, and could find nothing like the abundance of low-cost "fully-loaded" STM32F103xx boards on eBay. There are two from ST and IAR, but considering my lack of software and experience I'm not sure if they are good investments.

The AFIO and ADC changes sound quite exciting, btw. One of my favorite parts of the 16-bit PICs (dsPIC33 & PIC24H) were that they have fully reconfigurable peripheral I/O on low-pincount devices. The 36- and 48-pin STM32s tend to have all the useful peripherals on the same pins. "Useful" is very subjective, of course.

Looks like I'll be using the XL line. I'll put in a ticket to add TIM8 to PWM. Thanks!

Re: HAL driver support for the STM32F2xx ("F-2") line

Posted: Thu Jul 21, 2011 11:52 am
by tinito
I've just received a STM3220G-EVAL evaluation board from ST, that has an STM32F207 mcu.
I want to use ChibiOS for my project, so I'm happy if I can help somehow in the development of the HAL port.
Giovanni, did you already think about the PAL driver architecture to support the different hardware?

bye,
Martino

Re: HAL driver support for the STM32F2xx ("F-2") line

Posted: Thu Jul 21, 2011 12:32 pm
by Giovanni
Hi Martino,

The PAL driver for the STM32F-2 should be very similar to the PAL driver for the STM32L which has already be committed on the repository. The GPIO structure is the same between the two families so most of the work is shared.

STM32F-2 support is mainly matter of writing the clock initialization code and creating a new DMA manager. The other drivers will only require marginal changes and re-testing.

Giovanni

Re: HAL driver support for the STM32F2xx ("F-2") line

Posted: Fri Jul 22, 2011 8:05 am
by mabl
I've also been looking into cheap boards. Olimex is going to release a board comparable to the http://www.olimex.com/dev/stm32-p107.html in September. I've also asked Propox if they plan a similar product of http://www.propox.com/products/t_264.html. They are still investigating it.

I'm sure both board releases could be speed up if enough people are interested in it. So if you want them sooner, write emails :mrgreen:

Re: HAL driver support for the STM32F2xx ("F-2") line

Posted: Mon Jul 25, 2011 10:11 am
by Giovanni
I think I'll wait for the Olimex one, never had problems with them.

Anyway, I am preparing the repository organization for the STM32F2 support.

Giovanni

Re: HAL driver support for the STM32F2xx ("F-2") line

Posted: Mon Jul 25, 2011 9:31 pm
by tinito
I've got "The LED" blinking! ;)
The RCC setup seems to work as well as the PAL driver. Tomorrow I'm going to test it some more, then I'll attach my code.

Re: HAL driver support for the STM32F2xx ("F-2") line

Posted: Tue Jul 26, 2011 7:27 am
by Giovanni
Martino, if I add an "official" HAL driver could you test it and do some debugging? this would allow to have F2 support earlier. There are a lot of people looking forward to it.

I would like to release a version 2.3.3 with STM32L1xx and STM32F2xx support.

Giovanni

Re: HAL driver support for the STM32F2xx ("F-2") line

Posted: Tue Jul 26, 2011 9:02 am
by tinito
Giovanni, absolutely yes! Also if I can contribute to the port code, I'm happy about it.
What I've done yesterday is to start from STM32L1xx port and adapt the defines and the code accordingly to STM32F2xx datasheet, trying to be as consistent as I can with your code.

bye,
Martino