cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-MAT release 4.3 PIL or External mode setup

florence
Associate II
Posted on July 09, 2016 at 03:02

I am trying to run ADC example that came with STM32-MAT release 4.3, but not able to get it going. Has anyone got either PIL or external mode working and can tell me how to do it?

I have got the GPIO LED blinking test run successfully with STM32-MAT. Per ST support, the external mode is not available til this July release, because the PIL mode does not run the MCU periferals, so their ADC example must be run in external mode with UART serial communication. But there is no detail documentation shows details on how to setup the serial link and run the ADC example in external mode.

Per STM32_MAT-Garget_hand on document attached, page 34, in PIL mode, which also requires serial communication, there appears to be a matlab app that user can use to setup PC COM Port for the PIL, but there is no info on where the app is located. I am not sure where/how to bring up this matlab app GUI window so that I can configure the COM port. Can anyone who had run PIL tell me the steps to open this matlab app GUI?

 

Thanks

  
7 REPLIES 7
slimen
Senior
Posted on July 13, 2016 at 17:43

Hi,

I have found that 

http://www.mathworks.com/products/instrument/

:

provides the tools that let you communicate with, configure, and transfer data to or from your serial device without writing code. 

You can use functions to set PC Com port parameters following this link:

http://www.mathworks.com/help/matlab/serial-port-devices.html

Maybe you can find help in these links: 

http://www.mathworks.com/help/instrument/working-with-the-serial-port-interface.html?s_tid=srchtitle

http://www.mathworks.com/help/instrument/serial-port-overview.html

http://www.mathworks.com/help/matlab/matlab_external/introduction_f105659.html

Regards

Posted on July 18, 2016 at 15:15

Hi,

COM port configuration window automatically appears when you run PIL.

ADC examples are provided for code generation like GPIOs you already did.

ADC example generates project to build, download and run from STM32 target without any link to Simulink.

Best regards

Pascal

I am trying to run ADC example that came with STM32-MAT release 4.3, but not able to get it going. Has anyone got either PIL or external mode working and can tell me how to do it?

I have got the GPIO LED blinking test run successfully with STM32-MAT. Per ST support, the external mode is not available til this July release, because the PIL mode does not run the MCU periferals, so their ADC example must be run in external mode with UART serial communication. But there is no detail documentation shows details on how to setup the serial link and run the ADC example in external mode.

Per STM32_MAT-Garget_hand on document attached, page 34, in PIL mode, which also requires serial communication, there appears to be a matlab app that user can use to setup PC COM Port for the PIL, but there is no info on where the app is located. I am not sure where/how to bring up this matlab app GUI window so that I can configure the COM port. Can anyone who had run PIL tell me the steps to open this matlab app GUI?

 

Thanks

  
florence
Associate II
Posted on July 26, 2016 at 00:28

Thanks for the input!  I see the configuration window now after running PIL. I heard external mode is coming out in July of this year. Do you know if it is out yet?

The ADC example (F4VGTx_OneADC, for example), shows the data is send to PC using with the USART3 block. If this examples means just run the ADC without link to simulink, then what is this USART3 block to PC is for? And How do I retrieve the data from USART3 port and from PC? I thought the data is sending back to Simulink via USART3 block to the Simulink host PC via the serial to USB adapter. Thanks!

I am having the exact same problem as florence except with one extra issue. I am running the Test_PIL_IIR_Filter model and when i set the mode to Processor-in-the-Loop in the drop down menu and run the model I get an error "Invalid Index" in the Diagnostics Viewer. I am using the model provided and have only changed the configuration parameters as specified in the Readme.pdf. Because of this I am not able to see the COM port configuration window like florence.

Do you have any idea why I am seeing this error? I am running 2018b. Is there possibly a small set up step I am missing?

Please help!

I have the same problem with "Invalid index" error during building example models for stm32 target. I tested with Matlab 2018b, STM32MatTarget 4.4.2, Simulink 9.2 may 24 2018. Even simple model won't build. Other targets are ok. I hope this issue can be solved somehow.

I have found your answer. Turns out the ST block set is incompatible with Matlab 2018b. I switch to a privious version (2016b) and it started working again. Looks like they are aware of the issues and are making a new version of STM32-Mat/Target.

https://community.st.com/s/question/0D50X00009yE31oSAC/the-simulink-blockset-stm32mat-does-not-work-with-matlab-2018bis-there-a-plan-to-correct-this-version-442-is-rather-old

Cyril FENARD
ST Employee

Hi @florence​ ​ ,

The version 5.1.0 of STM32-MAT/TARGET has just been released at the end of July 2019.

Be aware that a lot of changes were involved in this release (in detail, alignment with STM32CubeMX version 5.1.0 and Matlab 2018b).

While working on this version the followings tests were successful for PIL:

 - F429ZITx @ 180 Mhz, USART1: OK

 - L476RG  @ 80 Mhz, USART2: OK

 While working on this version the followings tests were successful for External Mode:

  - STM32F401RE @ 84 Mhz, USART2: OK

  - STM32F446Z @180 Mhz, USART3: OK

It is strongly recommended to upgrade to the most recent version of STM32-MAT/TARGET.

Regards.

Cyril