As control algorithms become increasingly sophisticated, delivering improved performance at the expense of greater complexity, practical experiments are often unfeasible. To address this issue, this study devised a novel rapid control prototyping (NRCP) based on model-based design (MBD) by MAT LAB/Simulink, STM32CubeMX software, and field-oriented control (FOC) strategies for permanent-magnet synchronous motors (PMSMs). The NRCP avoids complex toolboxes and utilizes only MATLAB/Simulink’s model-to-C language tool, facilitating code portability and development. By using the NRCP, users can quickly experiment with FOC strategies, reducing their reliance on complex automatic code generation tools typically associated with toolboxes. This study focused on the PMSM model, employing only the basic modules of MATLAB/Simulink to generate the application-layer code and the STM32CubeMX software to do low-level code generations, significantly simplifying user experience. To demonstrate the feasibility and efficiency of the protocol, sensor-based and sensorless control models were developed using the MBD method. Finally, the practicality of the NRCP was successfully validated via sensor-based and sensorless experiments using an ARM Cortex-M4-based STM32 microcontroller.