Bug in Peripheral tool (SPI config)

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

Bug in Peripheral tool (SPI config)

Jump to solution
1,136 Views
durga_choudhury
Contributor V

There is a bug in the peripheral tool when configuring the SPI peripheral with no easy work around. This issue has been there in previous releases of the S32DS IDE but I am reporting it against v 3.6.6

 

MCU: S32K148 in 144 pin package

Host OS: Windows 11

IDE: S32DS 3.6.6

Embedded OS: Bare metal

Driver model: Non-autosar

 

The MCU has 3 SPI interfaces but the IDE shows a drop down of up to 5. Please see screenshot below:

 

If any of the last 2 are selected, the IDE goes into an unrecoverable error mode with exceptions thrown all around and blank screens. At that point the only way to recover the project is to either recreate it from scratch or restore it from a backup such as git checkout.

Tags (3)
0 Kudos
Reply
1 Solution
1,089 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @durga_choudhury 

Thank you for sharing the images along with the additional information.

As you may know, the SpiHWUnit parameter is related to the number of SpiPhyUnits. The order in which the SpiPhyUnits are added determines the CSIB index used. For example, SpiPhyUnit_0 corresponds to CSIB0.

The reason why the SpiHWUnit dropdown shows a list of five options is that this reused the configuration from the MCAL SPI driver. In the MCAL implementation, you can configure both the LPSPI hardware and the SPI interface emulated through FlexIO. In contrast, the IP-level configuration separates these into two different drivers: Lpspi and Flexio_Spi. You can confirm this by comparing the SpiPhyUnitMapping dropdown in both SPI and Lpspi drivers.

Lastly, regarding the two errors shown

  1. Error occurs when, for example, you create two SpiPhyUnits and assign them to specific SpiExternalDevices, but later delete one of the SpiPhyUnits without removing the corresponding SpiExternalDevice. ConfigTools then reports an error because a required referenced configuration no longer exists.
  2. As you mentioned, the S32K148 device contains only three LPSPI instances. If you select CSIB3 or CSIB4 in the SpiHWUnit parameter within the IP driver, the tool will fail because these entries correspond to configurations intended for the FlexIO‑emulated SPI, which is not integrated in this driver, as explained earlier.

View solution in original post

0 Kudos
Reply
5 Replies
1,119 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @durga_choudhury 

The image seems to be missing, could you upload it again so I can better understand the situation?

 

BR, VaneB

0 Kudos
Reply
1,100 Views
durga_choudhury
Contributor V

spi1.png

 The above is a screenshot on how to reproduce it. And a screenshot of what happens is below. After this happens, the only way to recover is to kill and restart the IDE and restore the project from a backup.

 

0 Kudos
Reply
1,089 Views
durga_choudhury
Contributor V

Another way to reproduce the issue is:

1. Create a project with multiple SPIPhyUnits

2. Delete one that is not the last one.

 

See the screen shot as an example

Tags (1)
0 Kudos
Reply
1,090 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @durga_choudhury 

Thank you for sharing the images along with the additional information.

As you may know, the SpiHWUnit parameter is related to the number of SpiPhyUnits. The order in which the SpiPhyUnits are added determines the CSIB index used. For example, SpiPhyUnit_0 corresponds to CSIB0.

The reason why the SpiHWUnit dropdown shows a list of five options is that this reused the configuration from the MCAL SPI driver. In the MCAL implementation, you can configure both the LPSPI hardware and the SPI interface emulated through FlexIO. In contrast, the IP-level configuration separates these into two different drivers: Lpspi and Flexio_Spi. You can confirm this by comparing the SpiPhyUnitMapping dropdown in both SPI and Lpspi drivers.

Lastly, regarding the two errors shown

  1. Error occurs when, for example, you create two SpiPhyUnits and assign them to specific SpiExternalDevices, but later delete one of the SpiPhyUnits without removing the corresponding SpiExternalDevice. ConfigTools then reports an error because a required referenced configuration no longer exists.
  2. As you mentioned, the S32K148 device contains only three LPSPI instances. If you select CSIB3 or CSIB4 in the SpiHWUnit parameter within the IP driver, the tool will fail because these entries correspond to configurations intended for the FlexIO‑emulated SPI, which is not integrated in this driver, as explained earlier.
0 Kudos
Reply
1,084 Views
durga_choudhury
Contributor V

Hello @VaneB 

 

Thanks for the clarification. This is similar to what I thought it would be, except I'd expect it to gracefully show an error as some other configuration inconsistencies show instead of crashing with an 'internal error'.

0 Kudos
Reply