<div dir="ltr"><div>I found the cause...We were accidentally erasing it whilst initialising the secure frame code. *facepalm*<br><br></div><div>Once again, thanks for the help.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 28, 2016 at 1:15 PM, Deniz Erbilgin <span dir="ltr"><<a href="mailto:deniz.erbilgin@gmail.com" target="_blank">deniz.erbilgin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>I can't do any testing today, but I've checked our library functions for setting and clearing the key by running them in isolation (on the same device) and they seem to work fine.<br><br></div>The code paths for  setting and clearing the key in our main firmware look fine as well. It seems we're either doing something really stupid somewhere else, or something is interacting poorly.<br><br></div>I'm going to try running the minimum possible config of our firmware that can transmit secure frames and work upwards from there.<br><br></div>Thanks for all the input guys.<br><br></div>Regards,<br><br></div>Deniz<br><div><div><div><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Jun 27, 2016 at 4:45 PM, Joseph Heenan <span dir="ltr"><<a href="mailto:joseph@heenan.me.uk" target="_blank">joseph@heenan.me.uk</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div style="word-wrap:break-word"><br><div><span><blockquote type="cite"><div>On 27 Jun 2016, at 15:01, Deniz Erbilgin <<a href="mailto:deniz.erbilgin@gmail.com" target="_blank">deniz.erbilgin@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div>Hi Joseph,<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">One approach would be first finding a situation where the EEPROM write 
of the key behaves correctly when writing the key (which may be on say, a
 dev board), and then changing variables in the test of the real system 
aiming to make everything the same as the working case until it starts 
working, then we know what breaks it<br></blockquote>I guess this is similar to Adrian's suggestion?<br><br></div></div></div></blockquote></span>Yes, very similar. (Adrian's suggestion is a good first step on this process.)</div><span><div><br><blockquote type="cite"><div><div dir="ltr"><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">I've gone through the docs and 
tried to figure out what is the simplest reproducible situation where 
the key is lost. I'm not sure if that is documented in the wiki or not, 
but couldn't see it, perhaps you can share your thoughts?<br></blockquote>So far, with our current firmware release, writing the key and waiting a bit is enough. I'm still working on finding anything more specific.<br><br></div></div></div></blockquote><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>By the way, I'm not really sure how to structure this properly (as you may have noticed) so I'd be grateful if anyone can point me to a good example to go on, or suggest other things that should be included.<br></div></div></div></blockquote></div><br></span><div>I'd just focus on keeping the very latest understanding clear. I think an iterative debug approach is inevitable.  I'd hope that each time you perform a new test you end up with new information that rules out a number of possible causes. (If you can't figure out what possible cause a particular test rules out, don't bother doing the test!)</div><span><font color="#888888"><div><br></div><div>Joseph</div><div><br></div></font></span></div><br></div></div><span class="">_______________________________________________<br>
OpenTRV-dev mailing list<br>
<a href="mailto:OpenTRV-dev@lists.opentrv.org.uk" target="_blank">OpenTRV-dev@lists.opentrv.org.uk</a><br>
<a href="http://lists.opentrv.org.uk/listinfo/opentrv-dev" rel="noreferrer" target="_blank">http://lists.opentrv.org.uk/listinfo/opentrv-dev</a><br>
<br></span></blockquote></div><br></div>
</blockquote></div><br></div>