-
If I include my script with
SOURCES+= [path to .c file]
first and call it from the wrapper, it loads the included files (like freertos/FreeRTOS.h) correctly.
But If I try to use CCSOURCES (for cc files, because I am using c++) or SOURCES as well, I cannot include anything there. The "external C" command also not work.
It looks like I cannot include the .c sources in .cc (c++). -
I need the freeRTOS library for my custom firmware extension. The library is already included as an esp-idf component. How can I refer to it? If I simple use:
include " ../../esp-idf/components/freertos/include/freertos/FreeRTOS.h"
the other #includes (from the FreeRTOS.h) break. Obviously it is because the includes root is in my lib folder. Moreover, #include doesn't work either.
My second problems is: If I write my library in c++ (.cc) I also cannot import jspin.h, jsvar.h .... The script doesn't find the files (as a .c script it does).
I would appreciate some help.
Jonas -
-
I am trying to include my own code in the espruino firmware. My code is partly written in c++. But if I try to build it, it failed:
Espruino/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/c++0x_warning.h:32:2: error: error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
I tried several ways to set the -std=c++ flag in the Makefile, but I couldn't resolve it.
(If I mixed something up, I apologize, C is not my native language 😅)
Jonas
-
@Robin
I am sorry. I understand the "Share what you're working on!" a bit like "I need some help with my project".
The existing official espruino boards dont fit my needs (ble and wifi), and therefor the only board I can use is the ESP32.
I thought I could "easily" adapt the smartmatrix library to espruino (save some time), but mabe you are right and I have to dig deeper.@MaBe
Yes I will -
My project: I want to use a 64x64 Led matrix on my esp32. I previously used the smartmatrix libray (https://github.com/pixelmatix/SmartMatrix) with the arduino bootloader. This worked fine. Because of the other parts of my project I switched to Espruino. Currently there is no support for 64x64 Hub75e led matrix by the graphics library of espruino.
I came accross the tutorial to extend the espruino firmware with own c code (https://www.espruino.com/Extending+Espruino+1). I had the idea to include the awesome smartmatrix library to the espruino firmware. Following this tutorial I added my own library to the build (libs/smartmatrix) and include the "SmartMatrix3.c" (inside jswrap_smartmatrix.c) from there. I also added the library to the makefile of the firmware to include it in the build:
Line 576-580 in the Makefile:
DEFINES += -DSMARTMATRIX INCLUDE += -I$(ROOT)/libs/smartmatrix WRAPPERSOURCES += libs/smartmatrix/jswrap_smartmatrix.c
I also managed to include the Arduino.h and pins_arduino.h (smartmatrix uses it)
But If I want to build the firmware with:
source scripts/provision.sh ESP32 make clean && BOARD=ESP32 SMARTMATRIX=1 make
The Build fails! (see Make_output.txt and MatrixCommon.h)
After some research I found out that the MatrixCommon.h maybe get compiled in C not C++. But how can I tell the make command to compile it in c++ ?
You can download the whole output text and project: https://drive.google.com/open?id=1vbG4zvenzEVJQdQchtOwsvJmBxBOPwYP
I dont know If someone understand my problem. Please share your thougts.
-
Yes, you are right! I use Espruino for all other functions.
I could use the Graphics Library and build my own driver, but first I want to try It with smartmatrix. It is an awesome libraray with all the function I need.At the moment I face the problem, that I need the Arduino.h file for the library to work. I fixed the conflicting types error by using the arduino-esp32 builder. But I think, I am not doing It right.
The firmware make crashes with:fatal error: Arduino.h: No such file or directory
Where do I have to include the Arduino Drivers? I used this tutorial:
https://github.com/espruino/Espruino/tree/master/targets/esp32
-
Yes you are right with the headline. I also checked out this projects bevor. You can drive this led matrixes directly by the board (each led individually). I have a 64x64 matix (4.096 leds) with a hub75e interface !
I could write my own driver for this type of ledmatrix, but I first want to try to use an existing library like smartmatrix (https://github.com/pixelmatix/SmartMatrix/).
-
Hello,
I want to drive a 64×64 Ledmatrix (hub75e) with my esp32 via Espruino. Previously I used the smartmatrix library with arduino code.After some research I found no included function, or library to drive my display with Espruino. The article about writing my own C extension kept me thinking about a wrapper for the smartmatrix library. Finally, I successfully added my own module into the Espruino code.
But here is my problem: The smartmatrix library needs the Arduino.h file to work property. There is a tutorial to include the Arduino driver (https://github.com/espruino/Espruino/tree/master/targets/esp32), but the build failures.
My error is: “error: conflicting types for random”. I tried to change some versions (https://github.com/espressif/arduino-esp32/issues/3201), but this generated more errors (maybe I did it wrong).ESP Template:
Toolchain version: esp-2019r2
Compiler version 8.2.0I would appreciate some help.
Jonas -
Ok thanks. The building worked. But after I flashed the firmware to the esp32 this message shows while booting:
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (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:2
load:0x3fff0018,len:4
load:0x3fff001c,len:2668
load:0x40078000,len:7304
load:0x40080000,len:5312
entry 0x40080274
E (530) esp_image: Image length 1395696 doesn't fit in partition length 1376256
E (530) boot: Factory app partition is not bootable
E (530) esp_image: image at 0x160000 has invalid magic byte
E (536) boot: OTA app partition slot 0 is not bootable
E (541) boot: No bootable app partitions in the partition table
Fatal exception (0): IllegalInstruction
epc1=0x400802ba, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0 -
After I runned this (official) code:
# Get the Espruino source code git clone https://github.com/espruino/Espruino.git cd Espruino # Download and set up the toolchain ('source' is important here) source scripts/provision.sh ESP32 # Clean and rebuild make clean && BOARD=ESP32 make
no espruino_esp32.bin was created.
The terminal last output is:cc1: warning: unrecognized command line option '-Wno-expansion-to-defined'
make: *** wait: No child processes. Stop.Jonas
Does anybody have an idea ?