Hello,
I have to store a list of constants (font for NeoPixel display). The array is not extremely long. I wonder if there is a better way than just defining an array? Especially a way saving memory.
let LETTERS = [
[0x0033333f, 0x33331e0c],
[0x003f6666, 0x3e66663f],
[0x003c6603, 0x0303663c],
...
[0x0063361c, 0x36630000],
[0x1f303e33, 0x33330000],
[0x003f260c, 0x193f0000]
];
In a stand-alone application everything works fine. But when adding AWS + Shadow libs my application crashes. Probably an OOM exception?
The array should not use more than 400 bytes - so not a really huge amount. But perhaps there is a better approach?
Thanks!
[May 19 22:56:23.372] Exception 29 @ 0x4000e1b2, vaddr 0x00000000
[May 19 22:56:23.377] A0: 0x40288c23 A1: 0x3ffff220 A2: 0x00000000 A3: 0x00000000
[May 19 22:56:23.383] A4: 0x0000020c A5: 0x00000000 A6: 0x00000200 A7: 0x00000020
[May 19 22:56:23.388] A8: 0x3ffe83cc A9: 0x00000190 A10: 0x00000000 A11: 0x0000007c
[May 19 22:56:23.394] A12: 0x00000000 A13: 0x0000020c A14: 0x00000000 A15: 0x3fffae7c
[May 19 22:56:23.400]
[May 19 22:56:23.400] (exc SP: 0x3ffff080)
[May 19 22:56:23.400]
[May 19 22:56:23.402] --- BEGIN CORE DUMP ---
[May 19 22:56:23.402] mos: catching core dump
[May 19 22:56:26.247] ....
[May 19 22:56:34.953] ---- END CORE DUMP ----
[May 19 22:56:34.961] mos: wrote to /Users/xxx/Projects/MongooseOS/neopixel/core-neopixel-esp8266-20190519-225634.035405636 (133113 bytes)
[May 19 22:56:34.961] mos: analyzing core dump
Core dump by neopixel/esp8266 1.0 20190519-205546
Using ELF file at: /Users/xxx/Projects/MongooseOS/neopixel/build/objs/neopixel.elf
Using Docker image: docker.io/mgos/esp8266-build:2.2.1-1.5.0-r4
Running docker run --rm -v /Users/xxx/Projects/MongooseOS/neopixel/build/objs/neopixel.elf:/fw.elf -v /Users/xxx/Projects/MongooseOS/neopixel/core-neopixel-esp8266-20190519-225634.035405636:/core -v /Users/xxx/Projects/MongooseOS/neopixel:/Users/xxx/Projects/MongooseOS/neopixel docker.io/mgos/esp8266-build:2.2.1-1.5.0-r4 bash -c /usr/local/bin/serve_core.py --rom=/opt/Espressif/rom/rom.bin --rom_addr=0x40000000 /fw.elf /core & $MGOS_TARGET_GDB /fw.elf -ex 'target remote 127.0.0.1:1234' -ex 'set confirm off' -ex bt -ex quit
GNU gdb (crosstool-NG crosstool-ng-1.22.0-60-g37b07f6f) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-build_pc-linux-gnu --target=xtensa-lx106-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /fw.elf...done.
Found core at 23 - 133140
Mapping DRAM: 98304 @ 0x3ffe8000
Mapping /opt/Espressif/rom/rom.bin at 0x40000000
Mapping /fw.elf .data: 2660 @ 0x3ffe8000
Mapping /fw.elf .rodata: 8 @ 0x3ffe8a64
Mapping /fw.elf .bss: 27056 @ 0x3ffe8a70
Mapping /fw.elf .text: 30129 @ 0x40100000
Mapping /fw.elf .irom0.text: 690387 @ 0x40200010
Loaded core dump from last snippet in /core
Remote debugging using 127.0.0.1:1234
0x4000e1b2 in ?? ()
#0 0x4000e1b2 in ?? ()
#1 0x40288c23 in umm_calloc (num=num@entry=131, item_size=item_size@entry=4)
at /mongoose-os/common/umm_malloc/umm_malloc.c:1732
#2 0x40284994 in calloc (num=num@entry=131, size=size@entry=4)
at /mongoose-os/fw/platforms/esp8266/src/esp_libc.c:80
#3 0x40266595 in mbedtls_mpi_grow (X=X@entry=0x3ffff2b0,
nblimbs=nblimbs@entry=131)
at /data/tmp/mos_prebuild/tmp/mos_libs/mbedtls/mbedtls/library/bignum.c:130
#4 0x40265939 in mbedtls_mpi_copy (X=X@entry=0x3ffff2b0,
Y=Y@entry=0x3ffff944)
at /data/tmp/mos_prebuild/tmp/mos_libs/mbedtls/mbedtls/library/bignum.c:216
#5 0x40265a1d in mbedtls_mpi_div_mpi (Q=Q@entry=0x0, R=R@entry=0x3ffff944,
A=A@entry=0x3ffff944, B=B@entry=0x3fffae7c)
at /data/tmp/mos_prebuild/tmp/mos_libs/mbedtls/mbedtls/library/bignum.c:1563
#6 0x40266a81 in mbedtls_mpi_mod_mpi (R=R@entry=0x3ffff944,
A=A@entry=0x3ffff944, B=B@entry=0x3fffae7c)
at /data/tmp/mos_prebuild/tmp/mos_libs/mbedtls/mbedtls/library/bignum.c:1688
#7 0x40265ef9 in mbedtls_mpi_exp_mod (X=X@entry=0x3ffff9b0,
A=A@entry=0x3ffff9b0, E=E@entry=0x3fffae88, N=N@entry=0x3fffae7c,
_RR=_RR@entry=0x3fffaedc)
at /data/tmp/mos_prebuild/tmp/mos_libs/mbedtls/mbedtls/library/bignum.c:1901