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.

TMS320F28377S: branching to C code (related to application code flashing) before _c_int00 function

Part Number: TMS320F28377S

Hi Team,

I have seen in multiple places in forum and notes that "No C code can be executed until _c_int00 setup routine is run where stack and variable initialization etc. will be done".

References: 

1. Running an Application from Internal Flash Memory on the TMS320F28xxx DSP (Rev. L)

2. Piccolo 3-Day Workshop, Peripheral, and Architecture Training Course Materials

3. https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/564640/ccs-tms320f28335-dspxxx_codestartbranch-asm-and-boot28-inc-files-start-up-using-c-language-rather-assembly

 

We have a part of code which related to flashing the application code which is written in c and will be run before the _c_int00 function. like below,

wd_disable:
    .if WD_DISABLE == 1
	    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
	    LCR _boot_main
	    LB Entry_2_Cint_00         ;Branch to start of boot._asm in RTS library
	.endif

	.end

boot_main function called before _c_int00 function. We didn't observe any issues but I want to know what can be the issues with this implementation. I have few doubts,

1. Without stack initialization what will be the stack address?

2. If I am not using any variables and functions of boot_main in main application code, still there can be any issue with the above implementation?

3. What should be the ideal way if I want to call the c function before main function?

Thanks in advance.