Currently in SES you can use symbol or hex value to set initial stack pointer value (Debug-> Debugger .. ).
It would be great if there were other ways to do this - particularly through script or SES' macros expansion & execution.
E.g. I would like to use this l33t script function (with emScript):
function get_sp_val_from_bin(){
//Note: bin_file_full_path must be defined when calling the script with -define
//The bin file for a Cortex M will have SP value as first word / 32bit
BinaryFile.load( bin_file_full_path );
var val = BinaryFile.peekUint32(0, true);
return val;
}
spval = get_sp_val_from_bin();
WScript.Echo( "0x" + spval.toString(16) );
and then in SES specify the intial SP value with possibly something like:
$(StudioDir)/bin/$(StudioScriptToolExeName) -define 'bin_file_full_path'='$(ProjectDir)/$(OutDir)/hello_world.bin' -load $(ProjectDir)/initial_sp.js
It would be great if there were other ways to do this - particularly through script or SES' macros expansion & execution.
E.g. I would like to use this l33t script function (with emScript):
function get_sp_val_from_bin(){
//Note: bin_file_full_path must be defined when calling the script with -define
//The bin file for a Cortex M will have SP value as first word / 32bit
BinaryFile.load( bin_file_full_path );
var val = BinaryFile.peekUint32(0, true);
return val;
}
spval = get_sp_val_from_bin();
WScript.Echo( "0x" + spval.toString(16) );
and then in SES specify the intial SP value with possibly something like:
$(StudioDir)/bin/$(StudioScriptToolExeName) -define 'bin_file_full_path'='$(ProjectDir)/$(OutDir)/hello_world.bin' -load $(ProjectDir)/initial_sp.js