Dear Michal,
Thank you for your support.
I am sending you this compressed file containing six individual files.
I am flashing the .mot file into the FS32K144 microcontroller. It is a very simple application, it reads the values of the two switches, SW2 and SW3. If both switches are pressed at the same time, the green LED shall be on, otherwise, nothing happens. This code was generated using the blocks in the Simulink MBDT Toolbox provided by NXP (.mdl file).
The .pmpx file is the Freemaster 3.0 project that I created for visualizing the values of these two switches in the software scope. In the FreeMaster Project > Options > MAP Files, I select the .elf file as the "Default Symbol File". The application works fine.
I created the Matlab .m script for a very simple ActiveX interface test, basically, it only displays the value of the SW2 in the prompt. It seems now that it works, even with my custom code on the board.
However, the .py file is a Python script that uses a Websockets application for using the JSON-RPC methods. The idea here is: Start the Freemaster communication, load the value of SW2 into the variable data and Stop the communication. While using the default demo code into the target, it seems to work fine. But when I load my .mot file into the board and try to run the application, it will give me the following error in the Spyder console:
ValidationError: {'jsonrpc': '2.0', 'method': 'OnCommPortStateChanged', 'params': [True]} is not valid under any of the given schemas
Failed validating 'oneOf' in schema:
{'$schema': 'http://json-schema.org/draft-04/schema#',
'definitions': {'common': {'not': {'description': 'cannot have result '
'and error at the '
'same time',
'required': ['result', 'error']},
'properties': {'id': {'note': ['spec says '
'a number '
'which '
'should not '
'contain a '
'fractional '
'part',
'We choose '
'integer '
'here, but '
'this is '
'unenforceable '
'with some '
'languages'],
'type': ['string',
'integer',
'null']},
'jsonrpc': {'enum': ['2.0']}},
'required': ['id', 'jsonrpc'],
'type': 'object'},
'error': {'allOf': [{'$ref': '#/definitions/common'},
{'properties': {'error': {'properties': {'code': {'note': ['unenforceable '
'in '
'some '
'languages'],
'type': 'integer'},
'data': {'description': 'optional, '
'can '
'be '
'anything'},
'message': {'type': 'string'}},
'required': ['code',
'message'],
'type': 'object'}},
'required': ['error']}]},
'success': {'allOf': [{'$ref': '#/definitions/common'},
{'required': ['result']}],
'description': 'A success. The result '
'member is then required '
'and can be anything.'}},
'description': 'A JSON RPC 2.0 response',
'oneOf': [{'$ref': '#/definitions/success'},
{'$ref': '#/definitions/error'},
{'items': {'oneOf': [{'$ref': '#/definitions/success'},
{'$ref': '#/definitions/error'}]},
'type': 'array'}]}
On instance:
{'jsonrpc': '2.0', 'method': 'OnCommPortStateChanged', 'params': [True]}
Besides, in the Freemaster's Communication log I receive the following error:
Script:StartStopComm(start:true) done [ERROR code=0x80004005]
GetTargetSideSymbolInfo(tblindex:0) done [ERROR code=0x80000081]
Actually, it successfully starts the communication with Freemaster, I can see it started running, but it does not return the required value. Even if I comment out the portion of the code for reading the value, the same error persists and I do not know why it is happening.
Thanks again