Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
1 Solution

Hi @Pradeep_PN 

As mentioned above issue is solved now . Issue is with my bootloader . After rectification of my bootloader application ,spi master is working fine .

Apart from this, I found a bug in SPI_CONFIG_APP . Due to spi master malfunctioning  i have replaced spi_master  with spi_cfg  app. 

I found spi data coming from slaves physically in logic analyser but unable to capture in my software .

below screenshot shows RBUF,RBUFSR,RBUFD register values are zero.

NarendraC_1-1687768966775.png

So i compared spi_cfg app with my old projects. I found change  in XMC_SPI_CH_SetInputSource(XMC_SPI2_CH1, XMC_SPI_CH_INPUT_DIN0, 0U) App in Initialization .I changed input resource of input stage dx0 (receive pin) to 2U.

It started working fine after changing input resource for receive pin

NarendraC_2-1687769143653.png

Thank you 

Narendra 

 

View solution in original post

0 Likes
4 Replies
Pradeep_PN
Moderator
Moderator
Moderator
250 sign-ins 100 solutions authored 25 likes received

Hi @NarendraC ,

Th SPI_CONFIG and SPI_MASTER both apps are used to configure the USIC channel but with small differences.

The SPI_CONFIG app is an peripheral app where as SPI_MASTER is an communication app.

The SPI_MASTER app provides the interface to configure one of the USIC channels to act as SPI (Serial Peripheral Interface) Master.

The SPI_CONFIG app is an peripheral configuration app . Which can be configured as both master and slave.

The major difference you can observe is APP configuration parameters and in the Architectural Description.

For reference please refer to the app help section of respective apps.

For getting the app help section please right click on the respective app. 

Hope this helps and let me know if you need any further information.

Best Regards
Pradeep.

 

0 Likes

Hi @Pradeep_PN ,

I have a application with 3 spi master app configurations  ,in one of the spi master .I wanted to receive the data from one slave through only polling.

So, I have created a standalone project with SPI master and packets are receiving from slave through polling. 

Since it is successfully working. I have implemented same in my main application which have  other hardware peripherals with 2 spi master apps.

I observed I am unable to receive the packet from slave as well ,this function API is always in while loop.it is blocking other functionalities

below is snap of the receiving packet

NarendraC_0-1687424970008.png

In process of debugging i replaced  "XMC_USIC_CH_GetReceiveBufferStatus" with "XMC_USIC_CH_GetTransmitBufferStatus" . after changing to "TransmitBufferStatus ".I am able to read slave data. but there is no consistency.

NarendraC_1-1687425347855.png

could you please help in earliest .let me know if you need any information 

Thanks 

Narendra C

0 Likes
Pradeep_PN
Moderator
Moderator
Moderator
250 sign-ins 100 solutions authored 25 likes received

Hi @NarendraC ,

As per my understanding when you changed the API "XMC_USIC_CH_GetReceiveBufferStatus" with "XMC_USIC_CH_GetTransmitBufferStatus"  there seems to me some data coming with some inconsistency.

There must be a problem with the API "XMC_USIC_CH_GetReceiveBufferStatus" which does a  polling so if possible can you please try to use interrupts instead of polling.

Hope this helps and let me know if you need any further information.

 

Best Regards
Pradeep.

0 Likes

Hi @Pradeep_PN 

As mentioned above issue is solved now . Issue is with my bootloader . After rectification of my bootloader application ,spi master is working fine .

Apart from this, I found a bug in SPI_CONFIG_APP . Due to spi master malfunctioning  i have replaced spi_master  with spi_cfg  app. 

I found spi data coming from slaves physically in logic analyser but unable to capture in my software .

below screenshot shows RBUF,RBUFSR,RBUFD register values are zero.

NarendraC_1-1687768966775.png

So i compared spi_cfg app with my old projects. I found change  in XMC_SPI_CH_SetInputSource(XMC_SPI2_CH1, XMC_SPI_CH_INPUT_DIN0, 0U) App in Initialization .I changed input resource of input stage dx0 (receive pin) to 2U.

It started working fine after changing input resource for receive pin

NarendraC_2-1687769143653.png

Thank you 

Narendra 

 

0 Likes