Skip to content

Compiling error on ATmega32u2 #24

Closed

Description

@mYreme

For me it seems to be impossible to get it run under my ATmega32u2 as I am not able to compile the FastLed.

The ATmega is connected to RPi UART
RPi TxD <-> ATmega PORTD Pin PD2

The LED Strip is connected to the ATmega
ATmega PORTB Pin PB0 <-> DI LED Strip

Any suggestions to get it work?

Activity

  1. focalintent commented on Feb 6, 2014

    @focalintent
    Contributor

    As I said in the other ticket - this is not supported yet, there is already a ticket (which you just commented on) tracking supporting compiling outside of the arduino environment.

  2. focalintent commented on Feb 6, 2014

    @focalintent
    Contributor

    Also, as mentioned on the other ticket, you can ask on the g+ community where some users have hacked something together that works, but is not supported.

  3. mYreme commented on Feb 6, 2014

    @mYreme
    Author

    Already searched the complete G+ Communities, there's nothing about 32u2 and WS2812B.
    But thank You anway...

  4. focalintent commented on Feb 6, 2014

    @focalintent
    Contributor

    https://plus.google.com/106133687591204787878/posts/GXjwo4cojTC is where someone mentions getting the code to build without the arduino environments. However, there's a second issue here as well - which is that the ATmega32U2 is not a currently supported chipset (I was confusing that with the ATmega32U4, which is what is used in the Leonardo, which is supported in the library).

    Once you take care of the issue with building without the arduino environments by searching for the line:

    #elif defined(AVR_ATmega32U4)

    in the file fastpin.h (or, if you're using the 2.1 branch, fastpin_avr.h) and changing it to:

    #elif defined(AVR_ATmega32U4) || defined(AVR_ATmega32U2)

    (this is what I get for answering issues off of the phone). I would suggest spending some time working on building via the arduino environment instead of avr-g++ directly and testing/shaking out the ATmega32U2 issues there - http://www.mattairtech.com/index.php/development-boards/atmega32u2-usb-development-board-arduino-compatible.html has a modified arduino environment for building for the ATmega32U2.

  5. mYreme commented on Feb 6, 2014

    @mYreme
    Author

    I don't know why but even the threepixeldemo.c and WS2811.h from Alan doesn't seem to work properly. I compiled the project using Atmel Studio 6.1 and flashed the .hex using FLIP.

    When I put the 5V to the LED Strip (leaving ATmega32u2 at my Notebook -> USB) LEDs lit up once, if I disconnect the 5V from Strip and reinsert it seems the next color is lit up.

    But it doesn't loop, just if I put the 5V back. Is this maybe a Fuse error?

  6. focalintent commented on Feb 6, 2014

    @focalintent
    Contributor

    Hmmm - that’s a tough one - and unfortunately, I haven’t done much work with raw setups. It is also possible there might be a slight problem with the strip that you have - but i’m not sure either. Any chance that you have an arduino board handy that you can do a quick test with using the FastLED code, just to verify that your strip is ok?

  7. mYreme commented on Feb 6, 2014

    @mYreme
    Author
  8. mYreme commented on Feb 6, 2014

    @mYreme
    Author

    Is it possible that I am used to have the 400Khz Strip type?

  9. focalintent commented on Feb 6, 2014

    @focalintent
    Contributor

    The library supports all the variations - including the 400khz one - I don't have a quick lookup for the chipset name in the code but I can grab it.

    --Dg (on mobile phone, pardon terseness and typos)

    On Feb 6, 2014, at 2:23 PM, mYreme [email protected] wrote:

    Is it possible that I am used to have the 400Khz Strip type?

    —
    Reply to this email directly or view it on GitHub.

  10. mYreme commented on Feb 6, 2014

    @mYreme
    Author

    the problem is i cant verify if the .hex created by Atmel Studio is corrupt or not. FLIP just programs and verify passed too. The ATmega32u2 I have is this one: http://re.reworld.eu/de/produkte/avrstick/index.htm
    Maybe the stick just doesn't work?
    Usually if the 5v is supported to the atmega the code should start or not? so would it be possible for me to test with a multimeter if portb pin0 toggles? just to prove the atmega is working :/

    EDIT seems like communication is not working properly. portd pin2 always 4,94v and portb pin0 between 0,6-0,7 sooo huh i dont know :S

  11. focalintent commented on Feb 6, 2014

    @focalintent
    Contributor

    Yes, the code should start when the atmega is given 5v - as to the other problems - you're working in a tool chain that i don't support, or have any experience working with yet - so, I think you would be better off asking in the g+ group (http://fastled.io/+) and see if any one on there has any advice for getting things working with atmel studio or avr-g++ directly. I suppose it is possible that you have a bad stick, i'd say try doing some other programs and see what's happening - you can use Serial to write output and use a serial monitor to see if your program is running and writing things out to the serial port.

  12. mYreme commented on Feb 7, 2014

    @mYreme
    Author

    So I'm giving up on this with my ATmega, tried all night but doesn't seem it runs the Code.

    Will teensy 3.0 or 3.1 will work? as i have each in the company i guess, maybe i can try it and than order one.

  13. focalintent commented on Feb 7, 2014

    @focalintent
    Contributor

    There's teensy 3 support, I haven't had a chance to finish teensy 3.1 yet.

    --Dg (on mobile phone, pardon terseness and typos)

    On Feb 7, 2014, at 5:09 AM, mYreme [email protected] wrote:

    So I'm giving up on this with my ATmete, tried all night but doesn't seem it runs the Code.

    Will teensy 3.0 or 3.1 will work? as i have each in the company i guess, maybe i can try it and than order one.

    —
    Reply to this email directly or view it on GitHub.

  14. mYreme commented on Feb 7, 2014

    @mYreme
    Author

    So I'll try to get the teensy 3.0.
    is it working fluently with 3.0 and how will i have to flash?
    i will have to search for a HCT to get TxD working at 3,3v to RPi RxD too right?
    Thanks a lot for the help.

  15. 5 remaining items

  16. mYreme commented on Feb 15, 2014

    @mYreme
    Author

    Thank You for the post.
    Here's something I found on a Wiki on the web:
    All ATmega, AT90CAN and AT90PWM have a multiplicator on board, which can process 8 x 8-Bit multiplications in just 2 clockcycles.
    My stick has USB support and 16Mhz Quarz on board.
    Another Wiki says theres no hardware multiplier, I guess You are right ^^

    Maybe You get to have a look this weekend, would be great :)

  17. kriegsman commented on Feb 15, 2014

    @kriegsman
    Member

    Do you have a link for that? I was surprised about the 32u2 myself, which means I might be wrong -- but on the other hand, the compiler IS saying that MUL is unavailable, so who knows!?!

  18. kriegsman commented on Feb 15, 2014

    @kriegsman
    Member

    Hey look at that: no MUL on atmega32u2.
    Ok. Now we know what to fix. Thanks for the supporting evidence! I'll take a look at the code over the weekend for a fix.

  19. mYreme commented on Feb 16, 2014

    @mYreme
    Author

    So it has no MUL what would this mean to the code? Extra corrections for multiplying by code?

  20. kriegsman commented on Feb 16, 2014

    @kriegsman
    Member

    It makes the code larger and slower -- which can affect realtime functions like FastLED.

    If you program only in C/C++, you probably don't care or notice. But if you program in assembly language (much of FastLED is programmed in assembly language), you have to write and maintain two versions of your code: with MUL and without. We already do this. The problem you're seeing is that it's trying to use the MUL version on a chip that has no MUL. We just need to force it to recognize this oddball atmega that doesn't have MUL; all the other ATmegas have it.

  21. mYreme commented on Feb 16, 2014

    @mYreme
    Author

    this is what i thought, that it will affect the speed of the code. wouldn't it be easier to implement the ws2811.h which works in an minimus32 as it is mega32u2 too? just something i was thinking about.

  22. kriegsman commented on Feb 16, 2014

    @kriegsman
    Member

    We already have good no-MUL code that's works, just need to turn it on for this particular chip.
    Patience :)

  23. mYreme commented on Feb 16, 2014

    @mYreme
    Author

    Was just a thought :-) i'll be patient :D

  24. focalintent commented on Feb 16, 2014

    @focalintent
    Contributor

    We also do a lot more than ws2811.h, including arbitrary rgb reordering and inline, 0 extra overhead brightness scaling (and will be doing more, soon). So using ws2811.h isn't even on the radar.

  25. mYreme commented on Feb 17, 2014

    @mYreme
    Author

    please don't take offence, i reall appreciate the work you're doing here. i am just trying to figure out how and why things work and don't :)

    i also included a pinlibrary for the mega32u2 too in the fastpin.h

    #elif defined(AVR_ATmega8U2)
    || defined(AVR_ATmega16U2)
    || defined(AVR_ATmega32U2)
    #include "mega32u2pins.h"

    so this seems to work but i cant compile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions