2018-02-11 04:48 AM
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.
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 .
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.
someone knows how to solve the problem?
Elia
#stm32-mat/target-matlab #simulink2018-02-12 06:39 PM
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.
2018-02-13 07:16 AM
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.
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:
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:
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++ Problemi 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=falsetest20180211.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxoH&d=%2Fa%2F0X0000000b33%2FM63GZ4SkoZ1dSf76PyPEbu1WvZPYDhISIZNBp2nmol4&asPdf=falsetest20180211.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hy0B&d=%2Fa%2F0X0000000b34%2Fb.DUD58LTxlmxGeGuDfqFTWtTi6S0Gt4Pe7ScVDCR3A&asPdf=falsebefore.project.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hy06&d=%2Fa%2F0X0000000b31%2F3G4sbLaKru754ZQ0uVQ1BmVCySypvHdZM_ZLVO0bB7Y&asPdf=false2018-02-13 09:21 PM
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,
2018-02-14 07:54 AM
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:
Thank you
Elia
2018-03-05 03:08 AM
Hi, Elia
I have contacted ST. It's a project generation problem regarding STM32CubeMX.
And ST is working on that.
Best regards,