Hello,
We start to develop our SW with the eval board for S32K358 and it's works fine, now we used our HW board.
We are able to used the CAN, the SPI but we are not able to set GPIO to 1 or 0.
This works fine on the eval board ( we are able to turn ON/OFF the led) but on our board it doesn't works.
We try several output, we set the output on INOUT and when we set the GPIO to 1 we read 0.
We have review the port ant DIO config several times.
We aren't able to understand why.
Do you have some suggestions on what to check ?
thanks you
Hi,
good point...IOMUX excel file shows MCU port and TSPC assignment in "TSPC Selection" tab, and
the RM points to have TSPC clock enabled...
Seems I overlooked that. But TSPC clock should be enabled upon reset, that's why Radek was able to control pin after main function was hit.
BR, Petr
Hello NXP Guys,
I think that the note is wrongly placed. Indeed, we didn't implement the TSPC feature, only the SIUL2. So I think moving (or copying) this note from TSPC chapter to SIUL2 chapter will help other customers.
Best regards,
David
hello @PetrS
We done some more tests, on the eval board S32K3X8EVB-Q289, We are not able to set/reset the GPIO PTD21 but we are able to control the LEDs pin (PTG29,PTG30,PTG31,PTF21,PT22,PTF23) , so I think we know how to configure the DIO/port module (we are using EB tresos)
Are you aware of some errata on S32K358 ?
Hi,
PTD21 is normal pad, connected to board's arduino headers, there would not be issue with GPIO functionality. Check MSCR117 for a setting. You can try GPIO input as well, just clear OBE and set IBE, apply high/low level on pad and check GPDI117 if values is changed.
There is no errata for SIUL module.
BR, Petr
Hi,
for DIO usage you can refer to RTD demo example, but you probably did it.
Then I can recommend to check SIUL2 setting within debugger. To control GPIO pin it is enough to set respective MSCRn register to have OBE bit set and SSS=0. Then writing to given GPDOn register you control output level. It is assumed SIUL module is clocked, but if you are able to work with CAN, SPI then SIUL2 config is possible.
BR, Petr
Hi,
this looks correct, not sure why you do not see it on the pin/header. So assuming you really measure right pin, I can only recommend to do below checks...
- set OBE and IBE with SSS=0, change GPDO and measure pin ouput and GPDI register
- set only IBE, and enable internal weak pull/down, see GPDI. connect pin externally to high/low, see GPDI
- set pin for available peripheral, i.e. eMIOS and generate some output, can be eMIOS GPIO output mode
BR, Petr
Hi,
so you tested that GPIO input is working, peripheral can drive the same pin, but GPIO output control using GPDO does not work. Really weird. Radek proved GPDO works properly. You can try to test PGPDO register, but assume it will be the same.
Then, please share very simplified project showing the issue so we can test it on the EVB.
BR, Petr
Hi Petr and Radek,
Yes and I tried on 2 different S32K3X8EVB-Q289 evaluation board and on our ECU prototype. I have always the same results. On the first evalboard, there was nothing connected except the trace32.
If you managed to drive this pin, it means that we have a software issue somewhere but I don't see it.
Perhaps, Radek can share his project as it is already done and I can test it instead of building a simple project for you ?
Best regards,
David
When I apply a high level on the PIN GPD21 set as an input with pull down, I can see that GPDI117 is read as high level.
When I apply a low level level on the PIN GPD21 set as an input with pull down, I can see that GPDI117 is read as low level.
When I apply a low level level on the PIN GPD21 set as an input with pull up, I can see that GPDI117 is read as low level.
When I apply a high level level on the PIN GPD21 set as an input with pull up, I can see that GPDI117 is read as high level.
So, the GPD21 behaves correctly when it is used as input
Hello dduminy,
That is very strange.
We tried the same test on the same setup (S32K3X8EVB-Q289, the same MCU maskset, and the same manufacturing batch).
We restart MCU and wait at the breakpoint at the beginning of the main() and drive the pin directly by Lauterbach probe. We measured voltage at PTD21 pin at J357 connector and also on GPIO pin matrix breakboard.
The output voltage fits with the pin output level and the same levels was detected at the pin input.
Are you sure that you do not have any load/short externally connected to the PTD21?
Best regards
RadekS