These are chat archives for SmingHub/Sming

22nd
Jan 2016
laurentppol
@laurentppol
Jan 22 2016 00:23
@alonewolfx2 @robotiko looking at "8M" @espressif bbs shows TWO hardware timers
sle118
@sle118
Jan 22 2016 00:45
allright... we need a swap space on the spiffy flash.... anyone up for the challenge ?? :P
laurentppol
@laurentppol
Jan 22 2016 01:24
ups, what about flash lifetime? usually flash is 10k writes then dead
sle118
@sle118
Jan 22 2016 01:25
ups, what about flash lifetime? usually flash is 10k writes then dead
sarcasm doesn't mix well with chat rooms I guess
laurentppol
@laurentppol
Jan 22 2016 01:25
possibly use FRAM (SPI) to save "short writes" then flsh
sle118
@sle118
Jan 22 2016 01:25
I wasn't serious... really
laurentppol
@laurentppol
Jan 22 2016 01:25
ahhh, ok
sle118
@sle118
Jan 22 2016 01:25
:D
I am still a bit frustrated by the inplanned reboot caused by my port of image library
laurentppol
@laurentppol
Jan 22 2016 01:26
looks some kind of memory leak
sle118
@sle118
Jan 22 2016 01:27
not really
laurentppol
@laurentppol
Jan 22 2016 01:27
why not test it on Linux with more tools?
sle118
@sle118
Jan 22 2016 01:27
probably more a stack issue
I have implemented a malloc/realloc/free wrapper
and I am keeping a Vector of pointers used in the process
as well as total heap available
going to test soon with this
but right now even while decoding, this is one of the lowest figure that I am getting
Free heap: 37744
what I am thinking, though, is more like a stack space limitation
but I am unsure how to validate this on RTOS
laurentppol
@laurentppol
Jan 22 2016 01:33
but it sounds crazy to me (noob in C++/Sming) - You get 10k RAM, and "free" shows the same?
maybe it is possible to use C, not C++ for better memory footprint?
laurentppol
@laurentppol
Jan 22 2016 02:27
OK, got my program working on Sming 2.1.1 & SDK 1.4
:)
laurentppol
@laurentppol
Jan 22 2016 02:33
oops, there is MAC (WiFi) change, from Sming 1.4/SDK1.4/3 - Sming 2.1.1/SDK.14
laurentppol
@laurentppol
Jan 22 2016 02:53
or my Live$hit error
sle118
@sle118
Jan 22 2016 03:33
@sle118 can you try to fee wdt i nloop
@alonewolfx2 I didn't understand your comment because watchdog is a new concept to me
I could try that, but i suspect pointer issues just because at some point, a little before resetting, os functions were returning garbage on serial where values would have been formatted by sprintf
Is there anything wrong with the string implementation in Sming?
Should they be avoided?
alonewolfx2
@alonewolfx2
Jan 22 2016 05:31
WDT. alive(); function is feeding wdt. (Watchdog timer) on nonos sdk resetting if anything keeping cpu more than 5 second. Sometimes wdt resetting in the lower time . so can you add this into the draw loop and try if
@sle118
hreintke
@hreintke
Jan 22 2016 08:19
@sle118 : Good to know : In RTOS stack space is much more limited than in the NONOS version.
@sle118 @alonewolfx2 : My opinion so shoot if you want :smile:
I would just build for the RTOS version and leave the NONOS. NONOS support will cease in a not to distant future.
crosofg
@crosofg
Jan 22 2016 12:43
what are the default pins for I2c ins sming?
laurentppol
@laurentppol
Jan 22 2016 12:50
@hreintke is leaving NoNOS a good choice? "RTOS stack space is much more limited", this may make Sming unusable for some applications
robotiko
@robotiko
Jan 22 2016 12:56
@laurentppol nonos is abandonware by espressif decision
Just rtos sdk versions will be released in the future.. So
:)
sle118
@sle118
Jan 22 2016 13:00
ok. So is there a way to test for stack health?
the timer function seems to allow for playing with stack space, but this isn't available in Sming
the library is deep
and has calls that are several levels down
laurentppol
@laurentppol
Jan 22 2016 13:02
@robotiko :(, will they increase RAM size in future chips?
@robotiko what version of SDK should I use with Sming 2.1.1 (non RTOS)?
hreintke
@hreintke
Jan 22 2016 13:59
@sle118 :
Is the timer function you mention one from the library ?
@laurentppol :
I think this is the 4th time I mention to you :worried: Sming and SDK support is in the releasenotes !
sle118
@sle118
Jan 22 2016 15:30
@hreintke xTaskCreate
sle118
@sle118
Jan 22 2016 15:38
Ah... This is an rtos function, not nonos
hreintke
@hreintke
Jan 22 2016 16:01
@sle118 : Indeed xTaskCreate is a native freeRTOS function. (it is not a Timer however).
It is available in the SmingRTOS implementation but be aware the the current status is a port from NONOS and not using tasks. If your library creates tasks we should investigate/understand how the two work together.
sle118
@sle118
Jan 22 2016 16:03
I am using a timer callback to decode jpgs
tasks might be appropriate
but I'll find a way to reduce depth of decoding library to make it more suitabl
e
I am writing code right now to test stack space being used by each function
to find the offender
stay tuned
hreintke
@hreintke
Jan 22 2016 16:12
@sle118 : for now, keep the Timer in. That eases implementation a lot.
If working, and moved to SmingRTOS this might be a good candidate to work on task implementation together.
sle118
@sle118
Jan 22 2016 16:33
Will do. I am trying to get a feel of stack space used by my process. I created a global variable to store address of top level function's local variable. Then I'll use a macro to call static function at each level of the decoder, passing address of one local variable each time. In the static function, I'll subtract current local address from start address and print to serial... Not sure if this approach will work for me but worth a try. The idea being to grab the function that uses the largest local variables and replace with malloc
Or I'll reimplement the logic in a flattened structure to reduce depth
I've had stack overflow issues before... They're hard to diagnose as code looks otherwise good and I found no memory leak after I tracked malloc/free pointer list using a vector
RTOS seems to have 2 mechanisms to trap overflows, one of which I'd a callback handler
hreintke
@hreintke
Jan 22 2016 16:44
@sle118 : yes RTOS has but that needs to be configured during build.
In the SDK there is library containing the build from espressif which does not allow it.
Statement from espressif is : do not compile your own RTOS.
Long time ago (a year ??) I did compile myself with one of the very first RTOS SDK's.
Did not yet try on this SDK
laurentppol
@laurentppol
Jan 22 2016 17:45
@hreintke You may tell I am stupid... can't find (releasenotes for 2.1.1) even with google :| only in appveyor.yml there is something, but for Win and both SDK (1.4/1.5)
hreintke
@hreintke
Jan 22 2016 18:00
@laurentppol : I never say someone is stupid. Just show that you try yourself and ask the question if you cannot find.
https://github.com/SmingHub/Sming/releases
laurentppol
@laurentppol
Jan 22 2016 18:04
ok, but there is mention about SDK versions for 2.0.0, not for 2.1.1. Assume that if there is no word about it LATER, "support for 1.4 1.5" is simply still valid?
so I may use 1.4 or 1.5 at my choice?
hreintke
@hreintke
Jan 22 2016 18:16
Yes, latest version will work with both NONOS SDK version 1.4 & 1.5
hreintke
@hreintke
Jan 22 2016 18:23
And agree, there is no notice on supported SDK in the latest release. Updated release notes.
thx for that.
sle118
@sle118
Jan 22 2016 19:33
@hreintke I have almost completed the image decoding library port to Sming
I resolved reboots by reducing code size
base library allows this by providing "defines" that only select the image formats that are relevant for the required task
how do I initiate a pull request?
alonewolfx2
@alonewolfx2
Jan 22 2016 19:43
@sle118 on Windows or on Linux?
sle118
@sle118
Jan 22 2016 19:53
linux
alonewolfx2
@alonewolfx2
Jan 22 2016 20:27
Clone git repo
Change files
Git commit
sle118
@sle118
Jan 22 2016 20:41
lol
simple enough :D
sle118
@sle118
Jan 22 2016 22:26
you bbeter use a delegate
@robotiko I ended up decoding the jpg only once at init
and only calling display in timer
doesn't reboot anymore
even after displaying 260+times
sle118
@sle118
Jan 22 2016 22:45
so I guess that even if decode+display was fast, it was still too fast for the wdt
I meant Still too slow