TMS570_Startup_Integration_Manual

1 Dependencies 2

1.1 SWCs 2

1.2 Functions to be provided to Integration Project 2

1.3 Functions to be provided by Integration Project 2

2 Configuration 2

2.1 Build Time Config 2

2.2 Configuration Files to be provided by Integration Project 2

2.2.1 startup_cfg.h 3

2.2.2 appinit_cfg.h 3

2.3 DaVinci Config Configuration Changes 3

2.4 Manual Configuration Changes 3

3 Integration 3

3.1 Required Global Data Inputs 3

3.2 Optional Global Data Inputs 3

3.3 Specific Include Path present 3

3.4 Build Exclusions 3

3.5 Definition of Stacks 4

3.6 Reset Causes 4

3.7 Impact on Integration Project 6

3.7.1 JTAG Debugger Considerations 6

3.7.2 RAM Memory State 7

3.7.3 ECC and Parity 7

4 Runnable Scheduling 7

5 Memory Mapping 7

5.1 .resetcause Section 7

5.2 Mapping 7

5.3 Usage 7

5.4 NvM Blocks 8

6 Compiler Settings 8

6.1 Preprocessor MACRO 8

6.2 Optimization Settings 8

6.3 Other Settings 8

7 Revision Control Log 8

Dependencies

SWCs

ModuleRequired Feature
StdDefTMS570 Register Definitions

Functions to be provided to Integration Project

void _fiqhandler(void);

uint32 _coreGetDebugStatusAndControlRegister_(void);

uint32 _coreGetSecondaryAuxiliaryControlRegister_(void);

void _coreSetSecondaryAuxiliaryControlRegister_(uint32 SecAuxCtrlRegVal_Cnt_T_u32);

uint32 _coreGetFPSCR_(void);

Functions to be provided by Integration Project

All common functionality required for a boot project startup is contained in “BootStartup.c”, and all common functionality for application project startup is contained in “AppStartup.c”. There may be instances, however, where a boot or application project will need to do special steps that are specific to a particular program, prior to the “main()” function call. To accommodate this, several functions are called, one at the start and one at the end of both BootStartup.c and AppStartup.c. These functions are

  • void BootStartupCallout1(void)

  • void BootStartupCallout2(void)

  • void AppStartupCallout1(void)

  • void AppStartupCallout2(void)

The integration projects are required to provide these functions, regardless of if there is content in them.

Configuration

Build Time Config

ModulesNotesSWC
None

Configuration Files to be provided by Integration Project

Configuration files are needed to configure the startup sequence based on the needs of the program being implemented in. These configuration files are simply header files that define a set of build constants. Templates of these files are provided (located in the tools folder of this SWC) that can be adapted to the needs of the program. From the context of a boot project, startup_cfg.h is required. From the context of an application project, appinit_cfg.h is required.

startup_cfg.h

This file contains the startup configuration constants used in sys_startup. The following constants can be enabled or disabled defining them as either STD_OFF or STD_O, descriptions are as follows:

appinit_cfg.h

DaVinci Config Configuration Changes

ParameterValueNotes
OsOSFIQHandler_fiqhandlerNeeds to be configured if more than one FIQ is configured in the system (e.g. when adding the floating point exception handling FIQ). When only one FIQ is configured, the value of this parameter should be the name of that one FIQ ISR.

Manual Configuration Changes

ConstantNotesSWC
None

Integration

Required Global Data Inputs

None

Optional Global Data Inputs

None

Specific Include Path present

Yes

Build Exclusions

This component is designed to be included in a given program’s boot and application projects. The boot project is defined as the project which the hardware reset vector jumps to. A subset of this component’s files needs to be part of the build based on given context. The source files to be excluded from the build through code composer project settings are as follows:

Excluded from Boot Project:

  • AppStartup.c

Excluded from the Application Project:

  • BootStartup.c

  • sys_startup.c

Definition of Stacks

The stacks (sizes and locations) need to be defined and reserved by both the boot and application integration projects. This can be done by defining symbols for the locations of the stack (typically in the linker file). The stack symbols (used to initialize the stack pointers) the startup code requires are:

  • “_StackSVC_”

  • “_StackFIQ_”

  • “_StackIRQ_”

  • “_StackUSER_”

  • “_StackABORT_”

  • “_StackUND_”

Reset Causes

A variable of this SWC holds the reset cause and it is used to alter the processing of the startup sequence. This SWC defines a set of reset causes shown in the table below. The integration project is free to define its own reset cause values if necessary and write this value to the ResetCause_Cnt_Enum variable prior to performing a software reset; however, the names and values in the table below are reserved for use of this SWC. The ResetCause_Cnt_Enum variable can be read at any time by integration project components for information or diagnostic use.

Reset Cause NameValue
PWRONRESET0x0000FFFF
DEBUGRESET0x0001FFFE
CPURESET0x0002FFFD
SPPBISTFAILED0x0003FFFC
DPPBISTFAILED0x0004FFFB
EXTRESET0x0005FFFA
OSCFAIL0x0006FFF9
SWRESET0x0007FFF8
WDGFAIL0x0008FFF7
CCMSTEFFAILED0x0009FFF6
CCMSTFAILED0x000AFFF5
CCMEFFAILED0x000BFFF4
PBISTSCFAILED0x000CFFF3
STCSCFAILED0x000DFFF2
STCFAILED0x000EFFF1
ESM3NONZERO0x000FFFF0
EFCSTFAILED0x0010FFEF
EFCSTUCKZERO0x0011FFEE
EFCERROR0x0012FFED
FLSBUS2CORRFAILED0x0013FFEC
FLSBUS2ADDCAPFAILED0x0014FFEB
FLSBUS2MULBITDETFAILED0x0015FFEA
FLSBUS2SNGBITDETFAILED0x0016FFE9
VIMPARFLGFAILED0x0017FFE8
VIMPARADDERRFAILED0x0018FFE7
VIMPARESMFAILED0x0019FFE6
DCAN1PARESMFAILED0x001AFFE5
DCAN2PARESMFAILED0x001BFFE4
DCAN3PARESMFAILED0x001CFFE3
DMAPARESMFAILED0x001DFFE2
MIBADC1PARESMFAILED0x001EFFE1
MIBADC2PARESMFAILED0x001FFFE0
MIBSPI1PARESMFAILED0x0020FFDF
MIBSPI3PARESMFAILED0x0021FFDE
MIBSPI5PARESMFAILED0x0022FFDD
N2HET1PARESMFAILED0x0023FFDC
N2HET1TUPARESMFAILED0x0024FFDB
N2HET2PARESMFAILED0x0025FFDA
N2HET2TUPARESMFAILED0x0026FFD9
B0MULBITRAMECCDETFAILED0x0027FFD8
B1MULBITRAMECCDETFAILED0x0028FFD7
B0SNGBITRAMECCDETFAILED0x0029FFD6
B1SNGBITRAMECCDETFAILED0x002AFFD5
SNGBITFLSECCDETFAILED0x002BFFD4
MULBITFLSECCDETFAILED0x002CFFD3
LPOTRIMERROR0x002DFFD2
DATAMULBITRAMECCFAILED0x002EFFD1
DATAMULBITFLSECCFAILED0x002FFFD0
CPUDATAABORT0x0030FFCF
CPUPREFETCHABORT0x0031FFCE
PRFTCMULBITRAMECCFAILED0x0032FFCD
PRFTCMULBITFLSECCFAILED0x0033FFCC
UNDEFINST0x0034FFCB
CLOCKMONITOR0x0035FFCA
CCMFAILED0x0036FFC9
FMCUNCORRERR0x0037FFC8
B0UNCORRERR0x0038FFC7
B1UNCORRERR0x0039FFC6
B0ADDPARERR0x003AFFC5
B1ADDPARERR0x003BFFC4
FLSECCLIVELOCK0x003CFFC3
VIMMULTBITFLT0x003DFFC2
VIMPARTHRSHFLT0x003EFFC1
UNUSEDINTERRUPT0x003FFFC0
STACKOVERWRITE0x0040FFBF
MPUVIOLATION0x0041FFBE
WDGALIVEMONFAIL0x0042FFBD
WDGDEADLINEFAIL0x0043FFBC
WDGPROGFLOWFAIL0x0044FFBB
SWWDGFAIL0x0045FFBA
FPUDZCEXCP0x0046FFB9
FPUOFCEXCP0x0047FFB8
FPUIOCEXCP0x0048FFB7
FPUUNKNOWNEXCP0x0049FFB6

Impact on Integration Project

JTAG Debugger Considerations

Integrating this project will impact the debugging capabilities. The normal startup which runs all of the diagnostic startup tests will be bypassed if a debugger connection is detected. Because of safety ramifications of potentially bypassing startup tests if the controller incorrectly reads a debugger being attached, a branch to self instruction is inserted in AppStartup.c if the reset cause is “DEBUGRESET”. In the scenario where a debugger is actually attached, the user running the debug session will have to manually move the program-counter past this branch instruction to continue debugging.

RAM Memory State

This SWC will leave the RAM cleared to all zeros only on a Power-On Reset. All other resets will bypass any RAM manipulation. It is the responsibility of the boot project and application project to make certain the initial state of RAM is proper for all reset scenarios.

ECC and Parity

The sys_startup function will exit in a state with both RAM and Flash ECC turned on. If this is not the desired state for either the boot or application code, the callout functions could potentially be used to change this (e.g. the boot callout could turn off flash ECC, and the application callout could turn flash ECC back on).

The AppStartup can be configured to test parity on the applicable peripheral RAM. After the test, the parity will be left in the enabled state; however, the integration application code will need to configure response to failures (ISRs, etc).

Runnable Scheduling

This section specifies the required runnable scheduling.

InitScheduling RequirementsTrigger
RunnableScheduling RequirementsTrigger

Memory Mapping

.resetcause Section

A “.resetcause” memory section must be defined in both the boot and application linker file. This holds a 32bit variable to be located in RAM memory. This variable is shared between the boot and the application projects, and therefore must be located in a shared, fixed memory location.

Mapping

Memory SectionContentsNotes

* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.

Usage

Table 1: ARM Cortex R4 Memory Usage

FeatureRAMROM
Full driver

NvM Blocks

Block Name

Compiler Settings

Preprocessor MACRO

<Define all the preprocessor Macros needed and conditions when needed>.

Optimization Settings

<Define Optimization levels that are needed and conditions when needed>.

Other Settings

Revision Control Log

Rev #Change DescriptionDateAuthor Initials
1Initial versionLWW
2Updated to latest Integration Manual Template; Updated reset cause table (section 3.5); Removed sys_core.asm and sys_memory.asm from list of modules needing special compilation (section 6.3) (handled by a directive in the asm files); added information on configuring _fiqhandler6/10/2013KMC
3Removed requirement of compilation of sys_startup and AppStartup in arm mode08/02/13LWW
Last modified October 12, 2025: Initial commit (0347a62)