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 package ti.catalog.msp430.init;
38
39 import xdc.rov.ViewInfo;
40
41 /*!
42 * ======== Boot ========
43 * Boot time initialization code manager
44 *
45 * The Boot module supports boot initialization for the MSP430 devices.
46 * A special boot init function is created based on the configuration
47 * settings for this module. This function is hooked into the
48 * `{@link xdc.runtime.Reset#fxns xdc.runtime.Reset.fxns[]}` array and
49 * is called very early at boot time (prior to C runtime initialization).
50 *
51 * The code to support the boot module is placed in a separate section
52 * named `".text:bootCodeSection"` to allow placement of this section in
53 * the linker .cmd file if necessary. This section is a subsection of the
54 * `".text"` section so this code will be placed into the .text section
55 * unless explicitly placed, either through
56 * `{@link xdc.cfg.Program#sectMap Program.sectMap}` or through a linker
57 * command file.
58 */
59 @Template("./Boot.xdt")
60 metaonly module Boot
61 {
62 metaonly struct ModuleView {
63 Bool disableWatchdog;
64 UInt watchdogAddress;
65 Bool configureDCO;
66 Bool useLFXT;
67 }
68
69 @Facet
70 metaonly config ViewInfo.Instance rovViewInfo =
71 ViewInfo.create({
72 viewMap: [
73 [
74 'Module',
75 {
76 type: ViewInfo.MODULE,
77 viewInitFxn: 'viewInitModule',
78 structName: 'ModuleView'
79 }
80 ],
81 ]
82 });
83
84 /*!
85 * ======== disableWatchdog ========
86 * Watchdog disable flag
87 *
88 * The default is `true`. Set to `false` to not automatically disable the
89 * watchdog timer.
90 */
91 config Bool disableWatchdog = true;
92
93 /*!
94 * ======== watchdogAddress ========
95 * Watchdog control register address
96 *
97 * The default (0x15c) is set for MSP430F54xx and MSP430F552x devices.
98 * Change for other devices.
99 */
100 config UInt watchdogAddress = 0x15c;
101
102 /*!
103 * ======== configureDCO ========
104 * Configure DCO flag
105 *
106 * The default is `false`. Set to `true` to initialize the DCO at boot.
107 *
108 */
109 config Bool configureDCO = false;
110
111 /*!
112 * ======== useLFXT ========
113 * Use a low frequency crystal (LFXT) reference
114 *
115 * The default is `false`. Set to `true` to indicate a 32768Hz low
116 * frequency crystal is present, and available for configuring the clock
117 * system.
118 *
119 * This configuration parameter is utilized for only a subset of MSP430
120 * device types, and only when `configureDCO` is set to `true`.
121 *
122 * For FR58xx/FR59xx devices: if `useLFXT` is set to `true`, an LFXT
123 * will be used as reference, for generating more accurate clock
124 * frequencies. Othewise, and by default, MODOSC will be used as
125 * reference.
126 *
127 * For all other MSP430 device types: at present, the `useLFXT` parameter
128 * will be ignored, and an internal reference will be used instead.
129 */
130 config Bool useLFXT = false;
131 };