I'm currently trying to work through the following tutorial:
https://www.nxp.com/design/training/getting-started-with-freemaster-lite-and-json-rpc-protocol:GETTI...
I'm using the following product:
https://www.nxp.com/design/development-boards/automotive-motor-control-solutions/arm-based-solutions...
My goal is to try to get FreeMASTER Lite to work with this device from a Raspberry Pi with a Linux based OS.
Currently I have a Windows 10 pc with a VM of Ubuntu 20.4. I have everything installed on the Win10 pc, as well as everything installed on Ubuntu VM (except FreeMASTER Communications Driver, which I could not locate for Linux. Is there a Linux version available).
I have changed the "connection" variable in the example code to match my device.
Using Win10: When going through the example code provided with FreeMASTER Lite (FML_Python.ipynb), all of the code works, until ln[13], at which point I get the following error:
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-13-c73f0bac6521> in <module>
----> 1 data = await SendRequest(jrpc, 'GetConfigParamString', "VS", 20)
2 print('Application version: ' + data)
<ipython-input-4-c6ba3a234475> in SendRequest(jrpc, method, *args)
4 return response.data.result['data']
5 else:
----> 6 raise Exception(response.data.result['error'])
Exception: {'code': 2147483907, 'message': "Can't detect board."}
I've been unable to fix this. Assistance would be appreciated.
解決済! 解決策の投稿を見る。
Thanks for the update.
After replacing the dll, I was able to control the motor.
Stephen
Hi @sjc230,
FreeMASTER Driver is a communication library that implements the communication protocol on the target MCU side. Applications distributed with MCSPTE1AK144 development kit already include it and no action is required on that side.
Your error `Exception: {'code': 2147483907, 'message': "Can't detect board."}` tells me that FreeMASTER tool was not able to detect the target board - this is a bit strange because in this case previous call
await SendRequest(jrpc, 'IsBoardDetected')
print('Board detected')
should've failed with the same error. Going further, `GetConfigParamString` would fail anyway because MCAT example applications use an older version of FreeMASTER Driver that does not implement some API calls. Could you replace 'GetConfigParamString' calls with:
data = await SendRequest(jrpc, 'GetDetectedBoardInfo')
print('Detected board info: ' + data)
It should return a similar result you can see in the tutorial @16:20.
Note `protVer` property is equal to `3`. `GetConfigParamString` was added in version 4. You can find full list of API calls in {FreeMASTER_install_dir}/html/documentation/PCM.html.
To summarize: calls to `GetConfigParamString` would fail either way. Try replacing it with `GetDetectedBoardInfo`. All other calls from the Jupyter notebook should work with your application.
Another note on your goal - although FreeMASTER Lite supports Linux, the binaries are built for a x86 platform, and I would expect it to fail if you were to run it on ARM (Raspberry PI).
Thanks for the assistance. I implemented the recommended code and it worked. I had some initial problems with it, but it was due to a loose connection on the board.
I've exported the freemaster configuration file as shown in the tutorial. I would like to change the motorspeed on the board via RPC. The variable I'm interested in (according to various posts in the community) from the config file is as follows:
{
"name": "Speed Required",
"addr": "drvFOC.pospeControl.wRotElReq",
"size": 4,
"type": "float"
},
Note that when I enumerate the symbols on the board, one of those symbols is "drvFOC"
If I use "drvFOC.pospeControl.wRotElReq" when creating the variable, "drvFOC.pospeControl.wRotElReq" becomes the alias, but no actual address is assigned. An I cannot read or write to it. How do I get this address?
{'name': 'Speed Required', 'type': 'float', 'size': 4, 'alias': 'drvFOC.pospeControl.wRotElReq'}
If I use "drvFOC" only as the variable address, it becomes the alias and an actual address is assigned. and I can read/write.
{'name': 'Speed Required', 'addr': 536873776, 'type': 'float', 'size': 4, 'alias': 'drvFOC'}
Hi @sjc230,
I suspect it's a FreeMASTER Lite bug.
An workaround for this issue is to use known symbol + offset. I used FreeMASTER project (.pmp) to check the addresses of 'drvFoc' and 'drvFOC.pospeControl.wRotElReq' and got the offset of 368 (this value is a constant that shows 'wRotElReq' offset inside the structure).
You can update variable information as follows:
{
"name": "Speed Required",
"addr": "drvFOC + 368",
"size": 4,
"type": "float"
},
We will further investigate this issue and post updates in this thread.
Apologies for the inconveniences.
Thanks for the information. I have a freemaster project setup. I can locate the variables under the project menu, but cannot locate the actual addresses. In the address window of the variables, it has the "virtual address". Example: "cntrState.usrControl.switchAppOnOffState". How did you get the actual address in the projcet?
Thanks
Stephen
The way FreeMASTER handles symbolic information (variables addresses) is described in the FreeMASTER User Guide ch. 5.2. To summarize - there are 2 options:
Hello,
I am having similar issue: "can't detect board" on Freemaster Lite on Linux platform. Is there anything I am missing?. Thank you.
Regards,
TetraWise
Checking Error if any, from Received Data on method IsBoardDetected :
Ok(result={'success': True, 'data': False}, id=2)
False