App is too big & Device Log Windows Problems

#1

Hi;

Code building failed when i try to build it after update “mos version release”. I think the main reis is “App is too big”. Also device log window is not working for me in the last version of “mos.exe”.

I am sharing the last released mos version that I use.

$ mos version
The Mongoose OS command line tool
Version: 2.19.0
Build ID: 20210111-224057/2.19.0-gb8341b5
Update channel: release

`My commant log output is:

...............
CC /data/fwbuild-volumes/2.19.0/apps/REST- 
V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/bt/common/osi/alarm.o

CC /data/fwbuild-volumes/2.19.0/apps/REST- 
V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/bt/common/osi/buffer.o

CC /data/fwbuild-volumes/2.19.0/apps/REST- 
V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/bt/common/osi/thread.o

CC /data/fwbuild-volumes/2.19.0/apps/RESTV0.9/esp32/build_contexts/build_ctx_260287721/build/objs/bt/common/btc/core/btc_task.o

CC /data/fwbuild-volumes/2.19.0/apps/REST- V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/bt/common/btc/core/btc_alarm.o

CC /data/fwbuild- volumes/2.19.0/apps/RESTV0.9/esp32/build_contexts/build_ctx_260287721/build/objs/b 
 t/common/btc/core/btc_manage.o

 GEN   /data/fwbuild-volumes/2.19.0/apps/REST- 
 V0.9/esp32/build_contexts/build_ctx_260287721/build/gen/build_info.c

 GEN   /data/fwbuild-volumes/2.19.0/apps/REST- 
 V0.9/esp32/build_contexts/build_ctx_260287721/build/gen/mg_build_info.c

 CC mg_build_info.c.o

 CC build_info.c.o

 AR /data/fwbuild-volumes/2.19.0/apps/REST- 
 V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/mosapp/libmosapp.a

 make[1]: Leaving directory '/data/fwbuild-volumes/2.19.0/apps/REST- 
 V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/mosapp'

 AR /data/fwbuild-volumes/2.19.0/apps/REST- 
 V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/bt/libbt.a

 make[1]: Leaving directory '/data/fwbuild-volumes/2.19.0/apps/REST- 
 V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/bt'

 Generating esp32.project.ld

 LD /data/fwbuild-volumes/2.19.0/apps/REST- 
 V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/REST-V0.9.elf

 esptool.py v3.0

App size: 1626448 of 1572864 (103%)

App is too big

/data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/deps/modules/mongoose-os/platforms/esp32/Makefile.build:206: recipe for target 'app-bin-check' failed

make: *** [app-bin-check] Error 1

make: *** Waiting for unfinished jobs....

 CP    /data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/deps/ca-bundle/fs/ca.pem -> /data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/fs

CP    /data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/fs/cagrica.crt -> /data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/fs

CP    /data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/fs/index.html -> /data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/fs

CP    /data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/build/gen/conf0.json -> /data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/fs

 MKFS  /usr/local/bin/mkspiffs8 262144 {bs:4096,ps:256,es:4096} /data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/fs -> /data/fwbuild-volumes/2.19.0/apps/REST-V0.9/esp32/build_contexts/build_ctx_260287721/build/objs/fw_temp/fs.img

 FS params: size=262144, bs=4096, ps=256, es=4096

   Adding cagrica.crt: 1363

   Adding index.html: 70

   Adding ca.pem: 31787

   Adding conf0.json: 3

 FS stats : space total=233681, used=35140, free=198541

  make: Leaving directory '/app'

  Error: exit status 2

 /src/cli/build_local.go:697: 

 /src/cli/build_local.go:684: 

 /src/cli/build_local.go:449: 

 /src/cli/build.go:270: 

 /src/cli/build.go:213: 

/src/cli/main.go:198: build failed

Error: /src/cli/build_remote.go:333: build failed

/src/cli/build.go:270: 

/src/cli/build.go:213: 

/src/cli/main.go:198: build failed

I have tried the solutions in the related topics. Some one can help me about “App is too big” problem and “Device log window” problem?

Thank you.

#2

If your app is too big, you can either make it smaller or make the partition bigger.
Make app smaller: do not link libraries you don’t actually need (mos.yml), trim your code and limit debug output, etc.
Make partition bigger: it depends on your platform, there are some recipes around in the forum, basically try to play with the following:

build_vars:
  MGOS_ROOT_FS_SIZE: 131072 #  128KB =  0x20000
  APP_SLOT_SIZE: 1048576    # 1024KB = 0x100000

Check your partition table at boot time (on some code you can actually compile…) and try reducing fs in order to make room for app.
If your device happens to be an ESP32 and you happen to have more than 4MB, there are other recipes around:

build_vars:
  ESP_IDF_SDKCONFIG_OPTS: >
    ${build_vars.ESP_IDF_SDKCONFIG_OPTS}
      CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
      CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
      CONFIG_ESPTOOLPY_FLASHSIZE=16MB
#3

Thank you for responding and leading to me for best way. I increased app slot size and the problem solved. I used this command:

mos build --platform esp32 --build-var APP_SLOT_SIZE=1638400

Thank you.