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.

What are predefined macros?

Other Parts Discussed in Thread: SYSBIOS

RE: AM335x SYSBIOS Industrial SDK 01.00.00.06 User Guide, Section 12, Building Bootloader.

http://processors.wiki.ti.com/index.php/AM335x_SYSBIOS_Industrial_SDK_01.00.00.06_User_Guide#Building_Bootloader.C2.A0

5. Set predefined macros as follows. For IDK, include HW_IDK  and remove SPI macro. For ICE, include HW_ICE and SPI.

What are predefined macros and how are they set? I'm using ICE.

Thanks, Ben

  • Hi Ben,

    This is an example pre-defined macro;

    #define BOARD_ICE335X

    What this does is allows developers to write a single file for use on multiple systems, such as the ICE, EVM, and SKs.  This is done so source code will build specifically for a certain board (usually dev kits).

  • Maybe the term macro is a bit misleading in that context. Yes, you can define whole 'macros' with a #define.

    But what it is used for here in the context of IA-SDK is conditional computation. Based on #define done or not you will get different code included in the source and therefor a different behavior of the program. This is often used to save lines of code but can get pretty confusing if used excessively.

    #define can be set in files (e.g. header) or in the development environment (compiler options...). In the later case it will be stored in the project file. So if you start a new project don't forget to copy the necessary compiler options from examples.

    Regards.

  • Thanks, but it is still not clear to me exactly what is required here.

    From your description it seems I need to add the following #defines for ICE board:

    #define HW_ICE

    #define SPI

    But which header file do I add them to or which compiler option do I modify in CCS?

  • HI Ben,

    If you are using CCS to build the boot loader, you can set the macro in project properties. Steps below to be followed on CCS 5.2.xx are given below

    1. Go to Menu->Project->Properties in CCS
    2. Go to Build->TMS470 Compiler->Advanced Options->Predefined Symbols ( You will see all pre-build macros there and can add/edit/delete it).

    Regards,

    Shahid

  • Thanks Shahid, I've got it now.