AnsweredAssumed Answered

elftosb: string parameter

Question asked by Peter Ruesch on Jul 7, 2016
Latest reply on Jul 11, 2016 by Peter Ruesch


Hi,

 

I'm having trouble to set a string constant via a command line argument.

I want to specify the firmware binary file as a parameter when calling elftosb.

 

invocation elftosb:

[developer@localhost linux]$ ./elftosb --debug --command command_file.bd --output output.sb -DAPPLICATION_OFFSET=0xA000 -DAPPLICATION_BINARY=debug.bin
failed to open source file: xyz.bin (ignoring for now)
APPLICATION_OFFSET = 40960
APPLICATION_BINARY = 0
error: line 20: error opening source 'APPLICATION_BINAR

 

my command_file.bd:

constants
{
   APPLICATION_OFFSET = 0;
}

sources
{
  APPLICATION_BINARY = "xyz.bin";
}


section (0)
{
   erase all;
   info "APPLICATION_OFFSET = $(APPLICATION_OFFSET)";
   info "APPLICATION_BINARY = $(APPLICATION_BINARY)";


   if (0 != APPLICATION_OFFSET)
   {
      load APPLICATION_BINARY > APPLICATION_OFFSET;
      reset;
   }
   else
   {
      error "-DAPPLICATION_OFFSET=0x?????? must be supplied";
   } 
}

 

I want to have to "xyz.bin" replaced dynamically as it works great with the APPLICATION_OFFSET value.

Outcomes