While learning to use a S32K344 evalboard with Simulink MBDT I've stumbled upon a problem concerning projects with a clock output ("s32k344_clockout_s32ct","s32k3xx_i2c_async_23st", "s32k344_spi_async_interr_master_ebt", and other..). The main problem is that there is no clock output on any pin, and with lack of the clock output there was also no data signal on MOSI and CP pins of the SPI and SDA of the I2C). Hardware-wise the evalboard works well since the clock seems to work when example codes of SPI, I2C and clock out of the NXP_S32 SDK are uploaded to the board.
Are there any additional settings and conifgurations possibly missed in order for the example projects of the MBDT to work on the S32K344EVB-T172?
Solved! Go to Solution.
Hi, @ErwinR,
Thank you for your interest into Model-Based Design Toolbox for S32K3.
First of all, let's clarify a few aspects about the models you mentioned.
The s32k344_clockout_s32ct model example's primary purpose is to verify that the MCU's internal clock (160 MHz Core Clock) is correctly set up, prescaled down to a measurable frequency (10 MHz), and routed externally to pin PTD14 for verification using an oscilloscope. Simultaneously, a simple LED indication confirms successful program deployment and execution.
On the other hand, clock routing for other peripherals, such as those you mentioned (SPI, I2C) is done depending on the particularities of each component (detailed information can be found in the S32K3xx Reference Manual - Clocking chapter). Below you will find all the clocks configured in the default project for your board:
For example, the clock corresponding to the SPI component is routed to AIPS_SLOW_CLK, as that is how it is defined for this hardware board.
I hope this brief overview helps guide you in understanding how it works and where you can find more information.
Back to your case, I would like you to be more specific about the problem you are encountering, what exactly is not working and maybe you can help us with an archive of the model you are trying to use, so we can help you more easily in solving and understanding the problem.
From what I understand, you are unable to run the s32k344_clockout_s32ct model correctly. Keep in mind that this model has a custom configuration for the S32K3X4EVB-Q257 hardware board, which means that a custom .mex file is associated with this model. If you modified the hardware settings of the S32K344-Q172 part to use your board, this resulted in overwriting the .mex file with the custom configuration, and bringing in the default configuration for the S32K344-Q172. Thus, the custom settings were lost and the functionality of the model is no longer the same. Thus, custom settings were lost, including the specific CLKOUT pin, and the functionality of the model is no longer the same.
A small overview of custom and default configuration projects:
In the toolbox you will find models that come with custom configuration projects, indicated by the inclusion of the Tresos folder (e.g. s32k344_spi_async_interr_master_ebt_TresosProject) or by the inclusion of the mex file (e.g. s32k344_clockout_s32ctConfig.mex). These models have specific functionalities strictly for the board mentioned in the help file, as they have some hardware peculiarities.
On the other hand, the other projects that do not have an associated configuration project (e.g. s32k3xx_i2c_async_s32ct), both when opening the model and when changing the hardware part setting, a default configuration project will be created based on the hardware part selection. That is why you will find some models called s32k3xx, because they address several boards, having similarities in terms of hardware.
However, if you change the hardware part of a custom configuration model, the associated custom configuration project will be overwritten with the default one, based on the new hardware part selection. Thus, the functionality changes and no longer returns the same results.
I hope this helps you solve the problem. If you have any further questions, don't hesitate to contact us.
Best regards,
Dragos
Hi, @ErwinR,
Thank you for your interest into Model-Based Design Toolbox for S32K3.
First of all, let's clarify a few aspects about the models you mentioned.
The s32k344_clockout_s32ct model example's primary purpose is to verify that the MCU's internal clock (160 MHz Core Clock) is correctly set up, prescaled down to a measurable frequency (10 MHz), and routed externally to pin PTD14 for verification using an oscilloscope. Simultaneously, a simple LED indication confirms successful program deployment and execution.
On the other hand, clock routing for other peripherals, such as those you mentioned (SPI, I2C) is done depending on the particularities of each component (detailed information can be found in the S32K3xx Reference Manual - Clocking chapter). Below you will find all the clocks configured in the default project for your board:
For example, the clock corresponding to the SPI component is routed to AIPS_SLOW_CLK, as that is how it is defined for this hardware board.
I hope this brief overview helps guide you in understanding how it works and where you can find more information.
Back to your case, I would like you to be more specific about the problem you are encountering, what exactly is not working and maybe you can help us with an archive of the model you are trying to use, so we can help you more easily in solving and understanding the problem.
From what I understand, you are unable to run the s32k344_clockout_s32ct model correctly. Keep in mind that this model has a custom configuration for the S32K3X4EVB-Q257 hardware board, which means that a custom .mex file is associated with this model. If you modified the hardware settings of the S32K344-Q172 part to use your board, this resulted in overwriting the .mex file with the custom configuration, and bringing in the default configuration for the S32K344-Q172. Thus, the custom settings were lost and the functionality of the model is no longer the same. Thus, custom settings were lost, including the specific CLKOUT pin, and the functionality of the model is no longer the same.
A small overview of custom and default configuration projects:
In the toolbox you will find models that come with custom configuration projects, indicated by the inclusion of the Tresos folder (e.g. s32k344_spi_async_interr_master_ebt_TresosProject) or by the inclusion of the mex file (e.g. s32k344_clockout_s32ctConfig.mex). These models have specific functionalities strictly for the board mentioned in the help file, as they have some hardware peculiarities.
On the other hand, the other projects that do not have an associated configuration project (e.g. s32k3xx_i2c_async_s32ct), both when opening the model and when changing the hardware part setting, a default configuration project will be created based on the hardware part selection. That is why you will find some models called s32k3xx, because they address several boards, having similarities in terms of hardware.
However, if you change the hardware part of a custom configuration model, the associated custom configuration project will be overwritten with the default one, based on the new hardware part selection. Thus, the functionality changes and no longer returns the same results.
I hope this helps you solve the problem. If you have any further questions, don't hesitate to contact us.
Best regards,
Dragos
Hi @dragostoma ,
By my mistake I instantly changed the hardware settings to the S32K344-172 which then removed trhe actual settings for the examle. After redownloading the project it happens to work on the evalboard. Although, I wanted to change the settings to the S32K344-172 by using the "package switch" option in the Configuration Tool. All the settings managed to transfer well except for the port settings, where some port pin MSCR values were highlighted with an error.
I happen to be unable to assign any other value to those ports without it giving me another error of the values being repeated..
Hi, @ErwinR,
I'm glad to hear that you managed to build the model and it works correctly.
The problem you are encountering now is because the MSCR you are trying to set is not available in the S32K344-Q172 variant. As suggested in the error, the range should be 0-160.
The S32K344-Q257 and S32K344-Q172 refer to the same S32K344 microcontroller, but in different package variants:
- S32K344-Q257 -> 257 pins (BGA package)
- S32K344-Q172 -> 172 pins (LQFP package)
The number after "Q" represents the total pin count. The difference in pin count affects the number of available I/O ports, peripherals and other external connections.
I recommend that you consult the schematic file for the board you want to use and set the pins accordingly.
Best regards,
Dragos
Hi @dragostoma ,
Thank You for the help and the clarification. I've marked your first reply as the solution to the problem. I still have a problem concerning the Pin MSCR values since I am unable to set a proper value based on the S32K344 pinout spreadsheet but I will leave this question for another post.
Cheers!