Closed marcfon closed 7 years ago
What happens if you comment out the references to aREST (what is that?) and try and compile?
Edit: I removed WiFi include (never used) and the aREST and it compiled ok for me. Are you using the latest versions from this repo for both MD_Parola and MD_MAX72xx libraries?
Yeah, code compiles just fine without aREST. It's somehow the combination of aREST and custom fonts.
There are 3 ways to make this code compile without errors.
Just to be sure I've downloaded the most recent libraries again but the compiler error still remains.
Installed the aREST library and tried to compile your code (without WiFi library include). Compiled with quite a few warnings from the aRest library, but it completed ok. My setup is Arduino IDE 1.8.2, Windows 10, Arduino Uno.
Sketch uses 17760 bytes (55%) of program storage space. Maximum is 32256 bytes. Global variables use 261 bytes (12%) of dynamic memory, leaving 1787 bytes for local variables. Maximum is 2048 bytes.
So I've noticed that it has something to do with the fact that I'm compiling for a ESP8266 board (wemos d1 mini). When I set the board to an Arduino it compiles just fine like you said.
I've tried compiling it using Arduino 1.6.12, 1.8.2 and platformio 2.0.0-beta3 on OSX 10.11.6. It keeps returning this compiler error: fontSysFixedSingle causes a section type conflict with __c
When compiling for the ESP8266 I must include the
You are probably going to need to dig around the libraries and/or google for any issues with PROGMEM with the Wemos.
Thanks for the right pointer @MajicDesigns! I've got it to compile based on this post. To be honest I still don't fully understand what is causing this issue but it's good enough for me now. Now I'll try to assemble a fully functional piece of code and see if it runs as expected.
There are 2 ways to make the code compile.
add this code block.
#ifdef PROGMEM
#undef PROGMEM
#define PROGMEM __attribute__((section(".progmem.data")))
#endif
Change MD_MAX72XX::fontType_t PROGMEM fontSysFixedSingle[] = {};
into MD_MAX72XX::fontType_t __attribute__((section(".progmem.data"))) fontSysFixedSingle[] = {};
sorry to dig up an old issue but I'm having the same problem with a custom font on the ESP8266
const uint8_t DejaVu_Sans_10[] PROGMEM = { //font data};
gives the error
DejaVu_Sans_10 causes a section type conflict with __c
I tried marcfons fix
#ifdef PROGMEM
#undef PROGMEM
#define PROGMEM __attribute__((section(".progmem.data")))
#endif
const uint8_t DejaVu_Sans_10[] __attribute__((section(".progmem.data")))= { //font data};
but I get the same error.
DejaVu_Sans_10 causes a section type conflict with __c
any ideas where to look for a fix?
Issue #1 (closed) here seems to indicate that it will compile ok with the ESP8266. PROGMEM is a defined keyword in the ESP8266 header files.
I'm very new to C++ and mostly program in higher level languages so I'm not sure how good my fix was, but what I did was save my custom font into a separate namespace and then just reference it when i called it into the library .
I then got the same error based on the default font being used by the library (ARIAL_10 I think). I'm too much of a novice to modify a library's namespaces, but I just modified fonts.h in the library and have the default font not save in PROGMEM (SRAM instead). Not efficient, but the best I can figure out right now.
I'm assuming aREST is trying to write to a memory space that the font data is being saved. I'm not sure why though.
It's working though, this is a great library!
Ok. If this is an ongoing problem, please raise a new issue in future so I can track it properly. Thanks.
I'm trying to combine MD_Parola with aREST but it's throwing a compiler error at me. This error is only generated when I enable a custom font. It has to do with the PROGMEM identifier but my arduino knowledge it too limited to understand/fix the issue here. It could very well be that the issue is not caused MD_Parola but by the aREST lib in that case I apologise for posting it here.
This is the full error I'm getting.
The code below isn't doing anything useful but it's the minimum needed to reproduce the compiler error.