cancel
Showing results for 
Search instead for 
Did you mean: 

Simulink freeze to open stm32cubeMx, possible cause... Java?

toniospritz
Associate III

Hello,

i'm Antonio and few week ago i've start to learn simulink and PIL simulation.

I tring to test the IIR-Filter project from STM32_MAT-TARGET on my stm32f429i-DISK1 board with sw4stm32 toolchain but i've some problems ( used many time all the steps of STM32_MAT-TARGET_HandsOn_v1_0.pdf) but for me the biggest issue is the freezing when simulink try to open stm32cubemx (probably at clockwizard start).

0693W000000Us1NQAS.png

Java not work and only after i kill the process stmCube work, but without the settings...

i've uninstall java with the relative tool , clean registry, reinstalled, killed processes that can use java, but nothing have work...

Someone can help me?

Someone have had the same problem

My system is:

Win10 home

java Version 8 Update 241 /64bit

Matlab R2019b

Stm32cubemx v. 5.6.0

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
toniospritz
Associate III

For all the people that use SW4STM32 toolchain, maybe i've found a solution for the error: The timeout of 5 seconds for receiving data from the rtiostream interface has been exceeded.

System Workbench STM32 open auomatically a connection on the serial port with the board. Do you must disconnect the link with the build-in console, and only after burn the application on the board. 

For the java freezing issue the only solution is kill java and set manually the clock and the other parameters.

View solution in original post

5 REPLIES 5
Cyril FENARD
ST Employee

Hi @toniospritz​ ,

You can perform premilinary checks:

- does starting STM32CubeMx work alone? Create a dummy project for the device you are targeting and verify that the code generation is correct.

- start a basic test with Simulink, from the parent folder C:\MATLAB\STM32-MAT\STM32\STM32demos\Test.

Then you use MATLAB R2019B which behaves differently from R2018B, the version which should be used with STM32-MAT/TARGET v5.6.0.

Regards.

Cyril

toniospritz
Associate III

hello @Cyril FENARD​ ,

thank you for the help! I've update from v5.4.0 to 5.6.0 and now cubemx start and generate code.

I build the project (IIR_filter) with sw4stm32 and load on the board.

Now new error :( rtiostream give timeout error...

what wrong procedure i've make now?:sad_but_relieved_face:

This is the DIagnostic Viewer on simulink...

=== Simulation (Elapsed: 0.498 sec) ===
    ### Checking the status of model reference code generation target for model 'IIR_Filter_int32'
    ### Model reference code generation target for IIR_Filter_int32 is up to date.
    ### Connectivity configuration for referenced model "IIR_Filter_int32": STM32 PIL ###
    ### rtIOStream Port        : COM3
    ### rtIOStream Speed       : 115200
    ### rtIOStream Data length : 8
    ### rtIOStream Parity      : none
    ### rtIOStream Stop bit    : 1
    ### rtIOStream Flow control: none
    ### rtIOStream Time out    : 10
    ### Preparing C:\MATLAB\STM32-MAT\STM32\STM32demos\PIL\STM32SerialRtiostream_Config.h with USART1
    ### COM port: COM3
    ### Baud rate: 115200
    ### stm32Pil.Timer: ticks per second: 1.800000e+08
    ### stm32Pil.Timer: added with: C:\MATLAB\STM32-~1\STM32\pil\stm32SerialRtiostream\STM32SerialRtiostream-ProfilerTimer.c
    ### stm32Pil.Timer: added with: C:\MATLAB\STM32-~1\STM32\pil\stm32SerialRtiostream\STM32SerialRtiostream-ProfilerTimer.h
    ### Preparing to start PIL simulation ...
    ### Updating code generation report with PIL files ...
    Warning:Parameter precision loss occurred for 'Value' of 'IIR_Filter_int32/a=0.9'. The parameter's value cannot be represented exactly using the run-time data type. A small quantization error has occurred. To disable this warning or error, in the Configuration Parameters > Diagnostics > Data Validity pane, set the 'Detect precision loss' option in the Parameters group to 'none'.
    ### Starting application: 'slprj\stm32\IIR_Filter_int32\pil\IIR_Filter_int32.out'
    ### The toolchain for the target: 'SW4STM32'
    ### Copy generated files to STM32CubeMX working repository (C:\MATLAB\STM32-MAT\STM32\STM32demos\PIL\IIR_Filter_int32_PIL\).
    Warning:Warning: Directory already exists.
    Warning:Warning: Directory already exists.
    Warning:Warning: Directory already exists.
    Warning:Warning: Directory already exists.
    ### Creation of STM32CubeMX ioc configuration file for PIL communication.
    
    ### Open STM32CubeMX for configuration and project code generation.
    ### Stopping PIL simulation
    Error:The timeout of 5 seconds for receiving data from the rtiostream interface has been exceeded. There might be multiple reasons for this failure.
    You should:
    
     (a) Check that the target hardware configuration is correct, for example, check that the byte ordering is correct.
     (b) Confirm that the target is running.
     (c) Consider the possibility of application run-time failures (e.g. divide by zero exceptions, incorrect custom code integration, etc.).
     
     Note (c): To identify possible reasons for the run-time failure, consider using SIL, which supports signal handlers and debugging.
    
    If you cannot find a solution, consider using the method setTimeoutRecvSecs of rtw.connectivity.RtIOStreamHostCommunicator to increase the timeout value.
    Warning:Parameter precision loss occurred for 'Value' of 'IIR_Filter_int32/b=0.1'. The parameter's value cannot be represented exactly using the run-time data type. A small quantization error has occurred. To disable this warning or error, in the Configuration Parameters > Diagnostics > Data Validity pane, set the 'Detect precision loss' option in the Parameters group to 'none'.
    Warning:Parameter precision loss occurred for 'Gain' of 'Test_PIL_IIR_Filter/x0.001'. The parameter's value cannot be represented exactly using the run-time data type. A small quantization error has occurred. To disable this warning or error, in the Configuration Parameters > Diagnostics > Data Validity pane, set the 'Detect precision loss' option in the Parameters group to 'none'.
    Warning:Parameter precision loss occurred for 'Gain' of 'Test_PIL_IIR_Filter/x0.1'. The parameter's value cannot be represented exactly using the run-time data type. A small quantization error has occurred. To disable this warning or error, in the Configuration Parameters > Diagnostics > Data Validity pane, set the 'Detect precision loss' option in the Parameters group to 'none'.

Cyril FENARD
ST Employee

Hi @toniospritz​ ,

It appears that you are experiencing a communication problem with the device during the host-side simulation for PIL.

Have you defined enough heap and stack for your device?

Is your device working? (Stop the debugger and check that the execution is polling the RX path of the UART, if yes, resume execution and start PIL from host side)

Have you checked the configuration UART link on your device (USART instance and corresponding hw pins for this)?

Regards.

Cyril

Hi @Cyril FENARD​ ,

i don't know how is possible, but the issue with java and cubemx is come back! :loudly_crying_face: stm32cubemx stop run on the clock wizard.

For the second question he heap size is set ad default valure at 0x200. How i can check the polling on the rx path?

the uart configuration i think is ok, i've set the usart1 (pin PA10 for the RX and Pa09 for the Tx) i've try to load the usart ioc from C:\MATLAB\STM32-MAT\STM32\STM32demos\Test\USART\F429I-Discovery\USART_1_Receive and have the same iostream error message...

toniospritz
Associate III

For all the people that use SW4STM32 toolchain, maybe i've found a solution for the error: The timeout of 5 seconds for receiving data from the rtiostream interface has been exceeded.

System Workbench STM32 open auomatically a connection on the serial port with the board. Do you must disconnect the link with the build-in console, and only after burn the application on the board. 

For the java freezing issue the only solution is kill java and set manually the clock and the other parameters.