Routing signals to EMIOS channel from Trgmux (S32k3)

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

Routing signals to EMIOS channel from Trgmux (S32k3)

Jump to solution
1,268 Views
AlexCloutier
Contributor I

Hello,

I am trying to use the ICU peripheral on a S32k312 MCU. 

I am using Matlab R2022a, EB Tresos version 29.0.0, NXP MBDToolbox S32k3xx version 1.4.0 and NXP support package S32k3xx version 1.4.0.

I am currently working on an evaluation board (S32k312EVB-Q172) with a slightly modified version of a custom ISR example provided with the Matlab Toolbox (s32k3xx_isr_custom_code_ebt).

My goal is to route signals from pins to trgmux, then to LCU, then back into an Emios channel for measurements. 

As part of this goal, the first step I managed to do using the example is to use a pin (PTA19) directly as EMIOS_1_EMIOS_1_CH_1_H_IN (Emios 1 channel 1 input) to trigger an interrupt on rising edge event:

AlexCloutier_0-1696440236990.png

This part is working for me, as the blue led is flashed when the signals is switching from low to high according to my modified Simulink model. 

 

Now, when I try to route PTA19 through TRGMUX_TRGMUX_IN13_IN into TRGMUX_IP_OUTPUT_EMIOS1_CH1_4_IPP_IND_CH1, the same behavior is not observed. 

From the various attempt and testing I made, it seems like the signal is never actually inputted into Emios 1 channel 1. 

Is there something missing in my configuration to input into an Emios channel from Trgmux? 

Attached is my current, not working,  Simulink model folder.

Thank you for your time,

Alex Cloutier

0 Kudos
Reply
1 Solution
1,058 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @AlexCloutier 

I have investigated the described use case together with the attached model and configuration project provided in the thread, and based on this, I would like to provide the following information:

The EB Tresos configuration is complete, in the sense that all the settings are correctly enabled for ICU, TRGMUX and for the PORT component (PTA19 configuration).

However, one additional operation must be performed in order to specify that the EMIOS1_CH1 should take its source signal from the output of TRGMUX. This should be done by setting the proper value (in this case 0110) inside the SIUL_IMCR593 register (Input Multiplexed Signal Configuration Register), as it is defined inside the IOMUX file which you could find attached to the S32K3xx MCU Family - Reference Manual. Please check the screenshot below, taken from the IOMUX file, containing the input muxing of EMIOS1_CH1. 

Irina_Costachescu_0-1698912808081.png

This setting is not accessible from EB Tresos, so, to enable this connection inside our model, I would propose the following steps:

1. Open the Hardware Settings of the model

Irina_Costachescu_1-1698913034186.png

2. Open the Board Initialization sequence - here, all the peripherals, pins and clocks are initialized with the settings made in the configuration project

Irina_Costachescu_2-1698913062805.png

3. After initializing the Port component, add the IMCR register setting for EMIOS1_CH1 as illustrated below, press the Save button from the upper left side of the window and close the Board Initialization GUI.

Please note that the IMCRs defined in the IOMUX file have an offset of 512 with respect to the IMCR number defined in the SIUL2 memory map, hence the writing operation to register IMCR[81] (593 - 512 = 81).

Irina_Costachescu_3-1698913095444.png

4. Apply the settings in the Configuration Parameters by clicking the bottom right Apply button.

5. Rebuild the model

Please let us know if this solution works

Thank you,
Irina

View solution in original post

0 Kudos
Reply
3 Replies
1,122 Views
AlexCloutier
Contributor I

Hello, I am still having this issue. Is there something wrong with my configuration ?

0 Kudos
Reply
1,059 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @AlexCloutier 

I have investigated the described use case together with the attached model and configuration project provided in the thread, and based on this, I would like to provide the following information:

The EB Tresos configuration is complete, in the sense that all the settings are correctly enabled for ICU, TRGMUX and for the PORT component (PTA19 configuration).

However, one additional operation must be performed in order to specify that the EMIOS1_CH1 should take its source signal from the output of TRGMUX. This should be done by setting the proper value (in this case 0110) inside the SIUL_IMCR593 register (Input Multiplexed Signal Configuration Register), as it is defined inside the IOMUX file which you could find attached to the S32K3xx MCU Family - Reference Manual. Please check the screenshot below, taken from the IOMUX file, containing the input muxing of EMIOS1_CH1. 

Irina_Costachescu_0-1698912808081.png

This setting is not accessible from EB Tresos, so, to enable this connection inside our model, I would propose the following steps:

1. Open the Hardware Settings of the model

Irina_Costachescu_1-1698913034186.png

2. Open the Board Initialization sequence - here, all the peripherals, pins and clocks are initialized with the settings made in the configuration project

Irina_Costachescu_2-1698913062805.png

3. After initializing the Port component, add the IMCR register setting for EMIOS1_CH1 as illustrated below, press the Save button from the upper left side of the window and close the Board Initialization GUI.

Please note that the IMCRs defined in the IOMUX file have an offset of 512 with respect to the IMCR number defined in the SIUL2 memory map, hence the writing operation to register IMCR[81] (593 - 512 = 81).

Irina_Costachescu_3-1698913095444.png

4. Apply the settings in the Configuration Parameters by clicking the bottom right Apply button.

5. Rebuild the model

Please let us know if this solution works

Thank you,
Irina

0 Kudos
Reply
984 Views
AlexCloutier
Contributor I

Hello Irina,

Thank you for your response. It was indeed the correct answer.

Do you have any insight as to why this register is not configured automatically when using EB tresos ?
Is it configurable via S32 configuration tool?

Anything special about this register that makes non configurable via EB tresos?

I'm asking this question to have better insight on how EB tresos configuration works if a similar problem arises in the future when trying to configure other peripherals.


Thank you,

Alex Cloutier

0 Kudos
Reply