Page 1 of 1

First Port Test App on STM32F103VE

Posted: Wed Jan 18, 2012 3:59 am
by rallysjd
I have successfully ported 2.2.7 on two variants of a PiXCL STM32F103VE board. It was easier than I expected once the HAL/PAL concept and implementation was understood.

LEDs flash and test data is output to USART1 in both cases. I think I have a button set up correctly (palReadPad(IOPORT2, GPIOB_BUTTON)) in my board.h.
In main.c, the button is tested and if true calls TestThread which outputs the test data.

I need some clarification.

It seems to me that test data should be started only when the button is pressed. Since the test data output starts immediately, does this mean my button setup is incorrect?

A second question is how to send data (e.g. the chip serial number) to the USART. I see how TestData does it (as a device driver thread if I understand it correctly). printf just hangs, as I expected. In the forum I see references to "chprintf" and "newlibrary", but can't locate a source file. I've experimented with the shell commands. I'll look at adding another test section to display the serial number.

Suggestions?

Re: First Port Test App on STM32F103VE

Posted: Wed Jan 18, 2012 9:06 am
by Giovanni
Hi,

Probably your button has an inverted "pressed" state or your board file configured the pins incorrectly (or both).

chprintf() is not included in 2.2.7, you should upgrade to the latest unstable version 2.3.4 and is located under ./os/various, chprintf() can write directly on the serial driver, there are several examples doing this (see the STM32 FatFS demo for an example).

Giovanni

Re: First Port Test App on STM32F103VE

Posted: Wed Jan 18, 2012 1:37 pm
by rallysjd
Thanks Giovanni, 2.3.4 it is. We have a STM32F4 Discovery board here as well that runs 2.3.4.