Hi,
I would suggest you to use FreeMaster. FreeMaster is a powerful tool, it is not only an interface to watch/change/scope real time variables, it is an Active X component able to access to MCU variables through serial port/debugger tools, etc. So, one of the reason of the existence of the tool is your use case, without stopping the application you can watch and change variables on target.
If you have a look to FreeMaster manual: C:\Program Files\Freescale\FreeMASTER 1.3\pcm_um.pdf
You will find the Matlab script to access to the target:
6.6.4Matlab m-script
Test this code at Matlab console
% create FreeMASTER ActiveX object
fmstr = actxserver ('MCB.PCM'); % write 0x10 value into "var16" variable defined in FreeMASTER project bSucc = fmstr.WriteVariable('var16inc', 16); var16 = 0; % read the "var16" variable as defined in FreeMASTER project % "!" - immediate performs the command bSucc = fmstr.ReadVariable('var16'); if bSucc var16 = fmstr.LastVariable_vValue; end % show the value var16 % configure matlab to accept safe array as single dimension feature('COM_SafeArraySingleDim', 1) ; % write 4 bytes to memory 0x20. WriteMemory function expects SafeArray as input data bSucc = fmstr.WriteMemory(32, 4, {11;22;33;44}) % reads 4 bytes from memory at address of var32inc variable bSucc = fmstr.ReadMemory('var32inc', 4);
if bSucc % reads data of last call the ReadMemory()function. readMemResult = fmstr.LastMemory_data end % write to memory at pointer. The value of "var8" represents the pointer, 0x02 is offset. % this is only demonstration !!Beware that wrong value of var8 may cause memory corruption!! array = [11;22;33;44]; bSucc = fmstr.WriteUIntArray('valueof(var8) + 0x02', 4, 1, {array});
Page 75 of the manual.
Regards,
Luis