Hi,
We are using the CCV4 for developing embedded product for avionics domain. We are using the TMS570LS20216SPGEprocessor. As of now we are able to run the code on the target with Run time library inclusion. But as per the avionics guidelines, final object code should not contain any code that is related to run time libraries.
I have used the HALCOgen tool to generate the initial drivers required for the processor TMS570LS20216SPGE. I have followed the steps mentioned in the application report SPNA 121A to create the project in the ccv4. In the project properties, i found that libc (index library) is included. I have deleted this from the project options and also deleted the included files from the project. Then i try to build the program, I got few errors related to missing functions or symbols. Ex : __TI_zero_init, exit and copy_in, memcpy functions. From the lib folder (provided in Texas compiler folder) I have copied the definitions of these functions to main application program and built it. I am successful in building the code. Then I flashed the code to target, it works as i expected ( i have written the code for NHET pulse measurement, which works fine).
Is my approach towards run time library deletion is correct? (Because i am not sure if any other files required by target processor are present in the libc)
The following items are necessary for proper initialization of the TMS570LS20 device as per the application report SPNA119.
--> Initialization of internal R4F core registers and return stack, Setup stacks, Configure Flash memory option, Setup system and peripheral clocks.
When i go through the system_startup.c file, i found that _c_int00 function is defined (which is the system reset Interrupt ). And all the above are done in the _c_int00 function. So i am sure that code execution starts from this function and all the functions calls made after this are in my main application program only.
Now here are my questions about assembly code used in the program. As this a avoincs project, for each and every line in the program, reference to manuals and justification is required.
1. The function _memoryInit_ is called in _c_int00. Which memory this asm function is initializing and to what value ? (Ref : sys_memory.asm)
2. The following functions are define in the sys_core.asm file, but not called anywhere. Looks like all thse functions are for enabling or disabling some features of the processor. What is the state of these features after reste ? Shall we have to enable or diable ?
_coreEnableEventBusExport_, _coreDisableEventBusExport_, _coreEnableRamEcc_, _coreDisableRamEcc_, _coreEnableFlashEcc_, _coreDisableFlashEcc_
3. Some more functions are about the fault status and clearing (Ex :_coreGetDataFaultAddress_, _coreClearDataFaultAddress_). Do we need these?
4. _coreInitRegisters_ : The Cortex-R4F core supports seven modes of operation. This function is used to set the registers to default value in every mode of operation. From where should (reference) i get the default value for these registers in each mode?
5. _coreInitRegisters_ : This function implementation in the the application report SPNA119 and the project created using the HALCogen tool are differs. Why ? Or is my understanding wrong? Ex : a) r1 register is set with zero in the application report where as generated code set to 0x03D0. b) values used for setting core to corresponding mode also differs.
6. Provide me the references for better understanding of assembly instruction set.
7. Is there any need for exit() function once after the main function call ? As the code in main run always in infinite loop ?
8. Please let me know any other functions required for the processor that need to be added to application program as libc library is deleted from the project.
And also suggest me if anything else to be done as a part of system initialization.
Thanks a lot in advance.