How to integrate freemaster into MQX project? i use MPC5643L chip

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

How to integrate freemaster into MQX project? i use MPC5643L chip

2,165件の閲覧回数
wendywendy
Contributor I

I use MPC5643L to do my project with codewarrirer 10.6 IDE. In my project, i use MQX 3.8. my question is i want to integrate freemaster to my project to watch variables and waveforms. but i can't find any example and any document to tell how to do that. could anyone help me ?

thanks!

0 件の賞賛
返信
5 返答(返信)

2,106件の閲覧回数
iulian_stan
NXP Employee
NXP Employee

Hi @wendywendy,

As far as I know FreeMASTER support for MPC was added in S32 Design Studio for Power Architecture. In case of CW your would need to get the FreeMASTER Driver source code and integrate it manually into your CW project.

The driver package can be downloaded from FreeMASTER's home page

Capture.PNG

 

Inside the package you can find example projects for MPC56xx that you can use as reference.

For steps on manual driver integration into a a clean project, you can refer to this post.

0 件の賞賛
返信

2,080件の閲覧回数
wendywendy
Contributor I

Thanks for your reply. i find the src_common and src_platform files and put them in my project. I find my many example about intergrating freemaster in project. but no example is find intergrating freemaster with MQX project. could you please give some hint? thanks. 

 

库文件.png

exampleexample

0 件の賞賛
返信

2,021件の閲覧回数
MichalH
NXP Apps Support
NXP Apps Support

Hello,

there is no example showing a FreeMASTER serial driver integration with MQX RTOS. You can take a look at the freemaster_serial.c and search for FMSTR_USE_MQX_IO code sections. If this macro is enabled, the serial driver will use MQX fread/fwrite calls to underlying serial driver.  You just need to call FMSTR_Poll() periodically in one of MQX tasks (see how FMSTR_ProcessMQXIO() is implemented for more information).

You will need to include the src_platforms/MQX files in your project and use the freemaster_cfg.h.example from this folder as your main freemaster_cfg.h configuration file.

See section 4.13 in the FMSTRSCIDRVUG.pdf which describes the configuration macros used by MQX integration.

This code is quite old and it is not supported anymore by NXP. You can seek support officially at https://embeddedaccess.com/.

Regards,
Michal

0 件の賞賛
返信

1,892件の閲覧回数
wendywendy
Contributor I

Thanks for your guide.

I follow your guide and add common file and src_platforms/MQX files. and i add freemaster task. and please see code snapshot. but i still faild to connect. In order to verify if my hardware is ok, i test uart transmit and successed to send data out from board.

wendywendy_0-1728479050324.png I put  FMSTR_Poll() in PERIOD_5MS_TASK

wendywendy_1-1728479194066.pngthis is detailed of period task content. 

wendywendy_2-1728479264216.png this is uart iniltialization. I put a break point here. I find the code is stuck here( "FMSTR_Init()"; )

when dig into the function, the code stuck in blow position. it seems that code can not open communication port.

wendywendy_3-1728479572607.png

based on the above information, which direction should i go to check? could you help me ?

Besides, the blow is cfg file.

/***************************************************************************//*!
*
* @file freemaster_cfg.h.example
*
* @brief FreeMASTER Serial Communication Driver configuration file
*
*******************************************************************************/

#ifndef __FREEMASTER_CFG_H
#define __FREEMASTER_CFG_H

/*****************************************************************************
* Select communication interface
******************************************************************************/

#define FMSTR_DISABLE 0 /* To disable all FreeMASTER functionalities */
#define FMSTR_USE_MQX_IO 1 /* To select MQX IO communication interface */
#define FMSTR_USE_PDBDM 0 /* To select Packet Driven BDM communication interface */

// Please make sure that FreeMASTER is not using same interface like
// MQX IO CHANNEL defined by BSP_DEFAULT_IO_CHANNEL
#define FMSTR_MQX_IO_CHANNEL "ttya:" // "ittyd:"
#define FMSTR_MQX_IO_BLOCKING 1

/******************************************************************************
* Input/output communication buffer size
******************************************************************************/

#define FMSTR_COMM_BUFFER_SIZE 0 /* set to 0 for "automatic" */

/*****************************************************************************
* Support for Application Commands
******************************************************************************/

#define FMSTR_USE_APPCMD 1 /* enable/disable App.Commands support */
#define FMSTR_APPCMD_BUFF_SIZE 32 /* App.Command data buffer size */
#define FMSTR_MAX_APPCMD_CALLS 4 /* how many app.cmd callbacks? (0=disable) */

/*****************************************************************************
* Oscilloscope support
******************************************************************************/

#define FMSTR_USE_SCOPE 1 /* enable/disable scope support */
#define FMSTR_MAX_SCOPE_VARS 8 /* max. number of scope variables (2..8) */

/*****************************************************************************
* Recorder support
******************************************************************************/

#define FMSTR_USE_RECORDER 1 /* enable/disable recorder support */
#define FMSTR_MAX_REC_VARS 8 /* max. number of recorder variables (2..8) */
#define FMSTR_REC_OWNBUFF 0 /* use user-allocated rec. buffer (1=yes) */

/* built-in recorder buffer (use when FMSTR_REC_OWNBUFF is 0) */
#define FMSTR_REC_BUFF_SIZE 1024 /* built-in buffer size */

/* recorder time base, specifies how often the recorder is called in the user app. */
#define FMSTR_REC_TIMEBASE FMSTR_REC_BASE_MILLISEC(0) /* 0 = "unknown" */

#define FMSTR_REC_FLOAT_TRIG 0 /* enable/disable floating point triggering */

/*****************************************************************************
* Target-side address translation (TSA)
******************************************************************************/

#define FMSTR_USE_TSA 0 /* enable TSA functionality */
#define FMSTR_USE_TSA_SAFETY 1 /* enable access to TSA variables only */
#define FMSTR_USE_TSA_INROM 1 /* TSA tables declared as const (put to ROM) */

/*****************************************************************************
* Enable/Disable read/write memory commands
******************************************************************************/

#define FMSTR_USE_READMEM 1 /* enable read memory commands */
#define FMSTR_USE_WRITEMEM 1 /* enable write memory commands */
#define FMSTR_USE_WRITEMEMMASK 1 /* enable write memory bits commands */

/*****************************************************************************
* Enable/Disable read/write variable commands (a bit faster than Read Mem)
******************************************************************************/

#define FMSTR_USE_READVAR 0 /* enable read variable fast commands */
#define FMSTR_USE_WRITEVAR 0 /* enable write variable fast commands */
#define FMSTR_USE_WRITEVARMASK 0 /* enable write variable bits fast commands */


#endif /* __FREEMASTER_CFG_H */

 

0 件の賞賛
返信

1,596件の閲覧回数
MichalH
NXP Apps Support
NXP Apps Support

Hello,

if code gets stuck in opening the "ttya:" device, then I would check if this device exists and can be open in a simpler hello-world application. 

It is really a long time ago we did the MQX port, but what I remember is that we were using "ittyX:" devices which are based on interrupt-driven concept. I think (not sure) that with a blocking mode configured using FMSTR_MQX_IO_BLOCKING, you must use an itty device.

Also, make sure you use a different serial port than used for MQX console (BSP_DEFAULT_IO_CHANNEL).

Regards,
Michal

0 件の賞賛
返信