summaryrefslogtreecommitdiffstats
path: root/bsps/arm/tms570/README
blob: fb196ca8d0be7f09d264242c72c801d4a0db855a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
TI Hercules TMS570 series development boards:

TMS570LS31:

http://www.ti.com/tool/tmds570ls31hdk

TMS570LC43:

https://www.ti.com/tool/TMDX570LC43HDK

Overview
--------

Drivers:

  o Console
  o Clock
  o Ethernet - external lwIP fork repository

BSP variants:

  TMS570LS3137:

    tms570ls3137_hdk_intram - place code and data into internal SRAM
    tms570ls3137_hdk_sdram - place code and data into external SDRAM
    tms570ls3137_hdk - variant for stand-alone RTEMS application stored
                    and running directly from flash..

  TMS570LC4357:

    tms570ls4357_hdk_sdram - place code and data into external SDRAM
    tms570lc4357_hdk - variant for stand-alone RTEMS application stored
                    and running directly from flash.

Toolchain used for development
-------------------------------

Example of RTEMS build configuration (config.ini) used for testing of self-contained applications
running directly from flash:

    [arm/tms570lc4357_hdk]

All patches required for Cortex-R and big-endian ARM support are already
integrated into the GCC and RTEMS mainline.

MCU-specific flags used during compilation are located in
`externs/rtems/spec/build/bsps/arm/tms570/abi.yml`

When linking an application to an RTEMs build, ensure the following flags are set
(arm-rtems6-gcc/g++):

    -mbe32
    -qrtems
    -T{RTEMS_BSP_VARIANT_LINKERSCRIPT}

RTEMS_BSP_VARIANT_LINKERSCRIPT can be found with the static libraries built for rtems. There
is one for each BSP variant type. For example `linkcmds.tms570lc4357_hdk`

Execution
---------

Application built by the above process can be directly programmed
into Flash and run.

The following features are implemented in the `_hdk` BSP variants:

 + Initial CPU and peripheral initialization
 + Cores Self-test

For test and debug purposes, TI's HalCoGen generated application
can be used to set up the board and then a RTEMS application
can be loaded using OpenOCD to internal SRAM or external SDRAM.
This prevents wear of Flash which has limited guaranteed
erase cycles count.

Setup application code is available there:
          https://github.com/hornmich/tms570ls3137-hdk-sdram

A branch that enables loading to Flash via openocd on the TMS570LC4357
can be found here:
    https://github.com/len0rd/openocd

TMDS570LS31HDK setup to use SDRAM to load and debug RTEMS applications
-----------------------------------------------------------------------

  o Program SDRAM_SCI_configuration-program or another boot loader
    (for example ETHERNET XCP is developed)
  o write BSP application either to sdram or intram and jump to RTEMS start code

ETHERNET
--------

For ETHERNET, the lwIP port for TMS570LS3137 has been developed
at Industrial Informatics Group of Czech Technical University
in Prague and development versions are available on SourceForge.

RTEMS and TMS570 support is included in uLAN project lwIP
repository

  https://sourceforge.net/p/ulan/lwip-omk/

This port has been consolidated with other RTEMS-LWIP ports here:

  https://git.rtems.org/rtems-lwip/tree/rtemslwip/tms570

A port to the TMS570LC4357 based off this work is underway.

Adapt BSP for other TMS570 based hardware
-----------------------------------------

Complete pin multiplexer initialization according
to the list of individual pins functions is included.
Pins function definition can be found and altered
in a file

 `rtems/c/src/lib/libbsp/arm/tms570/hwinit/init_pinmux.c`

Complete "database" of all possible pin functions for
a chip is provided in a file

  `rtems/c/src/lib/libbsp/arm/tms570/include/tms570<MODEL>-pins.h`

If another package or chip is considered then tools found
in next repository can be used or extended to generate header
files and pins "database"

  https://github.com/AoLaD/rtems-tms570-utils

Links to additional information
-------------------------------

Additional information about the BSP and board can be found at
  https://devel.rtems.org/wiki/TBR/BSP/Tms570

Additional information about the CPU can be found at
  https://www.ti.com/product/tms570ls3137
  https://www.ti.com/product/TMS570LC4357