Clock of lpspi6 has wrong duty-cycle

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

Clock of lpspi6 has wrong duty-cycle

479 Views
cstoidner
Contributor II

Hello, 

we have a problem with the lpspi6 clock on the i.MX 93. When we measure the clock signal with an oscilloscope, we can see that the high-level phase and low-level phase have different lengths. The low-level takes about 66% of the period, and the high-level only 33% of the period (see attached image 'SPI6_QuickPrint60.png'). 

SPI6_QuickPrint60.png

We observed that behaviour with NXP BSP version "6.6.52_2.2.0". We measured the lpspi6 clock also with the older BSP version "6.1.55_2.2.0". With that older version we see that the clock signal behaves as we would expect it (50% high and 50% low).

Unfurtunately, with that wrong duty-cycle of version "6.6.52_2.2.0" we miss the limits of the spec of the connected SPI slave.

Find below the snippet from our DTS that enables/configures the lpspi6:

 

 

// ...

&lpspi6 {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_lpspi6>;
   cs-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
   status = "okay";

   /* TPM */
   tpm@0 {
      compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
      reg = <0>;
      spi-max-frequency = <10000000>;
   };
};

// ...

pinctrl_lpspi6: lpspi6grp {
   fsl,pins = <
      MX93_PAD_GPIO_IO00__GPIO2_IO00 0x3fe
      MX93_PAD_GPIO_IO01__LPSPI6_SIN 0x3fe
      MX93_PAD_GPIO_IO02__LPSPI6_SOUT 0x3fe
      MX93_PAD_GPIO_IO03__LPSPI6_SCK 0x3fe
   >;
};

// ...

 

 

 

Do you have any idea which impact the software can have to the duty-cycle of the lpspi6 clock?
Do you have any idea how we can narrow down the problem?

Thanks,
Christoph

0 Kudos
Reply
5 Replies

460 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @cstoidner!

Thank you for contacting NXP Support!

 

What board are you using?

Are you using the A1 silicon version of the chip?

 

The issue is happening only with device that you are connecting?

 

Can you try using the spidev test?

 

Best Regards!

Chavira

0 Kudos
Reply

422 Views
cstoidner
Contributor II

Hi @Chavira  ,

> What board are you using?

We have our own custom board.

 

>Are you using the A1 silicon version of the chip?

Yes, we have rev A1.

 

> The issue is happening only with device that you are connecting?

I can not answer that, as we have only that device connected. However, what I can say is, that it seems to be somehow related to the software BSP version:

  • In the past, we used NXP BSP version 6.1.55_2.2.0. With that, the spi clock duty-cycle was 50%/50%, as we would expect it.
  • When we updated to NXP BSP version 6.6.23-2.0.0, we saw this wrong spi clock duty-cylce of 33%/66% for the first time.
  • Also with the current latest BSP version 6.6.52_2.2.0 this wrong spi clock duty-cylce of 33%/66% occurs.

 

> Can you try using the spidev test?

The spi slave we have connected is a TPM (Trusted Platform Module) chip. So we just used the shell command

tpm2_getrandom --hex 32

on the board, to have some spi communication for measuring the clock signal.
Do you think "spidev test" would make any difference for the clock?

 

Thanks,
Christoph

0 Kudos
Reply

405 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @cstoidner!

I am using the FRDM-iMX93 board and I can´t replicate the issue (see the attached image).

 

The issue is only happening in LPSPI6?

 

 

 

 

 

 

0 Kudos
Reply

283 Views
cstoidner
Contributor II

Hi @Chavira ,

we tested it also on lpspi1. We had no slave connected, but during the tpm request from the imx93 we can see the clock. It is also other than expected (about 61% low and 39% high).

Any clue what can impact the SPI clock's duty cycle?

Regards,
Christoph

0 Kudos
Reply

260 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @cstoidner!

 

I think the problem should be your board or your custom driver since I can´t see that error in NXP boards.

Please check carefully and compare your results with our boards.

 

Best Regards!

Chavira

 

0 Kudos
Reply