Coder Social home page Coder Social logo

Comments (10)

marcfon avatar marcfon commented on May 28, 2024 1

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.

  1. add this code block.
#ifdef PROGMEM
#undef PROGMEM
#define PROGMEM __attribute__((section(".progmem.data")))
#endif
  1. Change MD_MAX72XX::fontType_t PROGMEM fontSysFixedSingle[] = {}; into MD_MAX72XX::fontType_t __attribute__((section(".progmem.data"))) fontSysFixedSingle[] = {};

from md_parola.

MajicDesigns avatar MajicDesigns commented on May 28, 2024

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?

from md_parola.

marcfon avatar marcfon commented on May 28, 2024

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.

  1. remove aREST (https://github.com/marcoschwartz/aREST)
  2. remove the PROGMEM flag from the custom font declaration
  3. comment out P.setFont(fontSysFixedSingle);

Just to be sure I've downloaded the most recent libraries again but the compiler error still remains.

from md_parola.

MajicDesigns avatar MajicDesigns commented on May 28, 2024

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.

from md_parola.

marcfon avatar marcfon commented on May 28, 2024

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 <ESP8266WiFi.h> library otherwise aRest starts complaining that WifiClient is missing.

from md_parola.

MajicDesigns avatar MajicDesigns commented on May 28, 2024

You are probably going to need to dig around the libraries and/or google for any issues with PROGMEM with the Wemos.

from md_parola.

lain-d avatar lain-d commented on May 28, 2024

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?

from md_parola.

MajicDesigns avatar MajicDesigns commented on May 28, 2024

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.

from md_parola.

lain-d avatar lain-d commented on May 28, 2024

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!

from md_parola.

MajicDesigns avatar MajicDesigns commented on May 28, 2024

Ok. If this is an ongoing problem, please raise a new issue in future so I can track it properly. Thanks.

from md_parola.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.