cancel
Showing results for 
Search instead for 
Did you mean: 

MAT-TARGET STM32, experiences, comercionalised products?

Martin Dvoracek
Associate II
Posted on February 26, 2018 at 08:58

Hi everybody,

is there somebody with good experiences with STM32 MAT-TARGET? I tried to test it during last two week, I was very curious and pleased I can test simulink and STM32 mat-target. But now my feelings are neutral. Is there somebody who use it for development of sw and deploying to comercional systems?

In this year our company has prepared development of several new controll board and also a lot of new SW will have to be writen (also to older HW). I had good skills and experience with matlab and source code generation for xpc target or B&R PLCs.

   But now (for the STM32) I had a lot of troubles (small troubles) with many particular tasks needed for STM32 processors. I had troubles with first source code generating fot the STM32... ok it is first project. I spent several days to run external mode. External mode is working, but in very limited range. I can use only three scopes and only three displays. In case, more dispalys or scopes is used the hard fault become. In case I have small sampling period about 1ms, external mode is working only without displays and scopes. Also I had throubles with understanding, managing of processor's pheripherals. Also I found bug in generated code, for ADC in injected mode. Where I can share detail information about the bug? Does exist more detail documents and manuals for the STM32?

Is there somebody with good experiences with MAT-TARGET for stm32? And for comercional products? Do you believe the product?

Does exist continuous development of MAT-TARGET? What is an route map for the MAT-TARGET? 

Regard

Martin

#simulink #stm32-mat/target-matlab
12 REPLIES 12
S.Ma
Principal
Posted on March 05, 2018 at 11:14

Not being Matlab user, my 2 cents comment would be that algo intensive developments should trend to MAT-TARGET with a higher-end STM32 part first for validation. Once the proof of concept done, most likely C code optimisation would follow to get to production.

Posted on March 05, 2018 at 12:32

Also not a Matlab user, but I notice that  there does seem to be a regular stream of people here struggling to use it for embedded development.

So my question would be: what do you see as the (potential) benefit of doing this in Matllab - as opposed to the 'established' embedded firmware development toolsets ?

AIUI, 

Matlab is a high-dollar commercial tool - so, presumably, they have training, support, consultants,etc ... ?

AvaTar
Lead
Posted on March 05, 2018 at 13:01

AFAIK, the commercial Matlab/Simulink is a spin-off of a universitary project, heavily sponsored by the automotive industry, and targeted at the needs of the automotive industry.

Peculiarities like the default usage of double-precision floating point variables in M/S in many cases should tell you what controllers this package is targeted at.

One of my former companies used M/S to model a MCU based device. The device itself used a 8-bit MCU, which had not even M/S support from the vendor. The model code beared no resemblance to the actual, hand-written target code.

Experts/FAE's of this vendor (not ST) discouraged commercial M/S usage even for their 16-bit MCUs, because of severe ressource issues.

My current company is about to implement a M/S-generated algorithm/code into a commercial product, on a Cortex-M equivalent MCU (proprietary, don't ask).

It requires moderate modification, to meet ressources constraints (data types, etc).

M/S code generation output and target toolchain integration depends heavily on the MCU vendor of the target - ST in this case.

I never worked with ST targets in M/L.

Jonas
Associate II

​Hi Martin, hi all

You are asking very relevant and important questions. I want to contribute to this discussion as well. Don't really think this forum is actually monitored by anyone, but want to give it a go anyway.

I am also trying out this toolchain, to use code generated from a Simulink model on an STM32F7 platform. So far I feel like the spirit and idea behind the toolchain is really good. It should be able to deploy directly on the platform, but also PIL and External Mode are supported (allegedly). With other silicon vendors I have seen that there is always a manual step where you need to integrate the C-code generated by Matlab into the structure of the silicon vendor. So I am really interested in the STM32MAT/TARGET tool.

I really like the interface between STM32CubeMX and the STM32 package in Simulink. Based on the .ioc configuration you load, only the set interfaces are available when building your IOs. This makes it pretty straight forward.

The real pain however started when building the Simulink model (without errors) and then trying to get the generated project working in Atollic Truestudio. It may be a lack of experience with Truestudio from my part, or lack of knowledge of my specific STM32F7 chip, but I have encountered numerous issues.

Now, issues are there to be solved, but who can support this toolchain? Is it MathWorks? ST? Atollic? I am seriously doubting if this toolchain is really wide-spread in the industry. How does automotive work with this? Do they manually integrate their generated C-code? Or use a complete toolchain like this one? These are pretty important questions since I am investigating if my employer should make the jump as well. We need solid support for many years to come if we would want to use this toolchain.

While going through all the STM32MAT/TARGET examples and documentation, I have found that they are all made by one specific ST employer. Seems like this tool is supported by one guy only?

Kind regards,

Jonas

A lot of things only take one competent guy. Things of high technical complexity don't scale well to large groups.

Atollic was bought for a reason, perhaps several, but one is being competitive to Keil or IAR when you have a product built on other peoples work (GNU/GCC, Eclipse, OpenOCD, etc). May be now ST owns them they can focus on just STM32 products and making things robust and bullet-proof. That's of course if key talent hasn't been freed to pursue other work opportunities.

The other take away is that if one guy at ST can do this why couldn't other companies, with their own roster of talent, be able to manage the end-to-end of using Matlab, Generating C and Integrating it into their target platform, with the added benefit of not tying themselves to any one vendors parts and library strategy du jour. And perhaps better manage automotive and aerospace code compliance requirements.

>>We need solid support for many years to come if we would want to use this toolchain.

Success here is to be self-supporting and self-sustaining. Other companies have their own strategic goals, and are going to act in their own self interest and independent of expectations others have created in their minds. ST is used to dealing with large companies who have their own deep rosters of technical talent, they are not in the individual hand holding business.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Jonas
Associate II

​I do expect Truestudio to mature towards specific STM32 products. From my experiences so far the integration is already quite good, but it definitely needs improvements. I think acquiring Atollic was a good move to get a hold of a bigger part of the toolchain.

I agree with you that taking the toolchain in own hands has significant benefits, the most important one being able to be vendor independent. But it is not a small operation. Automotive and aerospace companies have huge batteries of manpower which enables them to set up such a toolchain - they also have to do it to remain competitive. And they are doing it like this for like 15 years already. For smaller companies - or large companies which do not have the software as a core competence - it is much more difficult to set up a robust toolchain. It contains a lot of risks.

I am thus wondering what the targeted group is for the STM32MAT/TARGET toolchain. It is too specific for large companies such as automotive, and too unsupported for smaller companies. I will anyway continue assessing the toolchain and draw conclusions at some point.

Saunak_Bhalsod
Associate II

I have one doubt on the STM32 MAT TARGET Product. Is it cover all STM32 microcontrollers?

For Example, I have STM32F3348DISCOVERY board. Will it be supported on this device?

Again, my question above of  July 21, 2018:

what do you see as the (potential) benefit of doing this in Matllab - as opposed to the 'established' embedded firmware development toolsets ?

And also my observation:

AIUI, Matlab is a high-dollar commercial tool - so, presumably, they have training, support, consultants,etc ... ?

Yes, it should work with all STM32. In the workflow approach you need to take, you generate a STM32CubeMX configuration file (.ioc-file) - which you can do for all STM32 chips - and then you reference to this file in your Simulink model. The only concern I would have is how much you demand from the processor, if it is fast enough for your generated code.