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.

TMS320F28P659DK-Q1: How to Safely Use SysConfig-Generated Macros (e.g., ePWM_SYNC_BASE) in CLA or CPU Assembly Code?

Part Number: TMS320F28P659DK-Q1
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Tool/software:

Hi TI team,

I'm working on a C2000 project using SysConfig, and I'd like to reference macros generated by it (e.g., ePWM_SYNC_BASE from board.h) inside my CLA and CPU .asm / .cla files.

The goal is to ensure that if I update anything in SysConfig, those changes propagate correctly to all parts of the application — including any low-level assembly code — without manually duplicating values like register base addresses.

However, when I try to use:

.cdecls C, LIST, "board.h"

...in a CLA source file, I get parsing errors, likely due to board.h including other headers (like driverlib.h) that aren’t compatible with the .cdecls mechanism. I understand .cdecls has strict limitations and can only include simple macros, not types or complex C constructs.

My Questions:

  1. What is the officially recommended way to expose SysConfig-generated macros (like ePWM_SYNC_BASE ) to CLA and/or CPU assembly files?

  2. Is there a SysConfig-supported mechanism (or planned feature) to automatically generate a "CLA-safe" header with just #defines for addresses and constants?

  3. Would using the --preproc_only compiler option to preprocess board.h and filter out only #defines for a CLA header be considered a safe and supported workaround?

Any insight from the TI tools or C2000 team would be much appreciated!

Thanks in advance,
Sebastia

  • Hi Sebastia, 

    Pls find responses to your questions

    1.  The .cla file can include header files similar to C using #include .  There are examples provided in C2000Ware for CLA which include header files in the .cla files. 

    I am not sure about assemble files. 

    2. There is no such feature planned. 

    3. You can try option 1 to see if it works before trying this out.

    Best Regards

    Siddharth

  • Hi Siddharth,

    Thank you for the response.

    Just to clarify, I'm working with assembly files (.asm), not .cla files. Because of that, I can't use the #include directive directly — that's why the .cdecls directive is typically used.

    I tried including board.h, but it throws a lot of errors in the assembly context. The only solution I’ve found so far is to manually copy the necessary macros from board.h into a new file, cla_shared.h, and wrap them inside an #ifdef __ASM_HEADER__ block.

    This approach works, although it requires manual updates whenever I make changes to peripherals in SysConfig.

    Best regards,
    Sebastian