You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by "David G. Simmons" <sa...@mac.com> on 2017/02/07 14:43:19 UTC

sysint() fails

Having some trouble this morning with the nrf52dk board.

389	    sysinit();
(gdb) n

Program received signal SIGTRAP, Trace/breakpoint trap.
__assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
125	       asm("bkpt");

I've updated both mynewt_nordic and apache-mynewt-core to the latest develop branches, and

int
main(int argc, char **argv)
{
    int rc;

    /* Initialize OS */
    sysinit();

...

Fails at sysinit()

I've built a new bootloader (just in case). I thought maybe it was something I was doing in my app, so I built and loaded core/apps/bleprph and

259	    sysinit();
(gdb) n

Program received signal SIGTRAP, Trace/breakpoint trap.
__assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
125	       asm("bkpt");

So it appears that something is broken for at least the nrf52dk dev board ...

cd repos/apache-mynewt-core/
DSimmons-Pro:apache-mynewt-core dsimmons$ git status -v
On branch develop
Your branch is up-to-date with 'origin/develop'.
cd ../mynewt_nordic/
DSimmons-Pro:mynewt_nordic dsimmons$ git status -v
On branch develop
Your branch is up-to-date with 'origin/develop'.
nothing to commit, working tree clean

dg
--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.
* If you cannot read the PGP.sig attachment, please go to
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.



RE: sysint() fails

Posted by Alan Graves <ag...@deltacontrols.com>.
I too had a heck of a job figuring out what was causing a fatal initialization crash a while back. I believe that  the newt tool was newer than the mynewt code version. Probably due to my mistake of having the wrong git branch. At the time the only application I could get to run was the 'blinky' example. Anything else continually reset with an invalid interrupt dump.

ALan

-----Original Message-----
From: will sanfilippo [mailto:wills@runtime.io] 
Sent: Wednesday, February 08, 2017 11:12 AM
To: dev@mynewt.incubator.apache.org
Subject: Re: sysint() fails

David:

It seems like, from this email, that things are now working for you. Are you still going to vote -1 or are you going to change your vote?


> On Feb 8, 2017, at 5:33 AM, David G. Simmons <sa...@mac.com> wrote:
> 
> 
>> On Feb 7, 2017, at 2:38 PM, marko kiiskila <ma...@runtime.io> wrote:
>> 
>> can you get a backtrace of that crash?
> 
> Sorry, I was not able to get a backtrace ... my shell history didn't go back far enough and I've been playing around with stuff for hours. 
> 
>> 
>> Develop branch and the 1.0.0 beta2 release branches have diverged a 
>> bit, so we should see what this assert() is about.
> 
> I did get the 1.0.0B2 branch installed, and things seem to be better ... at least with the bundled apps. I *did* finally have to completely erase the chip and start over before it all went away.
> 
>> One issue I ran across a month back with nrf52 and sys/reboot 
>> package. The flash area containing FCB was holding some other data. 
>> This was causing fcb_init() on that region to return non-zero. Thereby causing sys/reboot package init to assert() during sysinit().
>> I think I had been playing around with boot loader with was bigger in 
>> size, and had trailing part of my big bootloader in that area.
>> 
>> The way I sorted that out was by erasing the flash, and then 
>> reinstalled bootloader and my app again.
> 
> I will try this as I'm seeing the ADC malfunctioning and getting the 
> same error __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
> 125	       asm("bkpt");
> from an assert()
> 
> ...
> 
> Forgot to hit send yesterday ... And I found the culprit here as well. 
> 
> 
> 
> --
> David G. Simmons
> (919) 534-5099
> Web • Blog • Linkedin • Twitter • GitHub
> /** Message digitally signed for security and authenticity.  
> * If you cannot read the PGP.sig attachment, please go to
>  * http://www.gnupg.com/ Secure your email!!!
>  * Public key available at keyserver.pgp.com **/ ♺ This email uses 
> 100% recycled electrons. Don't blow it by printing!
> 
> There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.
> 
> 


Re: sysint() fails

Posted by will sanfilippo <wi...@runtime.io>.
David:

It seems like, from this email, that things are now working for you. Are you still going to vote -1 or are you going to change your vote?


> On Feb 8, 2017, at 5:33 AM, David G. Simmons <sa...@mac.com> wrote:
> 
> 
>> On Feb 7, 2017, at 2:38 PM, marko kiiskila <ma...@runtime.io> wrote:
>> 
>> can you get a backtrace of that crash?
> 
> Sorry, I was not able to get a backtrace ... my shell history didn't go back far enough and I've been playing around with stuff for hours. 
> 
>> 
>> Develop branch and the 1.0.0 beta2 release branches have diverged a bit, so we
>> should see what this assert() is about.
> 
> I did get the 1.0.0B2 branch installed, and things seem to be better ... at least with the bundled apps. I *did* finally have to completely erase the chip and start over before it all went away.
> 
>> One issue I ran across a month back with nrf52 and sys/reboot package. The flash area
>> containing FCB was holding some other data. This was causing fcb_init() on that region to
>> return non-zero. Thereby causing sys/reboot package init to assert() during sysinit().
>> I think I had been playing around with boot loader with was bigger in size, and
>> had trailing part of my big bootloader in that area.
>> 
>> The way I sorted that out was by erasing the flash, and then reinstalled bootloader
>> and my app again.
> 
> I will try this as I'm seeing the ADC malfunctioning and getting the same error
> __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
> 125	       asm("bkpt");
> from an assert() 
> 
> ...
> 
> Forgot to hit send yesterday ... And I found the culprit here as well. 
> 
> 
> 
> --
> David G. Simmons
> (919) 534-5099
> Web • Blog • Linkedin • Twitter • GitHub
> /** Message digitally signed for security and authenticity.  
> * If you cannot read the PGP.sig attachment, please go to 
>  * http://www.gnupg.com/ Secure your email!!!
>  * Public key available at keyserver.pgp.com
> **/
> ♺ This email uses 100% recycled electrons. Don't blow it by printing!
> 
> There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.
> 
> 


Re: sysint() fails

Posted by "David G. Simmons" <sa...@mac.com>.
> On Feb 7, 2017, at 2:38 PM, marko kiiskila <ma...@runtime.io> wrote:
> 
> can you get a backtrace of that crash?

Sorry, I was not able to get a backtrace ... my shell history didn't go back far enough and I've been playing around with stuff for hours.

> 
> Develop branch and the 1.0.0 beta2 release branches have diverged a bit, so we
> should see what this assert() is about.

I did get the 1.0.0B2 branch installed, and things seem to be better ... at least with the bundled apps. I *did* finally have to completely erase the chip and start over before it all went away.

> One issue I ran across a month back with nrf52 and sys/reboot package. The flash area
> containing FCB was holding some other data. This was causing fcb_init() on that region to
> return non-zero. Thereby causing sys/reboot package init to assert() during sysinit().
> I think I had been playing around with boot loader with was bigger in size, and
> had trailing part of my big bootloader in that area.
> 
> The way I sorted that out was by erasing the flash, and then reinstalled bootloader
> and my app again.

I will try this as I'm seeing the ADC malfunctioning and getting the same error
__assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
125	       asm("bkpt");
from an assert()

...

Forgot to hit send yesterday ... And I found the culprit here as well.



--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.
* If you cannot read the PGP.sig attachment, please go to
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.



Re: sysint() fails

Posted by marko kiiskila <ma...@runtime.io>.
Hi David,

can you get a backtrace of that crash?

Develop branch and the 1.0.0 beta2 release branches have diverged a bit, so we
should see what this assert() is about.

One issue I ran across a month back with nrf52 and sys/reboot package. The flash area
containing FCB was holding some other data. This was causing fcb_init() on that region to
return non-zero. Thereby causing sys/reboot package init to assert() during sysinit().
I think I had been playing around with boot loader with was bigger in size, and
had trailing part of my big bootloader in that area.

The way I sorted that out was by erasing the flash, and then reinstalled bootloader
and my app again.

> On Feb 7, 2017, at 6:43 AM, David G. Simmons <sa...@mac.com> wrote:
> 
> Having some trouble this morning with the nrf52dk board. 
> 
> 389	    sysinit();
> (gdb) n
> 
> Program received signal SIGTRAP, Trace/breakpoint trap.
> __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
> 125	       asm("bkpt");
> 
> I've updated both mynewt_nordic and apache-mynewt-core to the latest develop branches, and 
> 
> int
> main(int argc, char **argv)
> {
>     int rc;
> 
>     /* Initialize OS */
>     sysinit();
>     
> ...
> 
> Fails at sysinit()
> 
> I've built a new bootloader (just in case). I thought maybe it was something I was doing in my app, so I built and loaded core/apps/bleprph and 
> 
> 259	    sysinit();
> (gdb) n
> 
> Program received signal SIGTRAP, Trace/breakpoint trap.
> __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
> 125	       asm("bkpt");
> 
> So it appears that something is broken for at least the nrf52dk dev board ... 
> 
> cd repos/apache-mynewt-core/
> DSimmons-Pro:apache-mynewt-core dsimmons$ git status -v
> On branch develop
> Your branch is up-to-date with 'origin/develop'.
> cd ../mynewt_nordic/
> DSimmons-Pro:mynewt_nordic dsimmons$ git status -v
> On branch develop
> Your branch is up-to-date with 'origin/develop'.
> nothing to commit, working tree clean
> 
> dg
> --
> David G. Simmons
> (919) 534-5099
> Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
> /** Message digitally signed for security and authenticity.  
> * If you cannot read the PGP.sig attachment, please go to 
>  * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
>  * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
> **/
> ♺ This email uses 100% recycled electrons. Don't blow it by printing!
> 
> There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.
> 
> 


Re: sysint() fails

Posted by Christopher Collins <cc...@apache.org>.
On Tue, Feb 07, 2017 at 03:37:47PM -0500, David G. Simmons wrote:
> Ok, now I'm very confused ...
> 
> The newt tool is what is used to BUILD newt apps, etc. The newt-core
> stuff is what the apps are built out of. So what I'm getting here is
> that an out-of-date newt tool will build bad mynewt apps, even if all
> the parts that are used in the app are correct?

The newt tool generates some C code at build time, namely:
    * syscfg.h                  (system configuration)
    * <target>-sysflash.c       (default flash map)
    * <target>-sysinit-app.c    (app system initialization sequence)
    * <target>-sysinit-loader.c (loader system initialization sequence)

It is unfortunate that this dependency exists.  There might be some
smart things that cna be done to replace some of the generated code in
the future.

> If that's correct, I think the newt tool desperately needs a
> 'self-update' command that will update newt itself, and possibly
> detect when newt is out of date, because ... well, having the software
> built by the tool be bad because the tool is out of date is no so good
> and will definitely confuse users sooner rather than later.

Yes, that would certainly be a useful feature.  As an aside, newt does
perform the reverse check: it warns you if a mynewt repo is too old for
your version of newt.  However, the opposite is not done.  It would be
more difficult, as the newt git log is generally not available.

By the way - were you able to try an updated version of newt to see if
you still get the crashes?

Thanks,
Chris

Re: sysint() fails

Posted by "David G. Simmons" <sa...@mac.com>.
Ok, now I'm very confused ...

The newt tool is what is used to BUILD newt apps, etc. The newt-core stuff is what the apps are built out of. So what I'm getting here is that an out-of-date newt tool will build bad mynewt apps, even if all the parts that are used in the app are correct?

If that's correct, I think the newt tool desperately needs a 'self-update' command that will update newt itself, and possibly detect when newt is out of date, because ... well, having the software built by the tool be bad because the tool is out of date is no so good and will definitely confuse users sooner rather than later.

dg

> On Feb 7, 2017, at 11:07 AM, Christopher Collins <cc...@apache.org> wrote:
> 
> Hi David,
> 
> Could your version of the newt tool be out of date?  Some backwards
> compatibility breaking changes were made about two weeks ago.  If that
> isn't the problem, could you grab a backtrace in gdb at the point of the
> crash ("bt" or "where" in gdb)?
> 
> Thanks,
> Chris

--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.
* If you cannot read the PGP.sig attachment, please go to
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.



Re: sysint() fails

Posted by will sanfilippo <wi...@runtime.io>.
Hello David:

I did not attempt to re-test all the apps you mentioned below, but bletiny on the nrf52dk is working just fine.

Another note: the release is on branch 1_0_0_b2_dev. That is the branch I would use, or check out the tag (mynewt_1_0_0_b2_rc1_tag).

Thanks

> On Feb 7, 2017, at 8:07 AM, Christopher Collins <cc...@apache.org> wrote:
> 
> Hi David,
> 
> Could your version of the newt tool be out of date?  Some backwards
> compatibility breaking changes were made about two weeks ago.  If that
> isn't the problem, could you grab a backtrace in gdb at the point of the
> crash ("bt" or "where" in gdb)?
> 
> Thanks,
> Chris
> 
> 
> On Tue, Feb 07, 2017 at 09:43:19AM -0500, David G. Simmons wrote:
>> Having some trouble this morning with the nrf52dk board.
>> 
>> 389	    sysinit();
>> (gdb) n
>> 
>> Program received signal SIGTRAP, Trace/breakpoint trap.
>> __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
>> 125	       asm("bkpt");
>> 
>> I've updated both mynewt_nordic and apache-mynewt-core to the latest develop branches, and
>> 
>> int
>> main(int argc, char **argv)
>> {
>>    int rc;
>> 
>>    /* Initialize OS */
>>    sysinit();
>> 
>> ...
>> 
>> Fails at sysinit()
>> 
>> I've built a new bootloader (just in case). I thought maybe it was something I was doing in my app, so I built and loaded core/apps/bleprph and
>> 
>> 259	    sysinit();
>> (gdb) n
>> 
>> Program received signal SIGTRAP, Trace/breakpoint trap.
>> __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
>> 125	       asm("bkpt");
>> 
>> So it appears that something is broken for at least the nrf52dk dev board ...
>> 
>> cd repos/apache-mynewt-core/
>> DSimmons-Pro:apache-mynewt-core dsimmons$ git status -v
>> On branch develop
>> Your branch is up-to-date with 'origin/develop'.
>> cd ../mynewt_nordic/
>> DSimmons-Pro:mynewt_nordic dsimmons$ git status -v
>> On branch develop
>> Your branch is up-to-date with 'origin/develop'.
>> nothing to commit, working tree clean
>> 
>> dg
>> --
>> David G. Simmons
>> (919) 534-5099
>> Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
>> /** Message digitally signed for security and authenticity.
>> * If you cannot read the PGP.sig attachment, please go to
>> * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
>> * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
>> **/
>> ♺ This email uses 100% recycled electrons. Don't blow it by printing!
>> 
>> There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.
>> 
>> 
> 
> 


Re: sysint() fails

Posted by Christopher Collins <cc...@apache.org>.
Hi David,

Could your version of the newt tool be out of date?  Some backwards
compatibility breaking changes were made about two weeks ago.  If that
isn't the problem, could you grab a backtrace in gdb at the point of the
crash ("bt" or "where" in gdb)?

Thanks,
Chris


On Tue, Feb 07, 2017 at 09:43:19AM -0500, David G. Simmons wrote:
> Having some trouble this morning with the nrf52dk board.
> 
> 389	    sysinit();
> (gdb) n
> 
> Program received signal SIGTRAP, Trace/breakpoint trap.
> __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
> 125	       asm("bkpt");
> 
> I've updated both mynewt_nordic and apache-mynewt-core to the latest develop branches, and
> 
> int
> main(int argc, char **argv)
> {
>     int rc;
> 
>     /* Initialize OS */
>     sysinit();
> 
> ...
> 
> Fails at sysinit()
> 
> I've built a new bootloader (just in case). I thought maybe it was something I was doing in my app, so I built and loaded core/apps/bleprph and
> 
> 259	    sysinit();
> (gdb) n
> 
> Program received signal SIGTRAP, Trace/breakpoint trap.
> __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:125
> 125	       asm("bkpt");
> 
> So it appears that something is broken for at least the nrf52dk dev board ...
> 
> cd repos/apache-mynewt-core/
> DSimmons-Pro:apache-mynewt-core dsimmons$ git status -v
> On branch develop
> Your branch is up-to-date with 'origin/develop'.
> cd ../mynewt_nordic/
> DSimmons-Pro:mynewt_nordic dsimmons$ git status -v
> On branch develop
> Your branch is up-to-date with 'origin/develop'.
> nothing to commit, working tree clean
> 
> dg
> --
> David G. Simmons
> (919) 534-5099
> Web <https://davidgs.com/> \u2022 Blog <https://davidgs.com/davidgs_blog> \u2022 Linkedin <http://linkedin.com/in/davidgsimmons> \u2022 Twitter <http://twitter.com/TechEvangelist1> \u2022 GitHub <http://github.com/davidgs>
> /** Message digitally signed for security and authenticity.
> * If you cannot read the PGP.sig attachment, please go to
>  * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
>  * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
> **/
> \u267a This email uses 100% recycled electrons. Don't blow it by printing!
> 
> There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.
> 
>