- Locate the file: After generating code from Simulink, find the ‘s32k_clock_init.c’ file in your project directory. This file is typically copied from: {Toolbox installation path}\mbdtbx_s32k11x\src\c_library\s32k_clock_init.c
- Open the file: Open ‘_clock_init.c’ in a text editor or an IDE.
- Modify the clock source: Locate the section in the file where the clock source is set. Change the configuration from the external clock to the internal fast clock by updating the relevant registers or settings. The specific changes will depend on your application, but typically involve setting the appropriate bits for the internal clock source in the initialization structure.
- Save and build: Save the modified file and proceed with building and flashing your project as usual.
why i cannot select internal clock in matlab for s32k116?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
In the nxp tool box the clock selection for the internal clock is not available.Since we could not perform certain task the antipinch detection algorithm using LPIT timer
0 comentarios
Respuestas (2)
Shaunak
el 13 de Mayo de 2025
Editada: Shaunak
el 14 de Mayo de 2025
Hi Vikash,
It sounds like your issue is related to the clock source configuration in the NXP ‘Model-Based Design Toolbox’ (MBDT) for the ‘S32K116’ MCU, specifically the inability to select the internal clock directly from the Simulink configuration parameters. By default, the generated code for the ‘S32K116’ uses the external clock, as this is the typical setting for the evaluation board (EVB).
If you need to use the internal fast clock, you will need to manually modify the ‘s32k_clock_init.c’ file after code generation. Here are the steps you can follow:
For more information, please refer to the following community thread from NXP:
2 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!