After generated code ,how to use FreeMaster ?And How to use the generated code with CodeWarrior?
Can somebody give me some advice?
I will be very gratefu for your help?
Hello nie feng,
For you to use FreeMaster, you'll have to configure 2 parts:
First of all, you'll have to enable it from the configuration block/Simulink options (you can click on the Config block, click on Options menu or hit CTRL+E keys). From there, select Code Generation tab -> FreeMASTER Config. Here you can select the interface you want the board to communicate with the FreeMaster, the baud rate and the pins. If you use the SCI1 interface like in our examples, you'll have to check the jumpers for SCI TXD selector and SCI RXD selector (J27, J28). You have select the USB-to-SCI option (pins 2-3 for both).
[FreeMaster application part]
Here, after you opened the FreeMaster application, you'll to go to Project->Options. Here you have to configure:
- Communication - select what type of communication you're using. If you're going for the simple SCI1 as in our examples, you have to select RS232, and select the COM port on which the board is connected, or you can select COM_ALL and it will try to match every available port with it.
- Speed - select the baud rate. Here you must select the same as you have in the Simulink Model..
[MAP Files tab]
- Select at Default symbol file the .elf that was generated with the toolbox.
Now you can click the Start/Stop communication button or just press CTRL+K.
If everything goes well, you have to select some variables that you want to watch. For that right-click on the Variable Watch space, click create new variable.
Here you must select from the Variable tab the Address - you can search it by the variable name. You can change the Sampling period and it's format ("show as"). After that, just click on OK.
Now if everything is ok, you must see your variable and it's value in the Variable Watch zone. If you want to create a scope, right click on "New Project" from the Project Tree, click on Create Scope. I recommend for the first scope you let all the defaults in the Main tab, you can change them after to see what changes what. You'll have to go to the Setup tab and click on a variable from "Graph vars" tab. After you've selected one of them, select from underneath it the variable you want to assign (the variable you added in the previous step) and click OK. If everything is ok, you should see how your variable changes in time.
Hope this helps,
Retrieving data ...