Why do I receive a "Failed to connect to the target" error message when running the "stm32f4di​scovery_as​ynchronous​_schedulin​g" example using PIL?

2 visualizaciones (últimos 30 días)
I am using Embedded Coder in Simulink R2023a to run the "stm32f4discovery_asynchronous_scheduling" STMF32F4 tutorial using processor-in-the-loop (PIL):
However, I receive the following error messages when trying to connect to the STMF32F4 hardware during 'Monitor & Tune':
Error occurred while executing External Mode MEX-file 'ext_serial_win32_comm':
Failed to connect to the target. A time-out occurred while waiting for the connection response from the target. Possible reasons for the time-out:
a) The target is not switched on.
b) The target is not connected to your host machine.
c) The application for the model is not running on the target. You might have clicked the Stop button. If the Run button is not dimmed, click it. Otherwise, click the Build button, which downloads and runs your application on the target.
Component:Simulink | Category:Block diagram error
Unable to connect to the 'STM32F4-Discovery' target for 'stm32f4discovery_asynchronous_scheduling'.
Component:Simulink | Category:Block diagram error
The full build process script is provided as "stm32f4discovery_asynchronous_scheduling_Monitor_and_tune_log.txt". I am using the Prolific serial-to-USB converter which is assigned to the serial port COM8. In addition, I have configured the hardware settings for PIL and external as 'serial' and 'COM8' respectively.
Why is this error message appearing? Is there a workaround to prevent this error message from appearing?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 16 de Oct. de 2023
PIL is primarily used for algorithm testing and not for modeling real-time behavior. Therefore, Asynchronous Scheduling is not possible using PIL in the Embedded Coder. To resolve this issue, you can use the "Hardware Interrupt" block and the "External Interrupt" (EXTI) line using monitor and tune.
For further information on this workflow, please refer to the "Task 2 - Configure ADC Trigger from External Source" section of the following R2023a tutorial page:
In this particular section mentioned above, a general-purpose input/output (GPIO) port is used to generate an event on the EXTI line.

Más respuestas (0)

Productos


Versión

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by