Problem building BSP for TMS570 HDK

Martin Galvan martin.galvan at
Tue Jun 21 13:36:02 UTC 2016

Hi guys,

On Sun, Jun 19, 2016 at 12:54 PM, Pavel Pisa <pisa at> wrote:
> The other option is to use integration of full HalCoGen
> initialization sources with RTEMS. This mode has been
> tested as an experiment and is only part of branch
> tms570-bsp-with-hwinit in the development repository.

Just in case Florian doesn't know about this, HalCoGen is a tool
provided by Texas Instruments that generates stuff like drivers and
initialization code for different MCUs. It's Windows-only though, so
you'll have to use wine to run it:

IIRC Pavel's repo works when you're loading your binary to the board's
RAM and running it from there. At Taller we wanted to run our binary
directly from flash, without the need for an separate loader or
something like that. What we did back then was placing the HalCoGen
sources inside the RTEMS tree, touching up the Makefiles as needed. We
added most of the code from HalCoGen's _c_int00 function (at
sys_startup.c) to the TMS's bsp_start, right before calling
bsp_interrupt_initialize. We removed the call to tms570_pom_remap
though, since that was using the TMS's Parameter Overlay Module to map
some flash sections to the RAM. Not only it wasn't required in our
setup, but it was actually causing CPU exceptions to be thrown back
and forth. IIRC Pavel eventually fixed that, though I don't remember
if his patches were merged into the mainline.

> --enable-networking --enable-posix --enable-itron --disable-ada \

I don't think you'll be needing enable-networking here. Don't know about itron.

> Martin Galvan has worked under contract on integration of some older
> RTEMS version with TMS570 HalCoGen sources as I know. So he can
> provide support in this area.

Notice I don't have access to the boards for the time being, so I
won't be able to provide additional testing. Also notice Pavel's code
was tested on a Hercules MCU Development Kit (HDK), while we were
using a "USB Stick" variant. You can find some more info here:

Some tweaking might be needing if you're using the USB Stick. For
example, IIRC we changed BSP_PLL_OUT_CLOCK in bsp.h from 160 MHz to
180 MHz.

If you're getting started with the TMS570 there are a couple of
gotchas that you should keep in mind. For example, Revision A boards
have a hardware bug that causes them to freeze when resetting through
nRST as opposed to PORRST (in the USB Stick, that's the small button
labeled "RST"). Rev B and C fix this problem, so you should check
which revision you're using (you can see it in the tiny letters on the

For flashing we used TI's Uniflash tool, after renaming the RTEMS .exe
binaries to .out. For debugging we used OpenOCD through the scripts
located at

We're using Ubuntu, so we installed the openocd_0.8.0-1_amd64.deb
package and ran the ddd-arm-openocd script from Pavel's repo. Notice
however that it uses ddd; you may want to edit the script to use plain
gdb instead. Also notice that sometimes either gdb or the openocd
process may remain alive after you quit debugging; you should always
check and kill them manually.

More information about the users mailing list