Other Parts Discussed in Thread: C2000WARE, TMS320F28069
Hello C2000 Experts,
Project code is nearing alpha release and needs to run standalone. So far, it's been running with the benefit of an emulator.
The project ran out of RAM space early on, and so the linker command file was modified to run from flash. At this point, the code is running nicely from flash when it's invoked from CCS (v10.4, TI compiler v21.6.0.LTS) via the emulator (XDS100v3).
The code doesn't run without the emulator.
Boot mode 3 is has been configured by keeping GPIO34 & 37 high while /TRST is kept low. OTP hasn't been changed.
The linker command file is as follows:
MEMORY
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAMM0 : origin = 0x000050, length = 0x000570
PRAML0 : origin = 0x008000, length = 0x000300 /* on-chip RAM block L0 */
OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
CSM_RSVD : origin = 0x3F7F80, length = 0x000076 /* Part of FLASHA. Program with all 0x0000 when CSM is in use. */
BEGIN : origin = 0x3F7FF6, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
CSM_PWL_P0 : origin = 0x3F7FF8, length = 0x000008 /* Part of FLASH. CSM password locations in FLASHA */
FLASH0 : origin = 0x3F4000, length = 0x002000 /* on-chp FLASH */
// FLASH1 : origin = 0x3F6000, length = 0x000500 /* on-chip FLASH */
FLASH2 : origin = 0x3F6000, length = 0x001000 /* on-chip FLASH */
FLASH3 : origin = 0x3F7000, length = 0x000f80 /* on-chip FLASH */
IQTABLES : origin = 0x3FE000, length = 0x000B50 /* IQ Math Tables in Boot ROM */
IQTABLES2 : origin = 0x3FEB50, length = 0x00008C /* IQ Math Tables in Boot ROM */
IQTABLES3 : origin = 0x3FEBDC, length = 0x0000AA /* IQ Math Tables in Boot ROM */
ROM : origin = 0x3FF27C, length = 0x000D44 /* Boot ROM */
RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM */
VECTORS : origin = 0x3FFFC2, length = 0x00003E /* part of boot ROM */
PAGE 1 : /* Data Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
BOOT_RSVD : origin = 0x000000, length = 0x000050 /* Part of M0, BOOT rom will use this for stack */
RAMM1 : origin = 0x000600, length = 0x000200 /* on-chip RAM block M1 */
DRAML0 : origin = 0x008300, length = 0x000100 /* on-chip RAM block L0 */
}
/* Allocate sections to memory blocks.
Note:
codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code
execution when booting to flash
ramfuncs user defined section to store functions that will be copied from Flash into RAM
*/
SECTIONS
{
/* Allocate program areas: */
.cinit : > FLASH0 | FLASH1 | FLASH2 PAGE = 0
.pinit : > FLASH0 | FLASH1 | FLASH2 PAGE = 0
.text : > FLASH0, PAGE = 0
codestart : > BEGIN PAGE = 0
ramfuncs : LOAD = FLASH0,
RUN = RAMM0 | PRAML0,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
LOAD_SIZE(_RamfuncsLoadSize),
PAGE = 0
csmpasswds : > CSM_PWL_P0 PAGE = 0
csm_rsvd : > CSM_RSVD PAGE = 0
/* Allocate uninitalized data sections: */
.stack : > RAMM1, PAGE = 1
.ebss : > DRAML0 | RAMM1, PAGE = 1
.esysmem : > DRAML0 | RAMM1, PAGE = 1
.cio : > DRAML0 | RAMM1, PAGE = 1
/* Initalized sections go in Flash */
/* For SDFlash to program these, they must be allocated to page 0 */
.econst : > FLASH0 | FLASH1 | FLASH2 PAGE = 0
.switch : > FLASH0 | FLASH1 | FLASH2 PAGE = 0
/* Allocate IQ math areas: */
IQmath : > PRAML0 PAGE = 0 /* Math Code */
IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
/* .reset is a standard section used by the compiler. It contains the */
/* the address of the start of _c_int00 for C Code. /*
/* When using the boot ROM this section and the CPU vector */
/* table is not needed. Thus the default type is set here to */
/* DSECT */
.reset : > RESET, PAGE = 0, TYPE = DSECT
vectors : > VECTORS PAGE = 0, TYPE = DSECT
}
Per TI C2000 MCU 1-Day Workshop, I note the following:
F2802x_CodeStartBranch.asm has been added to the project. With CCS/emulator, after programming device, and resetting the device, the PC is at 0x3ff7bf. Then when the EMU_BOOT_FLASH script is run, and I single-step (a bunch of times) to codestartbranch in disassembly window, then I can see that _c_int00 is the LB location:
And one more single-step takes me to the start of the program:
If I then select Go Main under the Run menu, the PC runs up to main and halts. Doesn't this indicate that the flash has been programmed properly, and that the boot-loader is properly configured to jump to flash and everything's pretty much ready to go? From here I can hit F8 and the program runs normally.
When I unplug the emulator and cycle target power, the program doesn't run.
Question #1:
What are the steps to have the code run on the target system without the emulator?
By searching the forum, there's no lack of information. Just the opposite, it's overwhelming.
Question #2:
Can anyone point me to a concise document explaining this migration from emulator-run code to standalone?
Thanks,
robin


