These are chat archives for SmingHub/Sming

29th
Oct 2015
evanmj
@evanmj
Oct 29 2015 01:45
Can anyone help with a fresh install question?
After working out some duplicate path and what seemed to be permission issues, I got mkdir to stop crashing out
I can build 'SmingFramework' in Eclipse (windows)
but every other project complains: ld.exe cannot find -lsming
evanmj
@evanmj
Oct 29 2015 01:55
LD out/build/app.out c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: cannot find -lsming collect2.exe: error: ld returned 1 exit status make: *** [out/build/app.out] Error 1
evanmj
@evanmj
Oct 29 2015 02:02
If I set my ESP_HOME and SMING_HOME in Makefile-user.mk and then I get: make: * c:/tools/sming/Sming: Invalid request code. Stop.
alonewolfx2
@alonewolfx2
Oct 29 2015 03:38
@evanmj please try to change sming home to c:\tools\Sming\Sming
evanmj
@evanmj
Oct 29 2015 04:04
I get: make: * c:\tools\Sming\Sming: Invalid request code. Stop.
when changing SMING_HOME to 'SMING_HOME = c:\tools\Sming\Sming '
I'm compiling on linux now
maybe I'll have better luck
Thanks.
alonewolfx2
@alonewolfx2
Oct 29 2015 05:27
@evanmj can you try echo %PATH% and share us. propably you are missing some environment on windows
Dmitry Kireev
@kireevco
Oct 29 2015 06:07
alonewolfx2
@alonewolfx2
Oct 29 2015 06:16
@raburton i saw "disable spiffs" option gone in makefile. can i ask why?
zhivko
@zhivko
Oct 29 2015 06:57
Autoflash == flashing without press of reset&prog ?
alonewolfx2
@alonewolfx2
Oct 29 2015 07:16
yep
Richard Antony Burton
@raburton
Oct 29 2015 07:24
@alonewolfx2 which makefile is it missing from?
hreintke
@hreintke
Oct 29 2015 07:25
@evanmj : Did you build the sming library ? It is not included in the package.
alonewolfx2
@alonewolfx2
Oct 29 2015 11:00
@raburton I mean eclipse target
In smingframework
hreintke
@hreintke
Oct 29 2015 14:10
@raburton
Are you in here ?
David
@dmarkey
Oct 29 2015 14:55
Hi, i'm tryin to add hw_timer.c to my build
it seems to be compiling but not linking
CC app/hw_timer.c
C+ app/application.cpp
AR out/build/app_app.a
LD out/build/app.out
out/build/app_app.a(application.o):(.text._Z4initv+0x0): undefined reference to hw_timer_arm(unsigned int)' out/build/app_app.a(application.o): In functioninit()':
/home/dmarkey/Sming/Basic_Blink/app/application.cpp:23: undefined reference to hw_timer_arm(unsigned int)'
collect2: error: ld returned 1 exit status
/home/dmarkey/Sming/Sming/Makefile-project.mk:273: recipe for target 'out/build/app.out' failed
make: * [out/build/app.out] Error 1
anyone any idea how to fix it?
so close to getting hw_timer working :)
David
@dmarkey
Oct 29 2015 15:22
tried putting extern in front the of function to no avail
David
@dmarkey
Oct 29 2015 15:30
it's strange though xtensa-lx106-elf-objdump -x out/build/app_app.a | grep hw_timer_arm has the symbols in there
come special linker flags required while using C symbols?
hreintke
@hreintke
Oct 29 2015 15:36
first thought would be a library not included
David
@dmarkey
Oct 29 2015 15:37
it's there
hreintke
@hreintke
Oct 29 2015 15:38
what do you have in hw_timer.c ?
David
@dmarkey
Oct 29 2015 15:38
xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru out/build/app_app.a out/build/hw_timer/hw_timer.o out/build/app/application.o
/opt/Espressif/esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc -L/home/dmarkey/Sming/Sming/compiler/lib/ -L/opt/Sming/compiler/ld/eagle.app.v6.cpp.ld -nostdlib -u call_user_start -Wl,-static -Wl,--gc-sections -Wl,-Map=out/firmware/firmware.map -Wl,--start-group -lmicro -lmain -lsming out/build/app_app.a -Wl,--end-group -o out/build/app.out
out/build/app_app.a(application.o):(.text._Z4initv+0x0): undefined reference to hw_timer_init(FRC1_TIMER_SOURCE_TYPE, unsigned char)' out/build/app_app.a(application.o):(.text._Z4initv+0x4): undefined reference tohw_timer_arm(unsigned int)'
out/build/app_app.a(application.o): In function init()': /home/dmarkey/Sming/Basic_Blink/app/application.cpp:22: undefined reference tohw_timer_init(FRC1_TIMER_SOURCE_TYPE, unsigned char)'
/home/dmarkey/Sming/Basic_Blink/app/application.cpp:23: undefined reference to hw_timer_arm(unsigned int)'
collect2: error: ld returned 1 exit status
I'm just stepping through the make steps
as you can see, hw_timer.o is included in app_app.a
hreintke
@hreintke
Oct 29 2015 15:41
is there specific reason why you put into xxx.c ?
not sure whether needed/used but did you put
ifdef __cplusplus
extern "C" {
endif
in ?
David
@dmarkey
Oct 29 2015 15:46
hw_timer.c came with the SDK
do i put that in hw_timer.c?
or application.cpp?
or hw_time.h
Richard Antony Burton
@raburton
Oct 29 2015 15:51
@alonewolfx2 disable spiffs option isn't in sming framework any more, there is no longer any conditional code in libsming, if you don't want spiff in your app you just don't use it
@hreintke i'm here
what can i do for you?
hreintke
@hreintke
Oct 29 2015 15:54
@dmarkey
hw_timer.c is an example program not a function.
David
@dmarkey
Oct 29 2015 15:55
it's not, the program at the bottom is a test one thats commecnted out
commented
yesssss

extern "C" {

# include "driver/hw_timer.h"

}

worked
thanks very much
hreintke
@hreintke
Oct 29 2015 16:01
@raburton :
I did an initial integration of arduinojson new release, pushed that to my sming fork.
Afte I pushed I also saw that as a push to sminghub/sming, I did not expect that, that is when I asked if you were there.
When I now go to sminghub/sming I don't see it anymore. Hope it is OK how I did.
David
@dmarkey
Oct 29 2015 16:02
hw_timer working!
success!
David
@dmarkey
Oct 29 2015 16:23
It's not completely accurate
but its pretty predictably accurate
David
@dmarkey
Oct 29 2015 16:35
Actually, after I made my code better, it's accurate to 10+- milleconds
sorry, microseconds of course
alonewolfx2
@alonewolfx2
Oct 29 2015 16:49
@raburton I like spiffs but I can't use spiff and rboot same time on 512k flash that's why I asked that
Btw I still can't compile hwpwm branch
evanmj
@evanmj
Oct 29 2015 16:56
@alonewolfx2 @kireevco Thanks for the help a few hours ago. I'm up and running on Ubuntu 14.10 x86 in a VM using the esp-open-sdk, which I like better anyway. The build of the esp-open-sdk failed on Ubuntu 15 x86_64 so I rolled back to 14. Also, It might be worth a look... the linux instructions seem a bit out of order... the build of Basic_Blinky failed until I went into /opt/Sming/Sming/ and built the framework. That let me build ~/dev/Sming/Basic_Blink, but not any examples with files in the spiffy files/ folder, it would crash out, so I had to go build spiffy in the /opt/Sming/Sming/spiffy folder and all worked well. Also, I am not sure why the spiffy install is listed in the requirements since the source is included and must be built (I tried and failed to simply symlink to it in /usr/local/bin/spiffy). All this comes from this link: https://github.com/SmingHub/Sming/wiki/Linux-Quickstart
David
@dmarkey
Oct 29 2015 17:02
BTW if anyone wants to take my timer code and incorporate it into the Time class feel free
alonewolfx2
@alonewolfx2
Oct 29 2015 17:03
@dmarkey where is it?
Richard Antony Burton
@raburton
Oct 29 2015 17:10
@alonewolfx2 i see
if you don't need spiffs you can disable it at the project level with the same flag, but you don't even need to disable it you can just ignore the default spiff_rom.bin that gets produced
as you have to manually call spiffs_mount now to use spiff, if you don't want to use spiffs you simply don't call that function
alon24
@alon24
Oct 29 2015 17:13
@raburton @robotiko here?I am using basic_rboot, I am trying to do ota and it always downloads rom0, so 2 questions: 1. Can I tell if my rom (currently running) is the same as the rom i am trying to ota from (would help with automatic download for code updates while running), 2. if I use RBOOT_TWO_ROMS it looks for rom1.ld, so I copied rom0.ld to rom1.ld, and it creats just rom0.bin (not rom1.bin) is that ok?
Richard Antony Burton
@raburton
Oct 29 2015 17:15
alon24
@alon24
Oct 29 2015 17:15
@raburton my end goal is to streamline updating my code on my device for dev time (do not care that i got nodemcu , i still want my other devices to work the same way)
well, currently trying with basic_rboot, but would like to move to my project which I designated 1M for code, and 1M (currently 330k) for spiffs
4M chip ofcourse
Richard Antony Burton
@raburton
Oct 29 2015 17:16
ok, you will need different options for the 1m and 4m flashes
with 4mb you can have a whole 1mb for your rom, which means you should use big flash mode
in this case you only have rom0.bin
which can be flashed to two different 1mb blocks of flash on the 4m chip
for 1mb you have to put both roms within the same 1mb block
alon24
@alon24
Oct 29 2015 17:18
my Flash size is 4M
Richard Antony Burton
@raburton
Oct 29 2015 17:18
this means you don't need to use big flash, but must use two rom mode
then you will have rom0.bin and rom1.bin which are linked to different memory addresses
so while you are on a 4m chip you should only have rom0.bin
hreintke
@hreintke
Oct 29 2015 17:19
@dmarkey :
If your hw-timer code is OK and tested feel free to include it in the Timer class and submit a PR. :smile:
alon24
@alon24
Oct 29 2015 17:21
@raburton I am sorry I do not follow, before when i had issues with my code being too big, before I started to lok at ota, u helped me to change my rom0.ld memory part:
MEMORY
{
dport0_0_seg :                        org = 0x3FF00000, len = 0x10
dram0_0_seg :                         org = 0x3FFE8000, len = 0x14000
iram1_0_seg :                         org = 0x40100000, len = 0x8000
irom0_0_seg :                         org = 0x40202010, len = 0xf0000
/*irom0_0_seg :                         org = 0x40202010, len = 0x42000 */
}
and I use (in my project) :
RBOOT_ENABLED ?= 1
## enable big flash support (for multiple roms, each in separate 1mb block of flash)
RBOOT_BIG_FLASH ?= 1
## two rom mode (where two roms sit in the same 1mb block of flash)
#RBOOT_TWO_ROMS  ?= 1
## size of the flash chip
SPI_SIZE        ?= 4M
## output file for first rom (.bin will be appended)
#RBOOT_ROM_0     ?= rom0
## input linker file for first rom
#RBOOT_LD_0      ?= rom0.ld
## these next options only needed when using two rom mode
#RBOOT_ROM_1     ?= rom1
#RBOOT_LD_1      ?= rom1.ld
## size of the spiffs to create
SPIFF_SIZE      ?= 300000
This message was deleted
Richard Antony Burton
@raburton
Oct 29 2015 17:23
i'm not really clear what your problem is, you asked why it always downloads rom0.bin and i explained that with big flash on devices above 1m you only have a rom0.bin, what else do you want to know?
alon24
@alon24
Oct 29 2015 17:24
Sorry, basically I want to know how to set up my code, so that I can:
1. check if the rom on my server is the rom I have now on my device
2. if it is not, update
3. should I then delete the rom from the web server?
David
@dmarkey
Oct 29 2015 17:26
@alonewolfx2 the gh location above
Richard Antony Burton
@raburton
Oct 29 2015 17:26
1) will require your own code, there is no built in way to do that, i suggest a small text file with the version number of the rom in it, and define the version number in your rom, then compare the two values, if the one on the webserver is higher you know you need to update
2) see 1
3) probably not, no
Richard Antony Burton
@raburton
Oct 29 2015 17:43
has anyone tried my hw pwm pr #375 ?
i'm getting fed up of hw pwm
it doesn't seem to work properly with sming, and i need it for my project
Richard Antony Burton
@raburton
Oct 29 2015 17:59
something is conflicting, so i'd be interested to know if anyone else is having any problems
David
@dmarkey
Oct 29 2015 18:01
@raburton perhaps my he timer code can be useful
He
Richard Antony Burton
@raburton
Oct 29 2015 18:17
can't use hw timer and hw pwm at the same time, sdk limitation
i could use it to write my own pwm implementation i suppose
David
@dmarkey
Oct 29 2015 18:19
That's what I'm suggesting
David
@dmarkey
Oct 29 2015 18:25
Youd have to work out the duty cycle of course
Richard Antony Burton
@raburton
Oct 29 2015 19:10
@dmarkey that didn't work! hardware timer never gets called
no wonder libpwm isn't working, that uses hardware timers
Richard Antony Burton
@raburton
Oct 29 2015 19:18
to make the timer ever get called i have to change the timesource to NMI_SOURCE, which is higher prority
and after about 10 seconds of running like that i get a wdt reset
these are basically the same results as i was getting with hw pwm
Richard Antony Burton
@raburton
Oct 29 2015 19:24
i've spent so much time playing with these little devices without getting them to do anything useful, now I actually have a real project for them they don't seem to be up to it
hreintke
@hreintke
Oct 29 2015 19:36
@raburton :
I can do some testing for you in my environment tomorrow
I have windows, espressif sdk 1.3.0 (can also download 1.4.0 but did not work with that before).
xtensa compilers version 5.1.0
If you want me to, just let me know what
Richard Antony Burton
@raburton
Oct 29 2015 19:36
if you can find a magic combination that works please let me know!
is the pr works for others it can be merged, in theory the code is fine, but it doesn't work here on any of my devices, but then neither do hardware timers!
hreintke
@hreintke
Oct 29 2015 19:39
I will take the PR code. Is running the example for some time enough or do I need to do something else
Of course including seeing it actually working
Richard Antony Burton
@raburton
Oct 29 2015 19:39
just need to test that it actually does what it's supposed to to the output pins, and not reset after 10 seconds
the only pin i can get it to work with is 2, i've seen that work ok, but never any other pin and not always 2
hreintke
@hreintke
Oct 29 2015 19:42
OK, will try tomorrow, will share results then.
Have to go now, if you think of something else, just mention here or as remark to the PR
Richard Antony Burton
@raburton
Oct 29 2015 19:42
thanks
Dmitry Kireev
@kireevco
Oct 29 2015 20:52
ok, I was able to build xtensa compiler on mingw
Done!
Compiler is located at /c/Users/User/packages/xtensa-lx106-elf/xtensa-lx106-elf
alon24
@alon24
Oct 29 2015 21:15
is there sscanf in sming?
I am trying to compare versions major, minor,.... (4.2.1.0 style)
?
David
@dmarkey
Oct 29 2015 23:44
@raburton if the he timer isn't called that probably points to a hardware problem?
Hw