Coder Social home page Coder Social logo

Comments (9)

kevin-pololu avatar kevin-pololu commented on July 20, 2024

I suspect this normally isn't an issue if you program the A-Star from the Arduino IDE because the sketch itself uses USB (so it can appear as a COM port to the computer). Since you aren't using Arduino, the problem is probably caused by the USB interrupt trying to run an interrupt handler that isn't defined in your program. We'll keep this issue open and look at fixing it in case we make a new version of the bootloader, but for now, it looks like you've found an appropriate workaround by clearing USBCON.

Have you checked whether this problem also occurs with the stock Caterina bootloader (e.g. on an Arduino Leonardo or Arduino Micro)?

from a-star.

ferfebles avatar ferfebles commented on July 20, 2024

I have no other Arduino board, so I cannot check with the stock Caterina bootloader. But there is an old thread in AVR freaks that gave me the clue to solve my problem (http://www.avrfreaks.net/forum/sei-problem), so I think that it happened with other bootloaders.

The workaround is easy, and I understand the problems of fixing and testing code like this. But perhaps it could be added as a comment to the Pololu A-Star 32U4 User Guide.

Thanks for your little board, it's being great fun to use it!

from a-star.

tekstop avatar tekstop commented on July 20, 2024

I am facing the same issue with Arduino Leonardo. I am trying to create a library for Simulink for the new robot and have run into this issue. What would be a workaround for this?
Note, as you mentioned, this seems to work fine with the Arduino IDE.

from a-star.

ferfebles avatar ferfebles commented on July 20, 2024

What worked for me was

USBCON = 0;  // Disable USB interrupts

as you can see in the code example before.

from a-star.

tekstop avatar tekstop commented on July 20, 2024

Since the code is auto generated, the above workaround isn't feasible for me. Is there any other workaround? @kevin-pololu

from a-star.

kevin-pololu avatar kevin-pololu commented on July 20, 2024

Hi, @tekstop. I think your only options would be one of the following:

  • Disable the USB interrupt at the beginning of the program with USBCON = 0
  • Define your own minimal USB interrupt handler
  • Modify the bootloader to disable the USB interrupt before running the sketch

I have not tried the second and third options, so I am not certain they would work or are practical. The first two options would require you to be able to customize the code generator or edit its output, and the third would require the use of an AVR ISP (in-system programmer) to load the modified bootloader onto the Leonardo.

from a-star.

tekstop avatar tekstop commented on July 20, 2024

Hi @kevin-pololu, thanks for your quick reply!
Where can I find the bootloader to modify?

from a-star.

tekstop avatar tekstop commented on July 20, 2024

nvm found it! Thanks for your help! I will give it a try and let you know whether that works!

from a-star.

NicoHood avatar NicoHood commented on July 20, 2024

The running USB clock is a known problem of the leonardo bootloader.
However this board uses a special bootloader which causes problems for me. It does not work at all with the current IDE. See this: arduino/Arduino#3910

Also the brown out detection at 4.5V keeps me from using the board on an usb hub which normally should work fine. Its in specs, makes somehow sense of course, but is not productive for daddeling.

from a-star.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.