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.

HalCodeGen: Initialize C++ and pass to main()

Other Parts Discussed in Thread: HALCOGEN

If I use HalCodeGen to create the boot loader code for the RM48L952ZWT CPU, I wind up with a bunch of C and h files in the output.

If I create a new project in Code Composer Studio targeting the CPU, I see just a main() function.

  1. How is the integration into CSS done, as far as what executes? How does the build environment know to do all the HalCodeGen files first? Yes, I know that I will copy code and header files into the project. I am comfortable with that.
  2. How is the hand off done to C/C++?
  3. Does HalCodeGen or CSS automatically initialize for C++? I see just the main.c file and stubbed out main() function in Project Explorer.

  • The way I use the two is I start with HALCoGen first and create a new project in the workspace directory of CCS. Then in CCS I create a new CCS project with the same project name as I used in HALCoGen. I then pick "Empty Project". The only additional step I need to do before compiling is to add the project include directory to the include search path in the project settings.

    CCS treats files with ".c" extension as C files and files with ".cpp" extension as C++.
  • Thanks Bob, but I still do not understand what starts the HALCoGen code and what hands off to main() in main.cpp?
  • The HALCoGen generated file "sys_intvecs.asm" defines the reset vector with a branch to the location "_c_int00". That function is defined in the HALCoGen generated file "sys_startup.c". Toward the end of that function is the call to main().