Author Topic: Does built in FreeMASTER support of uTasker allow write of global variables?  (Read 3160 times)

Offline tdrobnak

  • Newbie
  • *
  • Posts: 28
    • View Profile
I have been able to use the built in FreeMASTER driver provided with uTasker by enabling the "FREEMASTER_UART" definition and using the UART channel set for DEMO_UART (I changed the DEMO UART channel to a different UART number from FREEMASTER_UART_CH).  When I run FreeMASTER, I have found that it is not possible to modify the value of a global variable.  I can read and plot the global variables, but I cannot modify (write) them.  I have enabled FreeMASTER variable watch to allow modification of the variable using the "Modifying" tab, but stepping through the code, I do not see the variable modified and FreeMASTER does not show the variable modified on the Variable Watch display.  I have looked through the FreeMaster.c file included in uTasker version 1.4.12 19.02.24, and I do not see a case statement that allows a global variable to be modified in function, fnHandleFreeMaster().  Does the uTasker FreeMASTER version handle modification of global variables?  Would I need to enable FREESCALE_FREEMASTER definition in uTasker to allow the global variables to be modified?

Thank you.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Hi

I believe that the defines
FMSTR_USE_WRITEVAR
and
FMSTR_USE_NOEX_CMDS
are required for this to operate in FreeMaster.

The involved code is a part of the standard Freescale FreeMaster file that is used and so doesn't need any additions to work in the uTasker environment.

What the uTasker environment however does add is the capability to write values in Flash or SPI Flash (and view values in SPI Flash), which the original Freescale FreeMaster code can't do.

Regards

Mark

Offline tdrobnak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Thank you for the suggestion, Mark.

I did change FMSTR_USE_WRITEVAR and FMSTR_USE_NOEX_CMDS from 0 to 1, but it did not give FreeMASTER the ability to write a new value to a global variable.  What I did find after looking through the code is that if I define "FREESCALE_FREEMASTER" and pass the FreemasterPortID in the function call FMSTR_ProtocolDecoder(FreemasterPortID,ucFreemasterBuffer), which are now enabled by the FREESCALE_FREEMASTER definition in function fnHandleFreeMaster(), FreeMASTER with uTasker allows global variable modifications.  I also tried setting FMSTR_USE_WRITEVAR and FMSTR_USE_NOEX_CMDS back to 0 and the write ability to global variables is not affected.  I think the call the FMSTR_ProtocolDecoder() was what was needed to give FreeMASTER the ability to modify global variables.

You mentioned that uTasker environment does add the capability to write values in Flash or SPI Flash.  How is this enabled and used with FreeMASTER?  One of the features I want to add to FreeMASTER is the ability to read and modify the Parameter memory through the temp_pars pointer in application.c, but I cannot seem to find a way that FreeMASTER can address the temp_pars pointer structure.

Thank you for your help.

Tom

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Hi Tom

See the define FREEMASTER_STORAGE_ACCESS for the option to allow access in flash/SPI memory (reading and writing). Note however that the variable access is presumably also suitable for internal Flash reading.

If you use the fixed flash addresses for parameter storage you should be able to read the parameters from Flash (although they are not always stored as contiguous bytes due to flash characteristics and also may move due to swap-block operation).

The complication of reading from the parameter structure is that this is is on heap and so Freemaster will not know where it is. You may need to read its pointer value and then display the content as an array at this address instead.

Good luck

Regards

Mark