How to use FreeMASTER to measure and calibrate variables

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to use FreeMASTER to measure and calibrate variables

ソリューションへジャンプ
2,796件の閲覧回数
naivewei
Contributor II

Hi,

      I have a problem now. I integrate the Simulink program in the S32DS compiler and burn it into the development board DEVKIT-MPC5744P, but the measured values of the variables in FreeMASTER are all displayed as 0, instead of  the  initial value  in the simulink model. I don't know what went wrong.

     I use JTAG to connect to the development board and select the corresponding elf file.

     As shown in the figure below, I use the data story memory module to set the variables as global variables, and then measure and calibrate in FreeMASTER.

                                                                                                                 Looking forward to reply

 

naivewei_0-1637155291205.png

naivewei_5-1637156242502.png

 

naivewei_4-1637155808766.png

 

naivewei_2-1637155604166.png

 

naivewei_3-1637155647276.png

 

0 件の賞賛
返信
1 解決策
2,765件の閲覧回数
iulian_stan
NXP Employee
NXP Employee

Hi @naivewei,

FreeMASTER can be used to read (monitor) and write (calibrate) your embedded applications variables. 

In your previous screenshot I saw that you've been using BDM plugin that does not require adding FreeMASTER module into your Simulink model. Separate modules are required only if you want to use UART or CAN interface for FreeMASTER communication (as far as I know NXP's toolbox includes example applications demonstrating these two use cases that you can refer to).

Another thing I could suggest is to check the communication log for any errors. Top menu bar: Tools → Communication Debug Log...

Capture.PNG

This screen displays the commands send by FreeMASTER tool to the target board. You can increase verbosity level to see the replies as well.

In case there are no errors means that the value at the memory location given by your variable address is most likely 0 (zero). Another thing that could happen is that the address that FreeMASTER gets from the ELF file does not point to the correct memory location, and FreeMASTER reads the 0 (zero) value from a wrong address.

Considering you modified your code in Design Studio, I would suggest to validate that your application still works as expected (you can find more info on using S32 Design Studio on this HowTo page and this article in particular).

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
2,781件の閲覧回数
iulian_stan
NXP Employee
NXP Employee

Hi @naivewei,

When you say that you "integrated the Simulink program in the S32DS compiler", do you mean that you imported your MatLAB generated project into S32 Design Studio and used Deign Studio to flash it to the board ?

If so:

  • Did you make any changes in your code inside Deign Studio ?
  • Could you use S32DS build-in debugger to debug your application and check if those values have your expected values.

One side note: I noticed that TrackSignal_Mode is declared as float in MatLAB but is of type unsigned int in FreeMASTER.

0 件の賞賛
返信
2,771件の閲覧回数
naivewei
Contributor II

Thank you for your reply,

        yes, I imported the project generated by Matlab into S32 Design Studio. I only used Matlab/simulink to generate the core code, and then built a new MPC5744P project in S32DS, where the underlying code and core algorithm code were performed Integrated and modified, and then used Deign Studio to burn it to the board.

        I am not familiar with the built-in debugger of S32DS, and I have not used the built-in debugger of S32DS to check whether these values ​​have my expected values.
        In response to what you said "TrackSignal_Mode is declared as a floating point number in MatLAB, but it is an unsigned int type in FreeMASTER", I tried to change the data type of TrackSignal_Mode in FreeMASTER, but it did not change. The display result is still 0.
        I want to know whether the model I built in simulink can be used to measure and calibrate variables, and whether to add a FreeMASTER module in simulink. I used NXP's MBD Toolbox MPC5744P before, without adding the FreeMASTER module, and successfully burned a relatively simple program built in simulink into the board through the same operation method, and can be measured and calibrated in FreeMASTER software.

naivewei_0-1637198752166.png

                                                                                    Looking forward to your reply

 

0 件の賞賛
返信
2,766件の閲覧回数
iulian_stan
NXP Employee
NXP Employee

Hi @naivewei,

FreeMASTER can be used to read (monitor) and write (calibrate) your embedded applications variables. 

In your previous screenshot I saw that you've been using BDM plugin that does not require adding FreeMASTER module into your Simulink model. Separate modules are required only if you want to use UART or CAN interface for FreeMASTER communication (as far as I know NXP's toolbox includes example applications demonstrating these two use cases that you can refer to).

Another thing I could suggest is to check the communication log for any errors. Top menu bar: Tools → Communication Debug Log...

Capture.PNG

This screen displays the commands send by FreeMASTER tool to the target board. You can increase verbosity level to see the replies as well.

In case there are no errors means that the value at the memory location given by your variable address is most likely 0 (zero). Another thing that could happen is that the address that FreeMASTER gets from the ELF file does not point to the correct memory location, and FreeMASTER reads the 0 (zero) value from a wrong address.

Considering you modified your code in Design Studio, I would suggest to validate that your application still works as expected (you can find more info on using S32 Design Studio on this HowTo page and this article in particular).

0 件の賞賛
返信
2,746件の閲覧回数
naivewei
Contributor II

Thank you for your reply,

I don’t know what this error code means.

 
naivewei_1-1637304070329.png

 

naivewei_2-1637304099525.pngnaivewei_3-1637304139486.png

 

 

0 件の賞賛
返信
2,738件の閲覧回数
iulian_stan
NXP Employee
NXP Employee

This errors is related to invalid number of scope instances or number scope variables. In your case it happens because you try to create an Oscilloscope instance with no variables attached `SetupScope(varcount:0)`.

But this should not cause the issues related to the variables value because `ReadVar32(addr:0x40000070)` returns status `OK` meaning FreeMASTER was able to read 4 bytes from 0x40000070 (you can set Verbosity Level to All to see the returned value as well).

So far I don't see any FreeMASTER issues. Unfortunately, I'm not familiar with MatLAB and cannot say whether there may be any issues in your Simulink model. You can raise a question in MBDT community space to validate it.

There may also be issues in the exported project or custom changes you made in Design Studio that could be verified by debugging the application.

0 件の賞賛
返信