cancel
Showing results for 
Search instead for 
Did you mean: 

STPM3x Metering chip driver not handling GPIO pins properly

VivekB
Associate II

x linux-5.15-stm32mp-r2 for our puposes. I have also attached the pps-gpio source code in case it is useful. 

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan SZYMANSKI
ST Employee

Hello @VivekB ,
Please let me summarize your case just for me to be sure to fully understand your issue (thank you for the complete summary of your case) :

You configure SPI1 as SPI master of 5 different slaves (as I see in your device tree). You define yourself 5 GPIOs for CS pins (not use the native HW NSS one which would be <0> ) to drive the CS lines of the different slave you want to talk to.

At first boot, everything looks to work well, you can receive information from your measurement SPI slave module on request, and you have also a module that send you a 0 pulse regularly on a lane driven by your pps driver. (By the way, can you put me the source code of this one please, I think it did not pass in attachment of your first message).

After processing a soft reboot (can you put me the command you use ?), the system restart, driver reprobes, but the PPS driver looks to not work correctly, as you are sure that the pulse still come into MP15, but it is not updated from a SW point of view. When you disable the drive of another GPIO of the same bank (the one used as CS for another slave), the problem seems to not appear, so you think there is a correlation between both. 

Sorry it is a little bit long but I want to be sure to not miss anything.

Now concerning my questions :

  • As I said, can you put me pps driver in attachment ?
  • Did you see any curious dmesg log after the soft reset concerning GPIO driver ? 
  • Can you explain the soft reset you process, do you have some logs of your drivers when it restart ? Or complete boot/ reboot logs in general ? 
  • Did you try to "just" unload both of your modules and reload them at runtime without the soft reboot, just to see if we can observe a similar issue ? 

Kind regards,
Erwan.

 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
Erwan SZYMANSKI
ST Employee

Hello @VivekB ,
Please let me summarize your case just for me to be sure to fully understand your issue (thank you for the complete summary of your case) :

You configure SPI1 as SPI master of 5 different slaves (as I see in your device tree). You define yourself 5 GPIOs for CS pins (not use the native HW NSS one which would be <0> ) to drive the CS lines of the different slave you want to talk to.

At first boot, everything looks to work well, you can receive information from your measurement SPI slave module on request, and you have also a module that send you a 0 pulse regularly on a lane driven by your pps driver. (By the way, can you put me the source code of this one please, I think it did not pass in attachment of your first message).

After processing a soft reboot (can you put me the command you use ?), the system restart, driver reprobes, but the PPS driver looks to not work correctly, as you are sure that the pulse still come into MP15, but it is not updated from a SW point of view. When you disable the drive of another GPIO of the same bank (the one used as CS for another slave), the problem seems to not appear, so you think there is a correlation between both. 

Sorry it is a little bit long but I want to be sure to not miss anything.

Now concerning my questions :

  • As I said, can you put me pps driver in attachment ?
  • Did you see any curious dmesg log after the soft reset concerning GPIO driver ? 
  • Can you explain the soft reset you process, do you have some logs of your drivers when it restart ? Or complete boot/ reboot logs in general ? 
  • Did you try to "just" unload both of your modules and reload them at runtime without the soft reboot, just to see if we can observe a similar issue ? 

Kind regards,
Erwan.

 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Thanks Erwan.

 

Hello @VivekB ,
Having a deeper look in your description and in your files, and some things to check I think.

First, the fact that you cannot rmmod and insmod your drivers properly is a bad sign. It means that something is not well covered in your remove function. Yes maybe it could be interesting to share me the different logs concerning this topic. 

In the first boot of the platform, do you also see this message "SPI driver stpm3x has no spi_device_id for st,stpm33" ?

Did you try to do step by step probing on stpm33 driver to see exactly which instruction make the things going bad ? 

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.