-
Notifications
You must be signed in to change notification settings - Fork 69
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
progmem error #1
Comments
Hi. I don't know which version of GCC. I have tried with whatever comes with Dzl On Sun, Apr 27, 2014 at 4:12 AM, bakad notifications@github.com wrote:
|
I just ran into the same problem. Did you solve it bakad? Can you identify it dzlonline ? I'm using arduino 1.6.0 on OSX. Everything else i've tried to compile has worked so far. Will report back if I find a solution. |
I think I've had the same problem, two weeks ago. I've solved it by simply adding the "const" at each var stored in the progmem area, as this page says. About that, I was wondering why The Synth was not "shaped" like a classic library, with — apart for the table, for which I understand the reason — a .h and a .cpp file? |
Many thanks. That makes some sense to me. Perhaps the person who created it is used to a different way of doing things. Perhaps if I learn enough I can get it running like a .h file. Or someone can. Thanks again? |
It seems it can run without problem in that way. All the examples I've tried works without problem, other than the "const" one. And knowing not well the C/C++ language, I wonder why Arduino (and other C/C++ tutorials and how-tos) tell us to create a .h and a .cpp, if it can go with just one... |
Many thanks! Jason Nolan, PhD EDGE Lab
|
Hi, I've got the same errors. 2 years ago I have been tweakening with the library and it was working just perfectly! The compiler gives me back another warning: tables.h:1745:1: waening: narrowing conversion of '245' from 'int' to 'char' inside { } [-Wnarrowing] Is this related with th eprevious one? |
Hi, Since there seems to be no problem at line 1745 in table.h, the problem probably comes from the call to this precise value. So the wrong conversion must be in a function that uses it. |
Hi trosiemetype, I'm sorry I didn't specify. The error occurs in an empty sketch with just the #include synth.h. So is related to library itself |
troisiemetype, declaring the waves tables as const worked to you? |
Yeah, it worked for the problem specified at the top of this issue. But I don't know if it will solve your problem! |
I added const type to the wavetables and I can use the library fine (examples are working great), but still appear this warnings: Someone know why i've got this? It is just to clean it. Thanks |
I think I got it, but not sure: only values above 127 seem to be concerned about that, so maybe try to replace |
Thank you troisiemetype, Thanks again, very useful. |
Is it for sinTable or sawTable? In saw table you've got the same kind of problem: It ranges from 128 to -127, where it should be 127 to -128. Just remove 128 at the beginning and add -128 at the end, it should be ok. |
I have updated the library to accommodate the new way Arduino uses to declare program memory. Regards Dzl |
Thanks troisiemetype, you are right about memory usage, I fix as you suggested. |
When trying to compile some example, I get the following error.
/usr/share/arduino/libraries/synth/tables.h:59:23: error: variable ‘SinTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:319:28: error: variable ‘TriangleTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:579:27: error: variable ‘SquareTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:839:23: error: variable ‘SawTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1099:24: error: variable ‘RampTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1359:25: error: variable ‘NoiseTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1619:19: error: variable ‘Env0’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1753:19: error: variable ‘Env1’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1888:19: error: variable ‘Env2’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:2023:19: error: variable ‘Env3’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
make: *** [.build/uno/src/sketch.o] Error 1
I have avr-gcc 4.7.2 installed on debian. which version of avr-gcc are you using?
Any idea how to fix this?
The text was updated successfully, but these errors were encountered: