SignalK / SensESP

Universal Signal K sensor framework for the ESP32 platform
https://signalk.org/SensESP/
Apache License 2.0
151 stars 81 forks source link

ESP32: Error: The program size is greater than maximum allowed #130

Closed free-x closed 4 years ago

free-x commented 4 years ago

Hi, I am trying to get my ESP32 running with BMP280. Unfortunately firmware gets too big Compiler log can you find in attachment SensESP.txt

Regards free-x

andyrbarrow commented 4 years ago

Same here. Love to know the solution.

ba58smith commented 4 years ago

See the README document, which refers to this platformio.ini file, which addresses the problem: https://github.com/SignalK/SensESP/blob/master/platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
; Un-comment the following if you get an error about
; insufficient memory after compiling and linking:
; board_build.partitions = no_ota.csv

; Un-comment the following if you want more 
; details about runtime errors:
; monitor_filters = esp32_exception_decoder
ba58smith commented 4 years ago

@free-x and @andyrbarrow - please post here the ESP32 board you're using, the line in platformio.ini that identifies it (in my case it's [env:esp32dev]), and whether or not this fixes the problem. If it does, I'll update the README to tell how to do this.

andyrbarrow commented 4 years ago

I changed board to esp32dev and I have the same error.

Executing task in folder SensESPTest: platformio run <

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html PLATFORM: Espressif 32 1.12.2 > Espressif ESP32 Dev Module HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa) PACKAGES:

free-x commented 4 years ago

i have tried following boards

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = https://github.com/SignalK/SensESP.git
monitor_speed = 115200
upload_speed = 115200

[env:az-delivery-devkit-v4]
platform = espressif32
board = az-delivery-devkit-v4
framework = arduino
lib_deps = https://github.com/SignalK/SensESP.git
monitor_speed = 115200
upload_speed = 115200

Both envs failed

ba58smith commented 4 years ago

I should have been more specific. What I wanted you to do was to add this line to the [env:] section of your platformio.ini: board_build.partitions = no_ota.csv. (That's what you'll see as the cure for the insufficient memory error in this file: https://github.com/SignalK/SensESP/blob/master/platformio.ini).

I didn't want you to change the board to esp32dev - I simply asked what board you were using. But now, why don't you tell me exactly what board you're using, by providing a url to where you bought it.(In the meantime, try [env: esp32dev] with the above line added to that section.)

andyrbarrow commented 4 years ago

I added that line to esp32dev and it built successfully.

I'm going to try other devices now. My goal is to get this working with M5StickC. There are some GPIO mapping issues that need to be resolved, but if I can get it working, I think it will be an excellent platform for SensESP.

free-x commented 4 years ago

@ba58smith I interpreted your example

; board_build.partitions = no_ota.csv

for me is this only comment. It's not active option

I'm using AZ-Delivery ( https://www.az-delivery.de/collections/more-products-1/products/esp32-developmentboard)

free-x commented 4 years ago

success. with "board_build.partitions = no_ota.csv"

Another thing: some ESP32 boards doesn't provide LED_BUILTIN My workaround in src/system/led_blinker.cpp

#ifndef LED_BUILTIN
#define LED_BUILTIN 1
#endif

This works with AZ-delivery ESP32

ba58smith commented 4 years ago

I added that line to esp32dev and it built successfully.

I'm going to try other devices now. My goal is to get this working with M5StickC. There are some GPIO mapping issues that need to be resolved, but if I can get it working, I think it will be an excellent platform for SensESP.

I saw an M5Stick a few days ago, but it wasn't clear to me how I would use it. Two of my three ESP8266's have multiple sensors connected, each with a breakout board or a resistor. How would that work with the M5Stick?

ba58smith commented 4 years ago

@ba58smith I interpreted your example

; board_build.partitions = no_ota.csv

for me is this only comment. It's not active option

No, it's not active with the semicolon. But the two lines above tell you to "uncomment the line" (remove the semicolon) if you get an "insufficient memory " error. No matter - it's working now.

ba58smith commented 4 years ago

success. with "board_build.partitions = no_ota.csv"

Another thing: some ESP32 boards doesn't provide LED_BUILTIN My workaround in src/system/led_blinker.cpp

#ifndef LED_BUILTIN
#define LED_BUILTIN 1
#endif

This works with AZ-delivery ESP32

Right. That's why the comments are there in led_blinker.cpp. Did defining your LED_BUILTIN as 1 make an onboard LED flash, or did it just solve the compiler error?

free-x commented 4 years ago

Did defining your LED_BUILTIN as 1 make an onboarding LED flash, or did it just solve the compiler error?

according to documentation for my kit

ba58smith commented 4 years ago

I updated the README to (hopefully) make it clear how to address this issue if necessary for your particular ESP32 board.