ChibiStudio Terminal Debug
Posted: Mon Jul 11, 2016 7:53 pm
I'm using a STM32F429 discovery board. I was having problems, but now it's resolved. This is mostly a trail of bread crumb for others or myself to potentially find.
I started with this tutorial and below I have filled in several blanks. http://www.playembedded.org/blog/en/201 ... o-chibios/
Here are my notes about how I got messages to show up in ChibiStudio's terminal being sent from the STM32F429 discovery board.
From ch.h, other versions may work, this is the version I was on when I did this.
I do no know how to verify the uGFX version. If I knew how I would post it here as I know this version works with that chibios version.
In mcuconf.h I have this
In halconf.h I have
In os_chibios_3.mk I have
And finally in main.c I have
This done with ChibiStudio on a win7 64 bit. I have STLink installed and under device manager --> Ports, I see I have STLink Virtual COM port (COM8).
The hardware is an STM32F429 discovery board. From visual inspection I see the factory setting is with a solder blob jumper on SB15 and SB11 is open. I see from the schematic (snippet below), that we are dealing with PA10, then table 10 of en.DM00071990.pdf indicates we are USART1. So I set the UART in the mcuconf.h and halconf.h files to 1.
When this is all done, I get this in ChibiStudio, notice the Hello World showing up once very second, in sync with the red LED.
I started with this tutorial and below I have filled in several blanks. http://www.playembedded.org/blog/en/201 ... o-chibios/
Here are my notes about how I got messages to show up in ChibiStudio's terminal being sent from the STM32F429 discovery board.
From ch.h, other versions may work, this is the version I was on when I did this.
Code: Select all
#define CH_KERNEL_MAJOR 3
#define CH_KERNEL_MINOR 0
#define CH_KERNEL_PATCH 1I do no know how to verify the uGFX version. If I knew how I would post it here as I know this version works with that chibios version.
In mcuconf.h I have this
Code: Select all
#define STM32_SERIAL_USE_USART1 TRUE
blah
#define STM32_UART_USE_USART1 FALSEIn halconf.h I have
Code: Select all
#define HAL_USE_SERIAL TRUE
blah
#define HAL_USE_SERIAL_USB FALSE
blah
#define SERIAL_DEFAULT_BITRATE 38400In os_chibios_3.mk I have
Code: Select all
# Add include files
INCPATH += blah
$(CHIBIOS)/os/hal/lib/streams/ \
$(CHIBIOS)/os/various
# Add C files
SRC += blah
$(CHIBIOS)/os/hal/lib/streams/memstreams.c \
$(CHIBIOS)/os/hal/lib/streams/chprintf.cAnd finally in main.c I have
Code: Select all
#include "gfx.h"
#include "ch.h"
#include "hal.h"
#include "chprintf.h"
#include "memstreams.h"
BaseSequentialStream* chp = (BaseSequentialStream*) &SD1; // for serial debugger chprintf statements.
blah
/*
* Red LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 512);
static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("heart_beat");
while (true) {
palClearPad(GPIOG, GPIOG_LED4_RED);
chThdSleepMilliseconds(500);
palSetPad(GPIOG, GPIOG_LED4_RED);
chThdSleepMilliseconds(500);
chprintf(chp, "Hello world\n\r");
}
}
int main(void) {
sdStart(&SD1, NULL); // Start serial, this will allow chprintf statements to work.
chThdCreateStatic(waThread1, sizeof(waThread1),//Create heart beat thread
NORMALPRIO + 9, Thread1, NULL);
blah
This done with ChibiStudio on a win7 64 bit. I have STLink installed and under device manager --> Ports, I see I have STLink Virtual COM port (COM8).
The hardware is an STM32F429 discovery board. From visual inspection I see the factory setting is with a solder blob jumper on SB15 and SB11 is open. I see from the schematic (snippet below), that we are dealing with PA10, then table 10 of en.DM00071990.pdf indicates we are USART1. So I set the UART in the mcuconf.h and halconf.h files to 1.
When this is all done, I get this in ChibiStudio, notice the Hello World showing up once very second, in sync with the red LED.