We are using HALCoGen to generate initialization and HAL code for a TMS570LC4357 Hercules microcontroller. The standard way to use the generated code seems to be to generate a Code Composer project around the generated code.
We would like to structure our code base in such a way that the files generated by HALCoGen are compiled into a library. This library would then be included in the build process of the main project that creates the binary image.
Our two main concerns are:
1) Do you foresee any issues with this?
2) Are there files that we should leave in the main project (e.g. the HL_sys_link.cmd)?
A few quick tests already revealed some potential issues issues when moving the HALCoGen-generated files into a separate project:
1) When the code begins running and calls _c_int00(), instead of calling the Halcogen function located in HL_sys_startup.c, the program calls _c_int00() from the c library (libc.a). This was solved by changing the order in which libraries are linked.
2) Calling _enable_interrupt_() (located in HL_sys_core.asm) causes the program to crash. We notice the Program Counter register moves to the address 0x04 when stepping over the function. However, this does not occur when stepping instruction by instruction in the disassembly (i.e. assembly step over). This problem was solved by moving the .asm files (and not the .h files) back to the main project, where the HL_sys_link.cmd is located.
These are the type of potential issues that we are trying to find ahead of time.
Thank you.