looking for some help on configuring the micro within the Simulink model. The setup we are using needs to use the internal system clock but the allowable configuration within Simulink only allows an external 8 or 40 oscillator. Is there a way to modify this block or is there a new block available?
I did make the following updates to the attached C file to try and force using the internal clock, but that didn't seem to work either.
Need some help on the correct way to do this.
Why wouldn't this configuration be available within the S32K1xx config block?
Hello @mcmackin
For customizing the s32k_clock_init.c to address the particularities of your setup could you please check the following post? The s32k_clock_init.c file that you should modify should be the one from the toolbox sources (toolbox_root\mbdtbx_s32k14x\src\c_library) since the one placed inside the folder where you build the model would be overwritten with the default configuration at every model build, and the updates would have no impact for your application.
Moreover, by taking a look at the file you have attached, I see that the lpit0_clock_init function is missing from your configuration (compared to the file provided by the toolbox) and I think this might be the cause for your application not working under these settings. As you can see inside the Step Tick group of the Configuration block, LPIT Channel 0 is used as the Step Tick Timer for the model, enabling a periodic execution of the application on the board. Hence, the clock initialization for the LPIT instance should not be removed.
Considering all these, inside the s32k_clock_init.c, could you please try modifying only the clockMan1_InitConfig0 structure with the values required by your setup and leave the rest of the file content unaltered? After making the necessary updates you could re-build the model.
Please let us know if this solves the problem you are currently encountering.
Thank you,
Irina