Page 1 of 1

Porting from STM32f4-Discovery to another board

Posted: Fri Jun 20, 2014 7:20 pm
by franek.bmw
Hello, I have a question about porting applications to another board but with the same processor. Initially, I have written an application for STM32F4-Discovery. But now I have to move it to the target board with processor STM32F407VGT6. The main difference is that I want to debug via JTAG interface and not by the SWD as it is on Discovery. According to the tutorial I created a new directory with the board name, copied and modified the files board.c and board.h. I do not know what to do with the files in the folder cfg. Trying to run the application on my board after uploading flash and reset the processor jumps in ResetHandler and lose the JTAG communication. What I am doing wrong? Can I count on some hints?

Thank you in advance,
Franek

Re: Porting from STM32f4-Discovery to another board

Posted: Fri Jun 20, 2014 7:53 pm
by Giovanni
Hi,

The files board.c and board.h are not written but generated from that board.chcfg file (XML). You need ChibiStudio in order to generate the files:

1) Copy a board directory into a new one and give it a proper name.
2) Open the .chcfg file using the Eclipse XML editor.
3) Configure pins and clocks for your board using the "design" view of the XML editor.
4) Select the .chcfg file into the project explore, an icon should appear in the toolbar, click it and the files are generated.

In you application makefile you need to point to the new board files, if clocks are different from the previous board then you need to configure the clock tree in mcuconf.h.

About JTAG, reconfigure the JTAG-related pins to their defaults (see Reference Manual), the Discovery board files reprogram those for other functions, this is why you lose the connection.

Giovanni

Re: Porting from STM32f4-Discovery to another board

Posted: Mon Jun 23, 2014 3:45 pm
by franek.bmw
Hey,
I have done as you recommended and now it works. Thanks a lot!

Franek