First Port Test App on STM32F103VE

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
rallysjd
Posts: 15
Joined: Mon Jan 16, 2012 4:17 pm

First Port Test App on STM32F103VE

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: First Port Test App on STM32F103VE

Post 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
rallysjd
Posts: 15
Joined: Mon Jan 16, 2012 4:17 pm

Re: First Port Test App on STM32F103VE

Post by rallysjd »

Thanks Giovanni, 2.3.4 it is. We have a STM32F4 Discovery board here as well that runs 2.3.4.
Post Reply