Unable to communicate with UJA1169TK/F/3Z by Flexio_SPI

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to communicate with UJA1169TK/F/3Z by Flexio_SPI

909 Views
1040180003
Contributor III

Hi, guys!

I am testing the UJA1169TK/F/3Z and my MCU is S32K146(64 pins).

The 1169 is configured in Forced Normal mode in the factory.  Therefore, I can now use the CAN communication even if I do not configure 1169. These have been debugged and passed on my board.

But when I use flexio_SPI to read the status of 1169, the return is always 0.

I know that in the SDK "sbc_uja116x_driver.c"  use LPSPI by default, but I can only use the flexio SPI on my board.

So, I made some changes based on the SDK.

My expert component is configured as follows:

MOSI : flexio 5 = PTE 11

MISO : flexio 4 = PTE 10

CS : flexio 6 = PTE 4

SCK : flexio 7 = PTE 5

pastedImage_1.png

pastedImage_2.png

Some related code in my project:

status = FLEXIO_DRV_InitDevice(INST_FLEXIO_SPI1, &flexIODeviceState);

status = FLEXIO_SPI_DRV_MasterInit(INST_FLEXIO_SPI1, &flexio_spi1_MasterConfig0, &flexIOSPIState_Master);

uint8_t regData;

status = SBC_DataTransfer(SBC_UJA_IDENTIF, NULL, &regData);

In the "SBC_DataTransfer()", I replace the "LPSPI_DRV_MasterTransferBlocking()" with "FLEXIO_SPI_DRV_MasterTransferBlocking()"

pastedImage_4.png

Below is the debug result:

pastedImage_2.png

From the datasheet, these registers should be readable:

pastedImage_3.png

Although the read returns are successful, the results are all zero.

My environment is:

S32 Design Studio for ARM Version: 2.2

SDK 3.0.2

 

Please give me some advices.

Thanks!

 

Lu

Labels (1)
0 Kudos
4 Replies

789 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Lu,

Your configuration seems to be correct. However, it would be good to see what is going on on the bus. Do you have a logic analyzer or an oscilloscope to capture the SPI traffic?

Also I would recommend you taking a closer look at the attached AH1306 describing the SPI interface and software flow in details. If you create a standard ticket, I can share with you also the UJA1169 example project which demonstrates how to initialize the UJA1169, trigger the watchdog, change operation modes, handle events etc.

Best regards,

Tomas

0 Kudos

789 Views
1040180003
Contributor III

Thanks for your reply, Tomas!

I have just create a Case(case number: 00265627),  is it right?

Lu

0 Kudos

789 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Lu,

Yes, I have already sent you the example project.

Best regards,

Tomas

0 Kudos

789 Views
1040180003
Contributor III

Thank you!

I will study this example, and I will continue to update if there are progress and problems.

0 Kudos