SPRUIY8 October   2024 F29H850TU , F29H859TU-Q1 , TMS320C28341 , TMS320C28342 , TMS320C28343 , TMS320C28343-Q1 , TMS320C28344 , TMS320C28345 , TMS320C28346 , TMS320C28346-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2C28 to C29 CPU Migration
    1. 2.1 Use Cases
    2. 2.2 Key Differences
    3. 2.3 Source Code Migration
      1. 2.3.1 C/C++ Source Code
        1. 2.3.1.1 Pragmas and Attributes
        2. 2.3.1.2 Macros
        3. 2.3.1.3 Intrinsics
        4. 2.3.1.4 Inline assembly
        5. 2.3.1.5 Keywords
        6. 2.3.1.6 Data Type Differences
        7. 2.3.1.7 Tooling support for Migration
      2. 2.3.2 Assembly Language Source Code
    4. 2.4 Toolchain Migration
      1. 2.4.1 Compiler
      2. 2.4.2 Linker
      3. 2.4.3 CCS Project Migration
  6. 3CLA to C29 CPU Migration
    1. 3.1 Use Cases
    2. 3.2 Key Differences
    3. 3.3 Source Code Migration
      1. 3.3.1 C/C++ Source Code
        1. 3.3.1.1 Data Type Differences
        2. 3.3.1.2 Migrating CLAmath.h Functions and Intrinsics
        3. 3.3.1.3 Migrating C28 and CLA to the Same C29 CPU
        4. 3.3.1.4 Migrating C28 and CLA to Different C29 CPUs
      2. 3.3.2 Assembly Language Source Code
    4. 3.4 Toolchain Migration
  7. 4References

Data Type Differences

  1. Data type differences - are summarized and highlighted in Table 3-2: Red for CLA-C29 differences and Blue for CLA-C28 differences.
    1. Shared data - Data type differences between the C28 and CLA have an impact when data is shared between the C28 and CLA (shared structures). The recommended approach here is to use padding through a union to solve the pointer or integer size difference as described in the CLA software development guide. For example, unions are used in the C2000Ware DigitalPower SDK solutions for enums (int based) shared between C28 and CLA. These enums define which Lab, board status, and so forth are being used. Since C29 devices do not contain a CLA, there is no issue of shared structures, so the above data type differences are not of concern from that perspective.
    2. However, data type differences between the C29 and CLA are relevant when migrating code from CLA to the C29. The issues and how to address them are similar to the items laid out in the C28-C29 data type differences (see Section 2.3.1.6).
      1. Pointer size differences exist between the CLA (16-bit) and C29 (32-bit).
      2. "Char" differences, as described in the C28 to C29 source code migration section. The C29 compiler's c29clang-tidy tool's checkers on char range (c29migration-c28-char-range) and char pointer arithmetic (c29migration-c28-types) are useful here as well.
Table 3-2 Data Type Key Differences
Type C28 CLA C29 ARM
char 16 16 8 8
short 16
int 16 32 32 32
long 32
long long (COFF) 64 32

N/A

64
long long (EABI) 64
float 32
double (COFF) 32 32 N/A 64
double (EABI) 64
long double (COFF) 64 32 N/A 64
long double (EABI) 64
Pointers 32 16 32 32