Ejemplo n.º 1
0
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extract and patch the interface without bootloader
"""
from options import get_options
from paths import get_interface_path, TMP_DIR
from utils import gen_binary, is_lpc, split_path

from os.path import join

if __name__ == '__main__':
    options = get_options()

    in_path = get_interface_path(options.interface,
                                 options.target,
                                 bootloader=False)
    _, name, _ = split_path(in_path)
    out_path = join(TMP_DIR, name + '.bin')

    print '\nELF: %s' % in_path
    gen_binary(in_path, out_path, is_lpc(options.interface))
    print "\nBINARY: %s" % out_path
Ejemplo n.º 2
0
        image.write(bootloader.read())

        # Write padding
        for _ in range(offset - bootloader_size):
            image.write(pack('B', 0xFF))

        # Copy interface
        image.write(interface.read())


if __name__ == '__main__':
    options = get_options()
    print 'Generating image for (if: %s, target: %s)' % (options.interface,
                                                         options.target)

    bootloader_elf = get_bootloader_path(options.interface)
    print 'Bootloader: %s' % bootloader_elf

    interface_elf = get_interface_path(options.interface, options.target)
    print 'Interface : %s' % interface_elf

    image_bin = get_image_path(options.interface, options.target)
    print 'Image     : %s' % image_bin

    gen_binary(bootloader_elf, TMP_BOOTLOADER_BIN_PATH,
               is_lpc(options.interface))
    gen_binary(interface_elf, TMP_INTERFACE_BIN_PATH)

    merge(TMP_BOOTLOADER_BIN_PATH, TMP_INTERFACE_BIN_PATH, image_bin,
          BOOTLOADER_SIZES[options.interface])
Ejemplo n.º 3
0
        
        # Copy bootloader
        image.write(bootloader.read())
        
        # Write padding
        for _ in range(offset - bootloader_size):
            image.write(pack('B', 0xFF))
        
        # Copy interface
        image.write(interface.read())


if __name__ == '__main__':
    options = get_options()
    print 'Generating image for (if: %s, target: %s)' % (options.interface, options.target)
    
    bootloader_elf = get_bootloader_path(options.interface)
    print 'Bootloader: %s' % bootloader_elf 
    
    interface_elf = get_interface_path(options.interface, options.target)
    print 'Interface : %s' % interface_elf
    
    image_bin = get_image_path(options.interface, options.target)
    print 'Image     : %s' % image_bin
    
    gen_binary(bootloader_elf, TMP_BOOTLOADER_BIN_PATH, is_lpc(options.interface))
    gen_binary(interface_elf , TMP_INTERFACE_BIN_PATH)
    
    merge(TMP_BOOTLOADER_BIN_PATH, TMP_INTERFACE_BIN_PATH, image_bin,
          BOOTLOADER_SIZES[options.interface])
Ejemplo n.º 4
0
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extract and patch the interface without bootloader
"""
from options import get_options
from paths import get_interface_path, TMP_DIR
from utils import gen_binary, is_lpc, split_path

from os.path import join


if __name__ == '__main__':
    options = get_options()
    
    in_path = get_interface_path(options.interface, options.target, bootloader=False)
    _, name, _ = split_path(in_path)
    out_path = join(TMP_DIR, name + '.bin')
    
    print '\nELF: %s' % in_path
    gen_binary(in_path, out_path, is_lpc(options.interface))
    print "\nBINARY: %s" % out_path