Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: VS1053 Adafruit library 'player_simple' example doesn't compile for Teensy 4.1

  1. #1

    VS1053 Adafruit library 'player_simple' example doesn't compile for Teensy 4.1

    I'm trying to use the Adafruit_VS1053 library which is included with Teensyduino 1.56 on a Teensy 4.1. Unfortunately, the player_simple example does not compile, returning these errors:

    Code:
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Adafruit_VS1053\Adafruit_VS1053.cpp: In member function 'void Adafruit_VS1053_FilePlayer::feedBuffer()':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Adafruit_VS1053\Adafruit_VS1053.cpp:218:14: error: 'SREG' was not declared in this scope
       sregsave = SREG;
                  ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Adafruit_VS1053\Adafruit_VS1053.cpp: In constructor 'Adafruit_VS1053::Adafruit_VS1053(int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t)':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Adafruit_VS1053\Adafruit_VS1053.cpp:280:14: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
       clkportreg = portOutputRegister(digitalPinToPort(_clk));
                  ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Adafruit_VS1053\Adafruit_VS1053.cpp:282:15: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
       misoportreg = portInputRegister(digitalPinToPort(_miso));
                   ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Adafruit_VS1053\Adafruit_VS1053.cpp:284:15: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
       mosiportreg = portOutputRegister(digitalPinToPort(_mosi));
                   ^
    The SREG error disappears if I use the latest version of the library from Adafruit (downloaded using the Arduino Library Manager). However, the conversion issues remain.

    The errors disappear if I change the board to a Teensy 3.6, so I'm guessing this is a AVR vs ARM issue - beyond that it's well above my head unfortunately!

    Has anyone tried to port this to a T4.1?

    Otherwise, can anyone recommend another library to use for the VS1053?
    (I'm not using the Adafruit breakout board since we already have an SD reader on the T4.1)

  2. #2
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,405
    Only can answer the SREG issue. I ran into that on another project and it is not supported on the T4.x's. You might want to check this thread
    https://forum.pjrc.com/threads/66728...highlight=sreg

    As for what other library you can use can't help you on that one.

  3. #3
    You are correct, I'm now attempting to use this library which asks you to comment out any references to SREG if using a T4.1.

    The example in this new library does compile but I'm yet to get any audio out of the headphone jack - will post this in a separate topic though.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,788
    Quick followup on this duplicate thread, a solution for using VS1053 with Teensy 4.x can be found here:

    https://forum.pjrc.com/threads/70944...l=1#post311602

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •