def configure(elf_file, target=@targets.keys.first)

      #Ensure the target is a string.
      target = target.to_s
    
      #Get the path to the bitfile and memory map which will be used to generate the new bitfile.
      memory_map = "#@base_path/#{@targets[target]['memory_map']}"
      bit_file   = "#@base_path/#{@targets[target]['bit_file']}"

      p target, bit_file

      #Generate the new raw bitfile...
      hex = with_temporary_files                      { |dest, _|      system("avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock #{elf_file} #{dest}") } 
      mem = with_temporary_files(hex, '.mem', '.hex') { |dest, source| system("srec_cat #{source} -Intel -Byte_Swap 2 -Data_Only -Line_Length 100000000 -o #{dest} -vmem 8") }
      bit = with_temporary_files(mem, '.bit', '.mem') { |dest, source| system("data2mem -bm #{memory_map} -bt #{bit_file} -bd #{source} -o b #{dest}") }

      #... wrap it in a Bitstream object, and return it.
      Adept::DataFormats::Bitstream.from_string(bit)

    end
def configure(elf_file, target=@targets.keys.first)

      #Ensure the target is a string.
      target = target.to_s
    
      #Get the path to the bitfile and memory map which will be used to generate the new bitfile.
      memory_map = "#@base_path/#{@targets[target]['memory_map']}"
      bit_file   = "#@base_path/#{@targets[target]['bit_file']}"

      p target, bit_file

      #Generate the new raw bitfile...
      hex = with_temporary_files                      { |dest, _|      system("avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock #{elf_file} #{dest}") } 
      mem = with_temporary_files(hex, '.mem', '.hex') { |dest, source| system("srec_cat #{source} -Intel -Byte_Swap 2 -Data_Only -Line_Length 100000000 -o #{dest} -vmem 8") }
      bit = with_temporary_files(mem, '.bit', '.mem') { |dest, source| system("data2mem -bm #{memory_map} -bt #{bit_file} -bd #{source} -o b #{dest}") }

      #... wrap it in a Bitstream object, and return it.
      Adept::DataFormats::Bitstream.from_string(bit)

    end
Initializes a new instance of a Core object.


  Configures the given