Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error: undefined pwm functions? #330

Closed
xoseperez opened this issue Dec 16, 2017 · 10 comments
Closed

Compile error: undefined pwm functions? #330

xoseperez opened this issue Dec 16, 2017 · 10 comments

Comments

@xoseperez
Copy link
Owner

Originally reported by: whosawhatsis (Bitbucket: whosawhatsis, GitHub: whosawhatsis)


I'm getting the following error when I try to compile. Using the latest version on Arduino 1.8.5.

#!error

Archiving built core (caching) in: /var/folders/82/71ylqscs4_z1s93nr8w8cjhh0000gn/T/arduino_cache_155432/core/core_esp8266_esp8266_generic_CpuFrequency_80,FlashFreq_40,FlashMode_dio,UploadSpeed_115200,FlashSize_1M0,ResetMethod_ck,Debug_Disabled,DebugLevel_None_____d69f5bef7e312ded82ee594e779d88ac.a
sketch/espurna.ino.cpp.o: In function `_shadow()':
/Users/who/Downloads/web/xoseperez-espurna-76ad9cde5a74/code/espurna/debug.ino:179: undefined reference to `pwm_set_duty'
/Users/who/Downloads/web/xoseperez-espurna-76ad9cde5a74/code/espurna/debug.ino:179: undefined reference to `pwm_start'
sketch/espurna.ino.cpp.o: In function `_lightProviderUpdate()':
/Users/who/Downloads/web/xoseperez-espurna-76ad9cde5a74/code/espurna/debug.ino:179: undefined reference to `pwm_set_duty'
/Users/who/Downloads/web/xoseperez-espurna-76ad9cde5a74/code/espurna/debug.ino:179: undefined reference to `pwm_start'
sketch/espurna.ino.cpp.o: In function `_lightColorRestore()':
/Users/who/Downloads/web/xoseperez-espurna-76ad9cde5a74/code/espurna/debug.ino:179: undefined reference to `pwm_init'
sketch/espurna.ino.cpp.o: In function `lightSetup()':
/Users/who/Downloads/web/xoseperez-espurna-76ad9cde5a74/code/espurna/debug.ino:179: undefined reference to `pwm_init'
sketch/espurna.ino.cpp.o: In function `std::vector<channel_t, std::allocator<channel_t> >::push_back(channel_t&&)':
/Users/who/Downloads/web/xoseperez-espurna-76ad9cde5a74/code/espurna/debug.ino:179: undefined reference to `pwm_start'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Generic ESP8266 Module.
@xoseperez
Copy link
Owner Author

Mmm... It should be loading the pwm.h file under libs folder...

@xoseperez
Copy link
Owner Author

Original comment by Jonny Davey (Bitbucket: jonny190, GitHub: jonny190):


I'm getting this to, what is the prefered lib to use?

@xoseperez
Copy link
Owner Author

ESPurna uses ESP8266_new_pwm (https://github.com/StefanBruens/ESP8266_new_pwm) by Stefan Bruens. It's basically a drop-in replacement for the SDK pwm.cpp library, it is copied in the libs folder along the header file where the methods are defined.

@xoseperez
Copy link
Owner Author

Original comment by Jonny Davey (Bitbucket: jonny190, GitHub: jonny190):


I can see these file do exist under the lib folder but i'm still geting errors:

Arduino: 1.8.5 (Windows 10), Board: "Generic ESP8285 Module, 80 MHz, 115200, 1M (no SPIFFS)"

Archiving built core (caching) in: C:\Users\jonny\AppData\Local\Temp\arduino_cache_603364\core\core_esp8266_esp8266_esp8285_CpuFrequency_80,UploadSpeed_115200,FlashSize_1M0_89b132b5703b1d0b7393ab53f7a23d9b.a
sketch\espurna.ino.cpp.o: In function `_shadow()':

C:\Users\jonny\OneDrive\Documents2\ESPurna\code\espurna/debug.ino:179: undefined reference to `pwm_set_duty'

C:\Users\jonny\OneDrive\Documents2\ESPurna\code\espurna/debug.ino:179: undefined reference to `pwm_start'

sketch\espurna.ino.cpp.o: In function `_lightProviderUpdate()':

C:\Users\jonny\OneDrive\Documents2\ESPurna\code\espurna/debug.ino:179: undefined reference to `pwm_set_duty'

C:\Users\jonny\OneDrive\Documents2\ESPurna\code\espurna/debug.ino:179: undefined reference to `pwm_start'

sketch\espurna.ino.cpp.o: In function `_lightColorRestore()':

C:\Users\jonny\OneDrive\Documents2\ESPurna\code\espurna/debug.ino:179: undefined reference to `pwm_init'

sketch\espurna.ino.cpp.o: In function `std::vector<channel_t, std::allocator<channel_t> >::push_back(channel_t&&)':

C:\Users\jonny\OneDrive\Documents2\ESPurna\code\espurna/debug.ino:179: undefined reference to `pwm_init'

C:\Users\jonny\OneDrive\Documents2\ESPurna\code\espurna/debug.ino:179: undefined reference to `pwm_start'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Generic ESP8285 Module.

@xoseperez
Copy link
Owner Author

Original comment by Jonny Davey (Bitbucket: jonny190, GitHub: jonny190):


i'm only asking as the strip lights i'm trying to use must have the Red and Blue Swapped over. I'm using magic home RGBW

@xoseperez
Copy link
Owner Author

The Arduino IDE is a pain in the a**. It will work by moving the pwm.c file from "espurna/libs/pwm.c" to "espurna/pwm.c".

@xoseperez
Copy link
Owner Author

Original comment by whosawhatsis (Bitbucket: whosawhatsis, GitHub: whosawhatsis):


With that change, it successfully compiles.

@xoseperez
Copy link
Owner Author

Original comment by Jonny Davey (Bitbucket: jonny190, GitHub: jonny190):


I can confirm this aswell

@xoseperez
Copy link
Owner Author

Released with 1.11.0

@xoseperez
Copy link
Owner Author

Removing milestone: 1.11.0 (automated comment)

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

No branches or pull requests

1 participant