cancel
Showing results for 
Search instead for 
Did you mean: 

Assignment to itself

Daniele Mirri
Associate II
Posted on March 24, 2017 at 16:11

Hi everyone,

I'm trying to use SPI on SPC560B-DIS but the library lld_spi.c looks to be corrupted I have this error log:

Assignment to itself 'spip->dspi->SR.R = spip->dspi->SR.R' spi_lld.c 

does someone know how to fix it??

Thanks in advance 

Daniele.

#library #spi #assignment #spi_lld.c
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on April 10, 2017 at 15:07

Hello Daniele ,

I think that it is a CDT Configuration issue

You can disable it in CDT configuration

http://stackoverflow.com/questions/23768307/why-does-eclipse-cdt-say-self-assignment-is-an-error

 

it does not generate compilation issue on Free Gcc, Hightec gcc and GHS

  Best regards

                          Erwan

View solution in original post

4 REPLIES 4
Erwan YVIN
ST Employee
Posted on March 28, 2017 at 11:41

Hello Daniele ,

it is not a bug.

cf Chapter 28.5.5 in the RM0037

it is the DSPI Status Register

'The DSPIx_SR contains status and flag bits. The bits are set by the hardware and reflect the

status of the DSPI and indicate the occurrence of events that can generate interrupt or DMA

requests. Software can clear flag bits in the DSPIx_SR by writing a ‘1’ to clear it (w1c).

Writing a ‘0’ to a flag bit has no effect.'

        Best regards

                  Erwan

Posted on April 07, 2017 at 11:05

I don't understand what you mean with that or what is the solution or in general what should I do.

That instruction is in the 

lld_spi.c not written by me but from the developers of SPC5Studio and as soon i enable the

spi in the wizard the compiler includes the library and it founds the error.

there is a way to fix it?? 

Same problem occurres with CAN if i enable the the FlexCAN peripheral than i enable for instance FlexCAN0 if i generate and than compile it's impossible to compile

Assignment to itself 'canp->flexcan->IFRH.R = canp->flexcan->IFRH.R' can_lld.c /prova CAN/components/spc560bxx_low_level_drivers_component_rla/lib/src line 95 Code Analysis Problem

 
Posted on April 10, 2017 at 15:07

Hello Daniele ,

I think that it is a CDT Configuration issue

You can disable it in CDT configuration

http://stackoverflow.com/questions/23768307/why-does-eclipse-cdt-say-self-assignment-is-an-error

 

it does not generate compilation issue on Free Gcc, Hightec gcc and GHS

  Best regards

                          Erwan

Posted on April 11, 2017 at 10:39

ok thank you Erwan