gmclib.h and typdefs not included by code generation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

gmclib.h and typdefs not included by code generation

Jump to solution
770 Views
craanede
Contributor III

Hi,

I think I found a bug regarding the MBDT for S32k14x series.

I was working on BLDC control and added the BEMF observer block from the AMMC library.

However, I was using my own clarke transform block which was not from the MBDT.

In this combination, the compiler complains that gmclib.h and the bus definition needed for the input of the BEMF observer block are not found. Apparently the BEMF observer block includes gmclib.h but during code gen does not also have it copied to the code generation folder. This can be easily verified by opening one of the example models for the BEMF observer block and commenting out the clarke transform blocks.

As a workaround I included the clarke transform block from the MBDT in a disabled subsystem and then everything works.

I am running the model in simulink 2021b on windows 10 and use the MinGW64 compiler.

0 Kudos
Reply
1 Solution
746 Views
stefancinipeanu
NXP Employee
NXP Employee

Hello, @craanede 

I have managed to replicate the issue that you have found and indeed using the Bemf observer block without any block from GMCLIB library is causing the build process to fail because of missing the gmclib.h header.

The Bemf observer block calls the AMCLIB_BemfObsrvDQ function which in its implementation is using different functions also from another libraries (gmclib.h & gflib.h). Usually, the Bemf observer is used together with Clark and Park transformations from our GMCLIB library, so it was assumed that gmclib.h header will be always copied in the code gen folder.

We are going to log this issue and resolve it asap. For now, your workaround is a good idea.

Thank you!

Best regards,

Stefan.

View solution in original post

1 Reply
747 Views
stefancinipeanu
NXP Employee
NXP Employee

Hello, @craanede 

I have managed to replicate the issue that you have found and indeed using the Bemf observer block without any block from GMCLIB library is causing the build process to fail because of missing the gmclib.h header.

The Bemf observer block calls the AMCLIB_BemfObsrvDQ function which in its implementation is using different functions also from another libraries (gmclib.h & gflib.h). Usually, the Bemf observer is used together with Clark and Park transformations from our GMCLIB library, so it was assumed that gmclib.h header will be always copied in the code gen folder.

We are going to log this issue and resolve it asap. For now, your workaround is a good idea.

Thank you!

Best regards,

Stefan.