Build and Load
Let’s take it for a test drive.
4.1 Import and Debug the Project to IDE
1. To import the installed application software project in the CodeWarrior for MCUs 11.x by launch IDE by going to File > Import.
2. Then, select General > Existing Projects in the workspace. To choose the root directory, click Next.
3. Navigate to
4. Then, choose your motor control driving control:
- MCSXSR1CS12ZVM_PMSM for PMSM with the field-oriented driving control
- MCSXSR1CS12ZVM_BLDC for BLDC with six-step commutation driving control
5. Click on Copy project into workspace and then click Finish.
Note: to clear the project, click Debug to build and flash the software. Once flashed, Run the session and click
Disconnect to release the USB resources.
Optional: Build Your Project
Note: These steps shouldn't be necessary since they are executed in the next step automatically.
Right click on the imported project and select Clean from the context menu.
4.2 Debug for Loading Code into the MCU
To load built code into MCU, go to Run > Debug Configuration > select predefined debug configuration and click
4.3 Communicate with the Run-Time Debugger
1. Launch the FreeMASTER application.
2. Open a project
❮selected project❯ FreeMASTER_control\ MCSXSR1CS12ZVM_PMSM_SW_CW11.pmp by clicking
File > Open Project.
3. To enable communication, in the FreeMASTER tool bar, click Go (or press CNTRL+G).
Successful communication is signalized in the status bar at the very bottom as:
RS232 UART Communication;COMn; speed = 19200
4. Let code run by clicking on the Resume (F8) button, and use Disconnect button for avoiding interference between CW debugger and FreeMASTER tool.
4.4 Launch the Control Application
Launch the Motor Control Application Tuning (MCAT) tool, then display the application control page on the tool menu. When the power supply is connected to the board, the application is
in READY state indicated by a blue LED on the board. The LED also indicates:
- READY, INIT states - slowly flashing LED
- CALIB, ALIGN states - flashing LED
- RUN state - lighting LED
- FAULT state - fast-flashing LED
Note: In case of pending faults, click the fault button Clear FAULT on the FreeMASTER MCAT Control Page.
4.5 Debug Your Project Using the Run-Time Debugging Tool
*.pmp file from your application project folder.
Note: You may start it by double click directly from CodeWarrior project explorer.
4.6 Establish a Connection with the MCU
1. Start the application by clicking ON/OFF button on the FreeMASTER MCAT control page.
2. Set required speed by changing the Speed Required variable value manually in the variable watch window, or by clicking the speed gauge in the MCAT control tab.
Note: the connection parameters are already predefined,You can change them in project options or by using the
4.7 Tune the Motor
Now you are ready to tune your motor control application.
1. Successfully tune the control loops.
2. In FreeMASTER, go to the Control tab and set the required motor rpms and turn on the motor drive.
3. Stop the application by clicking ON/OFF button on the FreeMASTER MCAT control page.
Your motor should now be running.