This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
We have an application that has been built to be executed in RAM for TMS320F28377S. Setting the boot mode GPIOs properly, we want to upload the application via serial interface and then immediately execute it, for example using the Texas Instruments C2000 Serial Flash Programmer application running on Windows 7.
We have met the following issues:
I have the following questions:
Hi Sal,
as you suggested, we have reserved the RAMM0 for the boot ROM, but we have the same problem: at about 70% of firmware transmission the character echo is lost and at the end of the upload the application does not start.
Does any other contraint exist?
Here our linker file contents:
MEMORY { PAGE 0 : /* BEGIN is used for the "boot to SARAM" bootloader mode */ BEGIN : origin = 0x000000, length = 0x000002 FPUTABLES : origin = 0x3FEBDC, length = 0x0006A0 RESET : origin = 0x3FFFC0, length = 0x000002 /* RAMGS0 : origin = 0x00C000, length = 0x001000 RAMGS1 : origin = 0x00D000, length = 0x001000 RAMGS2 : origin = 0x00E000, length = 0x001000 RAMGS3 : origin = 0x00F000, length = 0x001000 RAMGS4 : origin = 0x010000, length = 0x001000 RAMGS5 : origin = 0x011000, length = 0x001000 RAMGS6 : origin = 0x012000, length = 0x001000 RAMGS7 : origin = 0x013000, length = 0x001000 RAMGS8 : origin = 0x014000, length = 0x001000 RAMGS9 : origin = 0x015000, length = 0x001000 RAMGS10 : origin = 0x016000, length = 0x001000 RAMGS11 : origin = 0x017000, length = 0x001000 RAMGS12 : origin = 0x018000, length = 0x001000 RAMGS13 : origin = 0x019000, length = 0x001000 RAMGS14 : origin = 0x01A000, length = 0x001000 RAMGS15 : origin = 0x01B000, length = 0x001000 */ RAMGS : origin = 0x00C000, length = 0x010000 PAGE 1 : BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */ /* RAMM0 : origin = 0x000122, length = 0x0002DE RAMM1 : origin = 0x000400, length = 0x000400 RAMD0 : origin = 0x00B000, length = 0x000800 RAMD1 : origin = 0x00B800, length = 0x000800 */ //RAMECCM : origin = 0x000400, length = 0x000400 RAMECCD : origin = 0x00B000, length = 0x001000 /* RAMLS0 : origin = 0x008000, length = 0x000800 RAMLS1 : origin = 0x008800, length = 0x000800 RAMLS2 : origin = 0x009000, length = 0x000800 RAMLS3 : origin = 0x009800, length = 0x000800 RAMLS4 : origin = 0x00A000, length = 0x000800 RAMLS5 : origin = 0x00A800, length = 0x000800 */ RAMLS : origin = 0x008000, length = 0x003000 CANA_MSG_RAM : origin = 0x049000, length = 0x000800 CANB_MSG_RAM : origin = 0x04B000, length = 0x000800 } SECTIONS { codestart : > BEGIN, PAGE = 0 ramfuncs : > RAMLS, PAGE = 1 .text : > RAMGS, PAGE = 0 .cinit : crc_table(_link_gen_crc_table) > RAMGS, PAGE = 0 .pinit : > RAMGS, PAGE = 0 .switch : > RAMGS, PAGE = 0 .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ .stack : > RAMECCD, PAGE = 1 .ebss : > RAMLS, PAGE = 1 .econst : crc_table(_link_gen_crc_table) > RAMGS, PAGE = 0 FPUmathTables : > FPUTABLES, PAGE = 0, TYPE = NOLOAD /* Section required by linker to put the automatically computed CRC table */ .TI.crctab : > RAMLS, PAGE = 1 /* Section to redirect safety variable in ECC protected RAM */ eccSection : > RAMECCD, PAGE = 1 } /* //=========================================================================== // End of file. //=========================================================================== */
Regards,
Nicola
Hi Sal,
as you suggested, we have modified the gel file F28377D_CPU1.gel as reported, but the effect is the same: on connection, all RAM is 0000.
OnTargetConnect() { *(int *)0x5F412 =0x000F; /* RAM INIT FOR M0/M1/D0/D1 Memory */ *(int *)0x5F432 =0x003F; /* RAM INIT FOR LS0..LS5 Memory */ *(int *)0x5F452 =0xFFFF; /* RAM INIT FOR GS0..GS15 Memory */ if (GEL_IsInRealtimeMode()) /* If in real-time-mode */ { } else /* Put device into C28x Mode */ { C28x_Mode(); } F2837x_Memory_Map(); /* Initialize the CCS memory map */ /* Check to see if CCS has been started-up with the DSP already */ /* running in real-time mode. The user can add whatever */ /* custom initialization stuff they want to each case. */ if (GEL_IsInRealtimeMode()) /* Do real-time mode target initialization */ { } else /* Do stop-mode target initialization */ { /* GEL_Reset(); */ /* Reset DSP */ } }
We have also disabled all reset options in Target Configuration Properties panel as shown in the picture.
How can we achieve our goal?
Thank you,
Nicola
Hi Sal,
as you can see from the linker file, nothing goes in flash.
We have probably identified the problem. To achieve this, we have removed any doubt changing our application: after having disabled the watchdog by code, we perform an infinite loop as soon as the application enter in the main. In such a way, no other piece of code of our application is executed, but the result was the same: the application starts, performs a number of iterations (thousands), but at the end we jump in the boot ROM.
We have then discovered that actually the Watchdog is newer disabled when the application is uploaded via serial with the boot ROM because the hex file of our application, it does not start at address 00000000, but at address 00016837. Here the beginning of our hex file.
[1] AA 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 37 68 02 00 00 00 00 00 41 00 EF 6C 04 00 00 00 E0 9C 01 19 C3 56 FF FF 06 00
Looking inside our map file, we find the object linked to this address, that is the linked rts2800_fpu32.lib
00016837 00000046 rts2800_fpu32.lib : boot.obj (.text)
Proving that the problem is this, if we modify the jump address with the debug after the program uploading in RAM (for example, by putting 00000000 the returned variable EntryAddr = GetLongData ()), our application starts correctly.
Now:
wd_disable: SETC OBJMODE ;Set OBJMODE for 28x object code EALLOW ;Enable EALLOW protected register access MOVZ DP, #7029h>>6 ;Set data page for WDCR register MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD EDIS ;Disable EALLOW protected register access LB _c_int00 ;Branch to start of boot._asm in RTS library .endif
Best regards,
Nicola
Hi Sal,
we have fixed the problem.
We have discovered that CCS for new projects does not set in Build->C2000 Linker->Advanced Options -> Symbol Management the specification of --entry_point, -e to 'code_start' even if the symbol is declared in the linker file and all code is available.
I think that this is a bit misleading since that this kind of behaviour is not obvious or intuitive (you have in your code a legacy procedure called code_start, but this is not actually the application entry point due to an IDE option ...)
By the way, how can we would be able to avoid this kind of error? What whe should have read and where?
Best regards,
Nicola