question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error compile when define ISR routine for external interrrupt

See original GitHub issue

I got an error when i try to implement in ISR for external interrupt:

09:30:12 Building the project | Processing...
.pioenvs/optibootPro16MHzatmega328/libFrameworkArduino.a(WInterrupts.o): In function `__vector_2':
collect2: error: ld returned 1 exit status
09:30:16 ERROR | it took 4.49s

Here is implementation

#ifdef EXTERNAL_INTERRUPT
ISR(INT1_vect) {
  CounterControl::GATE_ISR();
};

void CounterControl::GATE_ISR() {

}
#endif

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vlad2005commented, Sep 18, 2016

Yes, is truth! After i make update i see that not working with old json and need to do exactly what u say (after many try’s). Maybe is better to make an update to this threat to help and other users.

0reactions
gepdcommented, Sep 17, 2016

Good to hear!

As recommendation, I realized your JSON file hasn’t the right format, in PlatformIO 3 it should be like this:

{
    "build": {
        "core": "arduino",
        "extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_PRO",
        "f_cpu": "16000000L",
        "mcu": "atmega328p",
        "variant": "eightanaloginputs"
    },
    "frameworks": ["arduino"],
    "name": "Arduino Pro Mini Optiboot ATmega328 (5V, 16 MHz)",
    "platform": "atmelavr",
    "upload": {
        "disable_flushing": true,
        "maximum_ram_size": 2048,
        "maximum_size": 32256,
        "protocol": "arduino",
        "require_upload_port" : true,
        "speed": 115200
    },
    "url": "http://arduino.cc/en/Main/ArduinoBoardProMini",
    "vendor": "Arduino"
}

Rename the json file as: optibootPro16MHzatmega328.json That way you will avoid any problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

AVR External Interrupts - Tutorials
When an interrupt occurs, the current program execution is stopped, the context is saved and the control jumps to Interrupt Service Routine (the...
Read more >
[Resolved] prototype of ISR gives already defined error
I have 2 files that contain interrupt info... a header file called Interrupts.h, and a code file called Interrupts.c. Here they are.
Read more >
Exception and Interrupt - STM32 - Code Inside Out
The current executing application on a processor can be interrupted by either internal system exception or external interrupt.
Read more >
Problem with external interrupt - ST Community
My setting is a SPC56xL Discovery Kit and the SPC5 Studio in combination with the High Tec C compiler. What I want to...
Read more >
Why am I getting error: interrupt service routine should have ...
The compiler arranges to pop the error code off the stack before the IRET instruction. #ifdef __x86_64__ typedef unsigned long long int uword_t; ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found