An error occurs when I add ISR routine cord

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am programing it now in ATxmega128A1U .

 

I use SPIF port in SPI communication.

I would like to settle a code going for ISR routine if I receive data in SPIF port.

 

 

So, I added ISR code in event.c

 

ISR(SPIF_INT_vect)
{

}

 

https://github.com/KenjiMaehara/raspberryPiTCPClient/commit/89b4c85451febee0cd841acd531c34cac8112c60#diff-974068d932dfafd8f83f2ef729cab1a3
 

 

I added this interrupt routine, but the following error occurs.

 

Error2Disabling relaxation: it will not work with multiple definitions11MainUnit
Error3ld returned 1 exit statuscollect2.exe00MainUnit
Error1multiple definition of `__vector_118'C:\Users\kmaeh_000\Documents\GitHub\raspberryPiTCPClient\testSpi161101\M1601A_20161205\MainUnit\Debug/.././event.c871MainUnit
 

I use RTOS called uCOS in the program.

 

Please tell me about this kinds of solution.

 

Thanks.

 

 

 

 

 

kenji maehara

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ISR(SPIF_INT_vect) ... in ATxmega128A1U ....

 

Ir that the correct name for the Xmega chip? Don't know I will have to look it up just like you do.wink

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

blackzoro1112 wrote:
ISR routine

Note that "ISR" = Interrupt Service Routine; so it is not correct to write, "ISR routine" - that is saying, "interrupt service routine routine" !

 

cool

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi js,

 

Thank you for your reply.

Accroding to iox128a1.h

 

I confirmed such a description.

/* SPIF interrupt vectors */
#define SPIF_INT_vect_num  118
#define SPIF_INT_vect      _VECTOR(118)  /* SPI Interrupt */

 

I thought that overlap produced the contents of the error about the cord of the interrupt.

Therefore I searched "vect" in the whole project in the word about the interrupt and saw it.

 

Then I was found by the next file contents.

 

・iox128a1.h

・app_vect.s

 

 

I revised ”app_vect.s” as follows.

 

__vector_118:   JMP     spif_int     ;    118       0x01D4       SPI F

https://github.com/KenjiMaehara/...

 

 

The error disappeared.

However, SPIF does not come to ISR at the time of the data reception.

 

 

Please tell me if you may understand it from such a phenomenon.

 

 

 

Thanks

 

 

 

 

 

 

 

kenji maehara

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi awneil,

 

Thank you for your reply.

 

I just knew the meaning of ISR  LoL

 

Thank you

kenji maehara

Last Edited: Wed. Mar 8, 2017 - 09:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

blackzoro1112 wrote:
Please tell me if you may understand it from such a phenomenon.
Almost always if you get the error:

Error1multiple definition of `__vector_118

it is because you have put function/data in a .h file rather than a .c file. If that .h file is then #include'd into more than one .c file then as each is compiled it will create a copy of the data defined in the .h file. This is why you should never have any code/data instantiation in a .h file.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

blackzoro1112 wrote:
ISR routine

Note that "ISR" = Interrupt Service Routine; so it is not correct to write, "ISR routine" - that is saying, "interrupt service routine routine" !

 

cool

 

What? Don't you get money from an ATM machine?

 

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

don't start ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

don't start ..

or even ASF...

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi all,

 

I found an article about ISR of uCOS.

https://www.avrfreaks.net/forum/how-design-rx-buffer-ucos-ii

 

When They made the routine of the interrupt signal called SIG_UART0_RECV with the cord of this person, I used UCOSISR.

 

I have not yet tried like this coding, must I do this way when I use the routine with the interrupt signal?

 

I need your help.

 

Thanks,

kenji maehara

Last Edited: Mon. Mar 13, 2017 - 12:16 AM