Cannot print with Free Font



  • I am trying to use a FreeFont and the code fails see the code and the error below.
    I have included "Free_Fonts.h"

    #define TEXT "aA MWyz~12"  // Text that will be printed on screen in any font
    #define FF1 &FreeMono9pt7b
    M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
    M5.Lcd.setFreeFont(FF1);
    M5.Lcd.setTextDatum(MC_DATUM);    //Set the alignment of the text
    
    M5.Lcd.drawString(TEXT, 160, 120,
                  GFXFF);  // Print the string name of the font
    

    Backtrace: 0x400fb2cd:0x3ffb26a0 0x400fb9c5:0x3ffb2710 0x400fc506:0x3ffb2770 0x400fd6ed:0x3ffb27c0 0x40106547:0x3ffb27e0 0x4010b7de:0x3ffb2820

    #0 0x400fb2cd:0x3ffb26a0 in TFT_eSPI::drawChar(int, int, unsigned short, unsigned int, unsigned int, unsigned char) at .pio/libdeps/m5stack-core-esp32/M5Stack/src/utility/In_eSPI.cpp:2707
    #1 0x400fb9c5:0x3ffb2710 in TFT_eSPI::drawChar(unsigned short, int, int, unsigned char) at .pio/libdeps/m5stack-core-esp32/M5Stack/src/utility/In_eSPI.cpp:4495
    (inlined by) TFT_eSPI::drawChar(unsigned short, int, int, unsigned char) at .pio/libdeps/m5stack-core-esp32/M5Stack/src/utility/In_eSPI.cpp:4478
    #2 0x400fc506:0x3ffb2770 in TFT_eSPI::drawString(char const*, int, int, unsigned char) at .pio/libdeps/m5stack-core-esp32/M5Stack/src/utility/In_eSPI.cpp:5012
    #3 0x400fd6ed:0x3ffb27c0 in DisplayControllerM5Stack::displayLoadingScreen() at lib/DisplayController/src/DisplayControllerM5Stack.cpp:146
    #4 0x40106547:0x3ffb27e0 in setup() at src/AirconnController.ino:321
    #5 0x4010b7de:0x3ffb2820 in loopTask(void*) at /Users/eduardo/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:42

    ELF file SHA256: 7f04a7cb66e9c6a2

    Rebooting...
    ets Jul 29 2019 12:21:46

    rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff0030,len:1344
    load:0x40078000,len:13836
    load:0x40080400,len:3608
    entry 0x400805f0
    setup 1
    Initializing M5Stack
    Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

    Core 1 register dump:
    PC : 0x400fb2d0 PS : 0x00060c30 A0 : 0x800fb9c8 A1 : 0x3ffb26a0
    A2 : 0x000000a3 A3 : 0x80815c54 A4 : 0x00000000 A5 : 0x3f411c14
    A6 : 0x00000000 A7 : 0x3ffc599c A8 : 0x00000000 A9 : 0x00000001
    A10 : 0x41404040 A11 : 0x00000000 A12 : 0x00000000 A13 : 0x00000000
    A14 : 0x3ffba920 A15 : 0x00000000 SAR : 0x0000001c EXCCAUSE: 0x0000001c
    EXCVADDR: 0x80815c54 LBEG : 0x4008b741 LEND : 0x4008b751 LCOUNT : 0xfffffffd