These are chat archives for SmingHub/Sming

31st
Jan 2017
vjacob
@vjacob
Jan 31 2017 12:42
Hello, I'm using rBoot to have FOTA working on two roms, using an ESP-12F with 4Mb SPIFFS. The flashing procedure works fine, but I wonder whether the SDK config data (esp_init_data_default.bin) normally done by using the flashinit target uses the correct flash offset when using rBoot. The makefile flashes it @ 0x7c000 white looking at the rBoot wiki should be flashed at 0x3fc000 , the end of last fourth megabyte. How does the system know where to look for this data? I guess it's important since the RF calibration data is stored there as well?
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 13:01
After update SMING today with option ENABLE_CUSTOM_LWIP = 1
make[1]: Entering directory `/c/tools/Sming/Sming/third-party/esp-open-lwip'
xtensa-lx106-elf-gcc -DLWIP_OPEN_SRC -DPBUF_RSV_FOR_WLAN -DEBUF_LWIP -DICACHE_FLASH -Os -Iinclude -Wl,-EL -mlongcalls -mtext-section-literals    -c -o lwip/core/def.o lwip/core/def.c
In file included from include/lwip/arch.h:43:0,
                 from include/lwip/debug.h:35,
                 from include/lwip/opt.h:46,
                 from lwip/core/def.c:39:
include/arch/cc.h:38:21: fatal error: c_types.h: No such file or directory
compilation terminated.
make[1]: *** [lwip/core/def.o] Error 1
make[1]: Leaving directory `/c/tools/Sming/Sming/third-party/esp-open-lwip'
make: *** [compiler/lib/liblwip_open.a] Error 2
slaff
@slaff
Jan 31 2017 14:22
@petrynchyn please talk to @ADiea. What is the SDK that you use?
@vjacob That will be addressed soon...
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 14:26
@slaff ESP8266_NONOS_SDK_V1.5.4_16_05_20
slaff
@slaff
Jan 31 2017 14:26
@petrynchyn Can you try the following for me: Run
cd %SMING_HOME%
rm -rf third-party/esp-open-lwip/
make ENABLE_CUSTOM_LWIP=1
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 14:28
@slaff
C:\WINDOWS\system32>cd %SMING_HOME%

C:\tools\Sming\Sming>rm -rf third-party/esp-open-lwip/

C:\tools\Sming\Sming>make ENABLE_CUSTOM_LWIP=1
Fetching third-party/esp-open-lwip/ ...
fatal: Not a git repository (or any of the parent directories): .git
make: *** [third-party/esp-open-lwip/Makefile.open] Error 128
slaff
@slaff
Jan 31 2017 14:29
Type git -v.
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 14:30
>git -v
Unknown option: -v
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
slaff
@slaff
Jan 31 2017 14:31
Sorry, type: git --version
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 14:32
@slaff C:\tools\Sming\Sming>git --version
git version 2.7.4.windows.1
slaff
@slaff
Jan 31 2017 14:33
Hm... version > 1.8 should work. Strange that your git cannot fetch the submodule. Try then make ENABLE_CUSTOM_LWIP=1 V=1
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 14:35
@slaff
C:\tools\Sming\Sming>make ENABLE_CUSTOM_LWIP=1 V=1
git submodule update --init --recursive third-party/esp-open-lwip/
fatal: Not a git repository (or any of the parent directories): .git
make: *** [third-party/esp-open-lwip/Makefile.open] Error 128
slaff
@slaff
Jan 31 2017 14:36
Ok, now try this
cd C:\tools\Sming\
git submodule update --init --recursive Sming/third-party/esp-open-lwip
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 14:37
@slaff
C:\tools\Sming>git submodule update --init --recursive Sming/third-party/esp-open-lwip
fatal: Not a git repository (or any of the parent directories): .git
slaff
@slaff
Jan 31 2017 14:38
Are you having a git repostiory or you downloaded the ZIP file?
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 14:38
download zip file
slaff
@slaff
Jan 31 2017 14:39
ZIP file is for the latest stable release 3.0.1. Changes from yesterday are from develop
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 14:39
i download develop zip
slaff
@slaff
Jan 31 2017 14:40
Here is what you should do. First backup your own changes and then do this
rm -rf  c:\tools\Sming
cd c:\tools
git clone https://github.com/SmingHub/Sming.git
cd Sming
make ENABLE_CUSTOM_LWIP=1 V=1
Alexander V. Ribchansky
@avr39-ripe
Jan 31 2017 14:40
@slaff :) rm -rf & C:\ :))
slaff
@slaff
Jan 31 2017 14:42
Meanwhile I need volunteers to test SDK 2.0 integration: https://github.com/slaff/Sming/tree/feature/sdk-2.0. Someone adventurous willing to help?
Alexander V. Ribchansky
@avr39-ripe
Jan 31 2017 14:42
@slaff :) NOT !ME ;))
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 14:43
@slaff If my knowledge is enough I will help
Alexander V. Ribchansky
@avr39-ripe
Jan 31 2017 14:43
@slaff ping me how to checkout this feature? 2.0 I mean
slaff
@slaff
Jan 31 2017 14:43
@petrynchyn Please, try the commands that I gave you above.
This will allow you to use the latest development version of Sming
Alexander V. Ribchansky
@avr39-ripe
Jan 31 2017 14:45
@slaff can you provide some small HOW-TO about sdk 2.0 testing?
slaff
@slaff
Jan 31 2017 14:45
@avr39-ripe The usual:
cd /tmp
git clone https://github.com/slaff/Sming.git -n feature/sdk-2.0
cd Sming
export SMING_HOME=/tmp/Sming/Sming
make 
make test
and finally flash one or two of your favourite samples on a real ESP device
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 14:49
@slaff
C:\tools>rm -rf  c:\tools\Sming

C:\tools>git clone https://github.com/SmingHub/Sming.git
Cloning into 'Sming'...
remote: Counting objects: 9333, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 9333 (delta 3), reused 0 (delta 0), pack-reused 9318
Receiving objects: 100% (9333/9333), 31.20 MiB | 324.00 KiB/s, done.
Resolving deltas: 100% (5734/5734), done.
Checking connectivity... done.
Checking out files: 100% (1283/1283), done.

C:\tools>cd Sming

C:\tools\Sming>make ENABLE_CUSTOM_LWIP=1 V=1
make: *** No targets specified and no makefile found.  Stop.

C:\tools\Sming>cd Sming

C:\tools\Sming\Sming>make ENABLE_CUSTOM_LWIP=1 V=1
...
mkdir -p out/build/Libraries/si4432
mkdir -p out/build/third-party/spiffs/src
mkdir -p out/build/gdb
mkdir -p out/firmware
mkdir -p out/firmware/upgrade
make -C third-party/esp-open-lwip/ -f Makefile.open ENABLE_ESPCONN=0 SDK_BASE=" /C/Espressif/ESP8266_SDK" USER_LIBDIR=" /C/tools/sming/Sming/compiler/lib/" all
make[4]: Entering directory `/C/tools/sming/Sming/third-party/esp-open-lwip'
xtensa-lx106-elf-gcc -DLWIP_OPEN_SRC -DPBUF_RSV_FOR_WLAN -DEBUF_LWIP -DICACHE_FLASH -Os -Iinclude -I/C/Espressif/ESP8266_SDK/include -Wl,-EL -mlongcalls -mtext-section-literals    -c -o lwip/core/def.o lwip/core/def.c
make[4]: xtensa-lx106-elf-gcc: Command not found
make[4]: *** [lwip/core/def.o] Error 127
make[4]: Leaving directory `/C/tools/sming/Sming/third-party/esp-open-lwip'
make[3]: *** [compiler/lib/liblwip_open.a] Error 2
make[3]: Leaving directory `/C/tools/sming/Sming'
make[2]: *** [third-party/esp-open-lwip/Makefile.open] Error 2
make[2]: Leaving directory `/C/tools/sming/Sming'
make[1]: *** [third-party/spiffs/makefile] Error 2
make[1]: Leaving directory `/C/tools/sming/Sming'
make: *** [third-party/rboot/Makefile] Error 2
slaff
@slaff
Jan 31 2017 14:51
xtensa-lx106-elf-gcc is not in your path. Make sure to set it. Something like this should work:
set PATH=C:\Espressif\xtensa-lx106-elf\bin;%PATH%
Alexander V. Ribchansky
@avr39-ripe
Jan 31 2017 14:58
@slaff my own app with your feature/skd2.0 + esp-sdk-2.0 + esp-alt-sdk looks like work :)) will test for a while..
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 15:05

@slaff working, thank you for your help, as will Sming develop updates do

rm -rf  c:\tools\Sming
and  git clone https://github.com/SmingHub/Sming.git

?

slaff
@slaff
Jan 31 2017 15:06
No, now you are ready for getting updates. Just do the following:
cd %SMING_HOME
git pull
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 15:17
I hoped that fully work NAT with option ENABLE_CUSTOM_LWIP = 1 but works just as well without it
slaff
@slaff
Jan 31 2017 15:18
@petrynchyn If you are familiar with LWIP then you can tune it as you like.
Alexander V. Ribchansky
@avr39-ripe
Jan 31 2017 15:18
@petrynchyn haha.. in fact it WORKS! :) but you need to recompile lwip with TCP_MSS set to about 1390 instead of 1460
tested by me :)
Alexander V. Ribchansky
@avr39-ripe
Jan 31 2017 15:25

@petrynchyn

in file /Sming/Sming/third-party/esp-open-lwip/include> grep TCP_MSS lwipopts.h
find

#define TCP_MSS                         1460
and change
#define TCP_MSS                         1390
Andriy Petrynchyn
@petrynchyn
Jan 31 2017 15:26
@avr39-ripe Thank you, now try
Curtis Pope
@piperpilot
Jan 31 2017 15:44
hey guys, I was just looking at some of the recent changes trying to catch up. I notice the compatibility matrix on the readme. Why is esp-open-sdk not supported for MACOSX? thats the version I'm using and it seems to be fine
slaff
@slaff
Jan 31 2017 15:45
@piperpilot We can add it - just tell me which version of Mac OS X and are there any "extra" things that need to be done?
Actually we can use esp-open-sdk for testing with SDK 2.0
Curtis Pope
@piperpilot
Jan 31 2017 15:46
OK, cool...I'll double check all of the latest versions...right now I think I stayed with 1.5.0 because there was issues with 1.5.4 will test that and update if there is anything special
ESP-ALT-SDK hasn't been updated in a long time and it seems like kireevco is busy these days and ran into problems
sle118
@sle118
Jan 31 2017 16:31
Hello Everyone. I'm porting a new IR Library to Sming, and my demo program is a Web based IR blaster tuned for a 4mb node mcu boars
for the ones interested, here is the link to the library
trying to run my demo, however, I'm getting junk from the serial port

Boot message looks like this
`ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 25880, room 16
tail 8
chksum 0x94
load 0x3ffe8000, len 884, room 0
tail 4
chksum 0xc7
load 0x3ffe8380, len 10548, room 4
tail 0
chksum 0x95
csum 0x95
csum err
ets_main.c`

thinking this might be caused by having too large code/data in there, but not sure how to interpret the numbers
can someone send me the right direction?
sle118
@sle118
Jan 31 2017 16:37
#Memory / Section info:
------------------------------------------------------------------------------

out/build/app.out:     file format elf32-xtensa-le

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .data         00000374  3ffe8000  3ffe8000  000000e0  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  1 .rodata       00002934  3ffe8380  3ffe8380  00000460  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          000071c0  3ffeacb8  3ffeacb8  00002d98  2**4
                  ALLOC
  3 .irom0.text   0004111e  40209000  40209000  000092b0  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  4 .text         00006515  40100000  40100000  00002d94  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
------------------------------------------------------------------------------
# Generating image...
Generate firmware images successully in folder out/firmware.
Done
# Generating spiffs_bin
Checking for spiffs files
web/build directory exists. Creating out/firmware/spiff_rom.bin
Creating rom 'out/firmware/spiff_rom.bin' of size 0x80000 (524288) bytes.
Adding files in directory 'web/build'.
Added 'wifi-sprites.png' to spiffs (1769 bytes).
Added 'index.html' to spiffs (12168 bytes).
Added 'settings.html' to spiffs (4096 bytes).
Added 'jquery.js.gz' to spiffs (30153 bytes).
Added 'bootstrap.css.gz' to spiffs (15615 bytes).
Added 'style.css' to spiffs (7329 bytes).
out/firmware/spiff_rom.bin---------->0x4C000
Killing Terminal to free /dev/ttyUSB0
/opt/Sming/Sming/Makefile-project.mk:421: recipe for target 'flash' failed
make: [flash] Killed (ignored)
/opt/esp-open-sdk/esptool/esptool.py -p /dev/ttyUSB0 -b 921600 write_flash -ff 40m -fm qio -fs 32m 0x00000 out/firmware/0x00000.bin 0x09000 out/firmware/0x09000.bin 0x4C000 out/firmware/spiff_rom.bin
sle118
@sle118
Jan 31 2017 16:53
@slaff , sorry to bother, but any thoughts on this?
slaff
@slaff
Jan 31 2017 16:54
@sle118 Just run the command /opt/esp-open-sdk/esptool/esptool.py -p /dev/ttyUSB0 -b 921600 write_flash -ff 40m -fm qio -fs 32m 0x00000 out/firmware/0x00000.bin 0x09000 out/firmware/0x09000.bin 0x4C000 out/firmware/spiff_rom.bin separately and see if you get any error messages
sle118
@sle118
Jan 31 2017 16:58
everything seems clean
slaff
@slaff
Jan 31 2017 17:00
Did you receive any output from that command? If yes, paste it here.
sle118
@sle118
Jan 31 2017 17:01
esptool.py v1.2
Connecting...
Running Cesanta flasher stub...
Flash params set to 0x0040
Writing 40960 @ 0x0... 40960 (100 %)
Wrote 40960 bytes at 0x0 in 0.9 seconds (374.0 kbit/s)...
Writing 270336 @ 0x9000... 270336 (100 %)
Wrote 270336 bytes at 0x9000 in 4.4 seconds (489.3 kbit/s)...
Writing 524288 @ 0x4c000... 524288 (100 %)
Wrote 524288 bytes at 0x4c000 in 9.1 seconds (462.8 kbit/s)...
Leaving...
slaff
@slaff
Jan 31 2017 17:01
ok - so the flashing worked like charm.
sle118
@sle118
Jan 31 2017 17:01
correct
and then
python -m serial.tools.miniterm /dev/ttyUSB0 74880
--- Miniterm on /dev/ttyUSB0: 74880,8,N,1 ---
--- Quit: Ctrl+]  |  Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 25880, room 16 
tail 8
chksum 0x94
load 0x3ffe8000, len 884, room 0 
tail 4
chksum 0xc7
load 0x3ffe8380, len 10548, room 4 
tail 0
chksum 0x95
csum 0x95
csum err
ets_main.c
slaff
@slaff
Jan 31 2017 17:07
Most probable reason is that some of the ROMs overwrites content from the others. Calculate where all ROMs start and end
sle118
@sle118
Jan 31 2017 17:07
this is where I get lost
is there a wiki somewhere to guide me?
slaff
@slaff
Jan 31 2017 17:08
For example ROM0 starts at 0x0 and has size 40960. So it will end at: (use python to do the calculation for you: hex(0x0 + 40960) which is 0xa000
Next ROM starts at 0x9000. But 0x9000 is smaller than 0xa000. Again use python: 0x9000 > 0xa000
Which means that the data from ROM0 from address 0x9000 to 0xa000 will be corrupted because the old ROM0 code will be removed.
That is what I think, but I could be wrong.
Double check the calculations for yourself.
sle118
@sle118
Jan 31 2017 17:14
If this is the case, and I think you're right
then is there a way to change the map ?
slaff
@slaff
Jan 31 2017 17:15
There is BUT you should change two things - the linker script and then the addresses in the Makefile.
You can move the start address from 0x9000 to 0xb000, for example. In the linker irom0_0_seg : org = 0x40209000, len = (1M - 0x9000) becames irom0_0_seg : org = 0x4020b000, len = (1M - 0xb000)
In the Makefile-project.mk IMAGE_SDK has to be set to 0xb000 and also the occurances of 0x9000 at the bottom have to be changed.
sle118
@sle118
Jan 31 2017 17:21
ok. Will do
thanks a bunch for your help!
sle118
@sle118
Jan 31 2017 20:55
@slaff , I changed the addresses from both the linker and the make file and got the sketch to work. I did have to ditch the FTP server, though, which I was thinking of using as a channel to load more device Infrared maps. Is there a good writeup somewhere which could explain the memory constraints of the platform and how to look at the memory map to optimize the build?