can't assign String array to PROGMEM?

Status
Not open for further replies.

boxxofrobots

Well-known member
When I try to build this it works fine as is, however if I try to make either of the String tables file miditables.h to PROGMEM I get a compiler error on the next set

In file included from /tmp/arduino_build_451560/sketch/messages.h:1:0,
from /home/brad/Arduino/knobby/knobby.ino:53:
display.h: In function 'void sendmessage(String, float)':
display.h:2: error: chargen causes a section type conflict with mixmsgs
PROGMEM const unsigned char chargen[][12] = {
^
In file included from /home/brad/Arduino/knobby/knobby.ino:13:0:
/tmp/arduino_build_451560/sketch/miditables.h:133:22: note: 'mixmsgs' was declared here
PROGMEM const String mixmsgs[96] = {"Ext In:",

Can someone explain this error to me? I don't understand why it compiles just fine if it's not PROGMEM, but crashes otherwise. An since it's a const, isn't it just in program memory anyway?

Thanks
 

Attachments

  • knobbywhy.zip
    14 KB · Views: 35
Thanks heaps. It's a clue, but using it as below also did not work:

const String midiprompts[64] PROGMEM = {"Main Mix A",

After commenting out the character generator table I tried again and this time the compile ends with

noteFreqs causes a section type conflict with midiprompts

noteFreqs is a table of floats, and midiprompts is the table of strings. It seems like trying to put Strings in the PROGMEM crashes it no matter how I try. Edit: OK I think I get it. Not worth it :)
 
Status
Not open for further replies.
Back
Top