Using CodeWarrior IDE

To link a binary file using CodeWarrior IDE, perform the following steps:

  1. Launch CodeWarrior and open the desired project to add the binary file.
  2. Add a binary file ( bin_data.bin ) to project.
  3. Select Properties > C/C++ Build > Settings > Tool Settings > PowerPC Linker > General and add the binary file to the Other Flags text box.
  4. Update linker command file (.lcf) and place .BINARY section into memory. Linker Command File with .BINARY section shows a sample linker command file with .BINARY section.
    Listing 1. Linker Command File with .BINARY section
    MEMORY
    {
    
        resetvector:        org = 0x00000000,   len = 0x00000008
    
        init:               org = 0x00000020,   len = 0x00000FE0
    
        exception_handlers: org = 0x00001000,   len = 0x00001000
    
        internal_flash:     org = 0x00002000,   len = 0x001FD000
    
        my_binary_data:     org = 0x001FE000,   len = 0x00001000
    
    ...
    
    }
    
    SECTIONS
    
    {
    
    .__bam_bootarea LOAD (0x00000000): {} > resetvector
    
    ...
    
      .binary1_area: 
    
    {
    
            binary1Start = .;
    
            bin_data1.bin
    
            binary1End = .;
    
    
    
    } > my_binary_data
    
    }
    
    .binary2_area: 
    
      {
    
          binary2Start = .;
    
          bin_data2.bin
    
          binary2End = .;
    
    
    
     } > my_binary_data
    
    }
    
    
    
    }