cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-MAT TrueSTUDIO project generation problem

Elia Manstretta
Associate II
Posted on February 11, 2018 at 13:48

Hy guys,

I'm trying to configure and use simulink to generate code for nucleo-f303re and i've found a problem during project generation.

If i use cubeMX to generate project all works fine (truestudio build all correctly), but if i try to ''build model''  with matlab some directories are excluded from the building. Let me explain a little better:

1) first of all i create a new project with cubeMX.(new project -> select board -> setting up project name and toolchain -> save all)

2) start simulink and create a new project. i configure it as ST say in readme.pdf document provided in the installation directory of STM32-mat targhet.

3) click ''build model'' and wait for everything to end. cubemx say that ''the code as successfully generated''

4) i open open code with truestudio, i try to compile it and i get 17 erros. all error are consequence of missing hal driver.

0690X00000609dRQAQ.png

it seems that in the driver folder there isn't hal driver library, but if i navigate to driver folder manually all files are in their place .

0690X00000609fvQAA.png

if i use cubeMX without simulink (using the same .ioc files used with simulink) for code and project generation all works fine and truestudio include hal driver during building.

0690X00000609RQQAY.png

someone knows how to solve the problem?

Elia

#stm32-mat/target-matlab #simulink
5 REPLIES 5
Posted on February 13, 2018 at 03:39

Hello, Elia.

Could you please give me more information?

If you provide a little test case if possible or at least an ioc file.

Thanks.

Posted on February 13, 2018 at 15:16

Hello, first of all i'm using:

Matlab 2017b with STM32-mat v4.4.2 (leatest release)

truestudio for STM32 v9.0.0 (latest release)

cubeMX version 4.0 (latest release)

i try to build a simple ''hello world'' project, like flash a led.

0690X00000609Y7QAI.png

when i click ''Build model'' matlab make it's work and doesn't show any error.

When i open project with truestudio and i try to build it i receive that errors:

0690X00000609b6QAA.png

i've partially solved the problem under the advice gived by

in another thread of this forum:

https://community.st.com/0D50X00009XkWopSAF

after the ''.project'' modification all error related to hal libraries are solved, but i receive three other errors:

0690X00000609j9QAA.png

undefined reference to `test20180211_initialize' main.c /test20180211/Src line 142 C/C++ Problem

undefined reference to `test20180211_M' core_cm4.h /test20180211/Drivers/CMSIS/Include line 1839 C/C++ Problem

undefined reference to `test20180211_step' main.c /test20180211/Src line 159 C/C++ Problem

i have attached 3 files:

- .ioc file

- .project file before the correction proposed by

‌ (file named before.project)

- .project file afet the correction (file named after.project)

- a .zip file with the whole project, simulink file, ioc...

Thanks.

Elia

________________

Attachments :

after.project.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxxs&d=%2Fa%2F0X0000000b35%2FSpB5X6b.5QkDKb9m_CdV4gJJuzu7_YVPrVxl9KmQ5y0&asPdf=false

test20180211.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxoH&d=%2Fa%2F0X0000000b33%2FM63GZ4SkoZ1dSf76PyPEbu1WvZPYDhISIZNBp2nmol4&asPdf=false

test20180211.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hy0B&d=%2Fa%2F0X0000000b34%2Fb.DUD58LTxlmxGeGuDfqFTWtTi6S0Gt4Pe7ScVDCR3A&asPdf=false

before.project.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hy06&d=%2Fa%2F0X0000000b31%2F3G4sbLaKru754ZQ0uVQ1BmVCySypvHdZM_ZLVO0bB7Y&asPdf=false
Posted on February 14, 2018 at 05:21

Thank you for your information.

Could you try change Toolchain in ioc for temporary? I build success with EWARM from IAR.

Please let me know if you have any progress.

Best regards,

Posted on February 14, 2018 at 15:54

i tried to change toolchain from Truestudio to ewarm, but i haven't ewarm installed on my pc. so i tried to import the new project in truestudio, but the result is something like that:

0690X00000609k2QAA.png

Thank you

Elia

Posted on March 05, 2018 at 11:08

Hi, Elia

I have contacted ST. It's a project generation problem regarding STM32CubeMX.

And ST is working on that.

Best regards,