Hello,
There are hooks in the srec2flash utility that should allow you to do this. Here's an output that I get by running 'srec2flash' with no arguments:
$ srec2flash
flash address: 0x00140000
ram address: 0x00000000
max copy size: 0x00000000
srec2flash <filename>.srec
--flash_address=x Where in flash to store the copier & program,
(defaults to 0x140000)
--ram_address=x Where in RAM to copy the program to, and execute
(defaults to 0x40000)
--copy_size=x How many bytes to copy from flash to RAM
(defaults to 0x40000)
--sdk_directory=<dir> Specify an sdk directory
"srec2flash"
The Nios development board's Germs monitor looks
for code in flash memory. The srec2flash utility
takes code targeted for program memory and
prepends a copying routine to copy itself from
flash memory to program memory. It also prepends
the necessary Germs monitor commands to write
the file into flash.
The output, <filename>.flash, can be burnt to
flash by using nios-run:
nios-run -x <filename>.flash
(Only works over serial; nios-run over jtag
does not support this feature.)
In other words, this command does return the default values, when run with no arguments, but by using the --ram-address=<your_new_location> option, you should see the behavior that you want.
Hope this helps.
Cheers,
- Brendan