COMx). You will hand this value to the AI agent, which uses it for the FreeMASTER Lite serial connection
Note: This tutorial uses these paths:
You can use any location. If you do, update the paths in the prompt to match.
COMx, replace it with your own port number. The AI will search the Application Code Hub and select the most suitable motor control demo automatically.
You are a software developer that needs to use S32K312 FRDM board to control a motor. I have the NXP PMSM Low Voltage Motor Control Accessory Kit available for my application. Check NXP Application Code Hub for an application that can be used and import the selected application into S32 Design Studio IDE. S32DS is installed at C:\NXP\2026\K3_kit\S32DS_3.6.8. Run S32 Configuration Tools to generate code, build it, load into the flash memory and run the project. Use the s32ds-agentic-ai MCP server; if the MCP server disconnects at any point, stop immediately and notify user.
Using FreeMaster Lite create a self contained web dashboard and the server configuration file in the project folder called dashboard. FreeMaster Lite is installed at c:\NXP\2026\K3_kit\FM_32\FreeMASTER Lite\fmlite.exe The dashboard should define and connect all the variables for the 4 panels and contained components: - top panel: contains the controls for the board serial connection, default: connection name "S32K312 Board", COM#, 115200 baud, 8 data bits, no parity, 1 stop bit - left panel: contains the motor control panel: motor state (on/off), actual RPM and desired RPM, slider for selecting the RPMs in both directions, a 0 RPM button, and +- 10/100 RPMs buttons - middle panel: contains a graphical representation of the motor, spinning the NXP logo in sync with the motor actual speed - right panel: contains all the board\motor parameters that you can find relevant Start FreeMaster server and run the dashboard at the end Once the JS client confirms that the board is connected it should start reading desired and actual RPMs Use the s32ds-agentic-ai MCP server; if the MCP server disconnects at any point, stop immediately and notify user.
| Symptom | Fix |
|---|---|
| No motor control demo found on ACH | Try broader search terms such as "motor", "PWM", or "BLDC". Confirm the s32ds-agentic-ai server is connected. |
| Import fails or project missing from Project Explorer | Try File › Import › Existing Projects into Workspace manually. Confirm S32DS path is C:\NXP\2026\K3_kit\S32DS_3.6.8. |
| S32 Configuration Tools does not open | Double-click the .mex file. Ensure the S32K3 SDK is installed and the project SDK is correctly configured. |
| Generate Code produces errors | Check Pins, Clocks, and Peripherals tabs for red validation markers. Resolve conflicts before regenerating. |
| Build errors after Generate Code | Ensure the generated src/ folder is in the build path. Try Project › Clean then rebuild. |
| Motor does not respond after flashing | Check hardware connections between board and motor driver. Verify correct PWM output pins per the demo schematic. |
| FreeMASTER dashboard does not connect | Confirm the FreeMASTER server is running and COM# / 115200 baud / port 51234 match the configuration file. Check that the board is powered and running. |
| Dashboard does not auto-read RPMs after connect | Check the JS connect callback in the dashboard HTML. Ensure the ReadVariable calls for desired and actual RPM are triggered after the WebSocket StartComm response confirms success. |
| Actual/desired RPM shows 0 or stale | Verify the variable names match those in the FreeMASTER project. Check that FMSTR_Poll() is called in the main loop and TSA is enabled. |
| Right panel parameters not updating | Verify FreeMASTER TSA is enabled (FMSTR_USE_TSA 1) and FMSTR_Poll() is called in the main loop. |
| s32ds-agentic-ai MCP server disconnects | Stop immediately and restart the MCP server following the Installation & Usage Guide. |
| File | Step | Description |
|---|---|---|
| src/main.c | 1 | Main firmware – motor control loop with FreeMASTER TSA |
| *.mex | 1 | S32 Configuration Tools project file (Pins, Clocks, Peripherals) |
| generate/src/ | 1 | Auto-generated peripheral initialisation source files |
| generate/include/ | 1 | Auto-generated peripheral configuration headers |
| dashboard/board_115200.fmcfg | 2 | FreeMASTER server configuration: COM#, 115200 baud, 8 data bits, no parity, 1 stop bit, "S32K312 Board" |
| dashboard/motor_dashboard.html | 2 | Self-contained HTML5 dashboard with all FreeMASTER variables, 4 panels (top: serial connection; left: motor control with slider, 0 RPM button, ±10/100 RPM buttons; middle: NXP logo spinning in sync with actual speed; right: board/motor parameters), auto-read on connect |