M Mostez Well-Known Member Licensed User Longtime User Jun 13, 2019 #1 Hello, I tried to upload this code example to ESP8266, but I got that error message below, is it about a missing file or is there another method for ESP to include arrays into progmem. Thanks B4R Version: 2.60 Parsing code. (0.00s) Building folders structure. (0.00s) Compiling code. (0.00s) Building project (0.00s) Compiling & deploying Ino project (Generic ESP8266 Module - COM10) Error Loading configuration... Initializing packages... Preparing boards... Verifying... b4r_main.cpp:20:27: error: avr/pgmspace.h: No such file or directory #include <avr/pgmspace.h> ^ compilation terminated. exit status 1
Hello, I tried to upload this code example to ESP8266, but I got that error message below, is it about a missing file or is there another method for ESP to include arrays into progmem. Thanks B4R Version: 2.60 Parsing code. (0.00s) Building folders structure. (0.00s) Compiling code. (0.00s) Building project (0.00s) Compiling & deploying Ino project (Generic ESP8266 Module - COM10) Error Loading configuration... Initializing packages... Preparing boards... Verifying... b4r_main.cpp:20:27: error: avr/pgmspace.h: No such file or directory #include <avr/pgmspace.h> ^ compilation terminated. exit status 1
Erel B4X founder Staff member Licensed User Longtime User Jun 13, 2019 #2 PROGMEM is explained here: https://www.b4x.com/android/forum/threads/using-progmem-to-save-memory.71114/#content This is an Arduino feature. You can remove it quite easily. 1. Remove the #include line. 2. Remove the PROGMEM work. 3. Change the getData implementation: Code: Copy #if C B4R::Object beo1; B4R::Object* getdata(B4R::Object* o) { return beo1.wrapNumber(data[o->toLong()]); } #end if Upvote 0
PROGMEM is explained here: https://www.b4x.com/android/forum/threads/using-progmem-to-save-memory.71114/#content This is an Arduino feature. You can remove it quite easily. 1. Remove the #include line. 2. Remove the PROGMEM work. 3. Change the getData implementation: Code: Copy #if C B4R::Object beo1; B4R::Object* getdata(B4R::Object* o) { return beo1.wrapNumber(data[o->toLong()]); } #end if
M Mostez Well-Known Member Licensed User Longtime User Jun 13, 2019 #3 Thanks so much, worked OK. Sorry if it's a stupid question, data array stored in program memory or RAM? Upvote 0
Thanks so much, worked OK. Sorry if it's a stupid question, data array stored in program memory or RAM?
Erel B4X founder Staff member Licensed User Longtime User Jun 13, 2019 #4 Both. It is loaded into RAM when the program starts. PROGMEM is useful when programming smaller Arduino boards that only have 2k or less RAM. Upvote 0
Both. It is loaded into RAM when the program starts. PROGMEM is useful when programming smaller Arduino boards that only have 2k or less RAM.