Project

General

Profile

Resolved: Analog over wireless/ Unhandled Interrupt 00000003 crash

Added by Remcokortekaas about 1 month ago

Today received 2x JeeNode Zero rev4's!

Tried the first article in the latest series; "Analog over wireless". Now one the JNZ's is fine while the other systematically errors at the same example code (at the moment I'm a total STM32 and Forth NOOB so please bare with me ;-) ) Any clue will be greatly appreciated! :

adc-init  ok.
pa0 adc . 38  ok.
: forever begin cr pa0 adc . 1000 ms again ; forever 

Unhandled Interrupt 00000003 !

Stack: [0 ]  TOS: 0000002A  *>

Calltrace:
00000000 00005285 ( 00005256 + 0000002E ) ct-irq
00000001 FFFFFFF9 
00000002 2000045A ( 2000045A + 00000000 ) forever
00000003 00008000 ( 00007FD0 + 00000030 ) >spi>
00000004 2000045A ( 2000045A + 00000000 ) forever
00000005 00000000 
00000006 FFFFFFFF 
00000007 000047A9 ( 000046D4 + 000000D4 ) interpret
00000008 2000045A ( 2000045A + 00000000 ) forever
00000009 21000000 
0000000A 00004821 ( 000047E8 + 00000038 ) quit

Replies (12)

RE: Analog over wireless - Added by jcw about 1 month ago

Whoa - that's fishy. After plugging it in and connecting - can you enter reset and then try the ADC example?

Oh, also: how is the JNZ connected to your host?

(and PS: I've edited the post, in Markdown, you have to use "```" (three back-ticks) on separate lines to enable code rendering)

RE: Analog over wireless - Added by Remcokortekaas about 1 month ago

fishy indeed.

reset didn't do anything for this problem. I connect through SerPlus' (HyTiny) to the host (Mac OS X)

folie v2.9
fresh embello git clone

RE: Analog over wireless - Added by jcw about 1 month ago

And now it turns out that I can reproduce this bug here...

It's not consistent, but it looks like some sort of power-up initialisation problem.
After that stack trace, if I reset via CTRL-C then the same sequence of commands works as expected.
Could you try this on your unit? I.e.

adc-init
pa0 adc .
: forever begin cr pa0 adc . 1000 ms again ; forever
CTRL-C (or !reset)
adc-init
pa0 adc .
: forever begin cr pa0 adc . 1000 ms again ; forever

RE: Analog over wireless - Added by jcw about 1 month ago

Looks like it's not ADC-related:

[connected to /dev/cu.usbmodemC922C521]
Mecrisp-Stellaris RA 2.3.3 with M0 core for STM32L053C8 by Matthias Koch
64 KB <jz4> 2F350030 ram/flash: 4960 21248 free ok.
: forever begin pa1 io@ drop again ; forever

Unhandled Interrupt 00000003 !

Stack: [0 ]  TOS: 0000002A  *>

Calltrace:
00000000 00005285 ( 00005256 + 0000002E ) ct-irq
00000001 FFFFFFF9
00000002 2000045A ( 2000045A + 00000000 ) forever
[etc]

And it's not consistently repeatable - if it happens, then only after a full power cycle.

RE: Analog over wireless - Added by jcw about 1 month ago

Remco, could you please try the following:

  • plug in JNZ and connect over USB, as before
  • type : a ;
  • then type the rest of the test, i.e. same as above: adc-init, etc.

If that works, please retry a few more times and keep the power OFF for at least 5 seconds in between.

RE: Analog over wireless - Added by Remcokortekaas about 1 month ago

Thanks for investigating.

: a ; forgetram works once-only for my board. After a power cycle (5s) the unit hangs or aborts with the same Unhandled interrupt dump again.

RE: Analog over wireless - Added by jcw about 1 month ago

Ok - as expected. Thanks to your early report, we've figured it out: it's a software issue in Mecrisp.

For now, the quick solution is to enter quit at the keyboard and then 2x <enter> (don't ask...).

You will need to do this once after each power cycle. It's not needed after a soft or hard (ctrl-c) reset.
This workaround is a bit tedious, but it should at least allow you to explore the rest of the system.

I'm now trying to figure out how to resolve this for all pending orders.
Once we come up with a decent solution, I'll report it here.

RE: Analog over wireless - Added by jcw about 1 month ago

For the record: the issue has been tracked down and is now fixed in Mecrisp 2.3.5.

If you have Folie with a proper DTR/RTS setup or use a SerPlus, the JNZ rev4 can be upgraded with a single command:

!u https://raw.githubusercontent.com/jeelabs/embello/master/explore/1608-forth/jz4/jz4-release.hex

Similarly, if you have the JNZ rev3, use this command:

!u https://raw.githubusercontent.com/jeelabs/embello/master/explore/1608-forth/jz3/jz3-release.hex

Here is a transcript of the upgrade, showing the transition from 2.3.3 to 2.3.5:

Mecrisp-Stellaris RA 2.3.3 with M0 core for STM32L053C8 by Matthias Koch
64 KB <jz4> 2F350030 ram/flash: 4960 21248 free ok.
!u https://raw.githubusercontent.com/jeelabs/embello/master/explore/1608-forth/jz4/jz4-release.hex
Fetching... got it, crc:2E43
  44288b .+V31 #0417 R .+W .+E346* writing: 173/173 done.
Mecrisp-Stellaris RA 2.3.5 with M0 core for STM32L053C8 by Matthias Koch
64 KB <jz4> 2F350030 ram/flash: 4960 21248 free ok.

Note that these images include the always.fs, board.fs, and core.fs code, now "standard" on all JNZ's.

RE: Resolved: Analog over wireless/ Unhandled Interrupt 00000003 crash - Added by JohnO about 1 month ago

Is there a similar upgrade for HyTiny & Blue Pill units?

RE: Resolved: Analog over wireless/ Unhandled Interrupt 00000003 crash - Added by jcw about 1 month ago

I've just upgraded all the USB images in suf/ to the latest Mecrisp 2.3.5.

There's now a full build (with the board/core stuff from g6s/), which can be used on all F103 boards:

!u https://raw.githubusercontent.com/jeelabs/embello/master/explore/1608-forth/g6s/g6s-release.hex

Also added a full build (with the board/core stuff from g6u/), for USB-enabling the Blue Pill and HyTiny boards:

!u https://raw.githubusercontent.com/jeelabs/embello/master/explore/1608-forth/g6u/g6u-common.hex

As with the previous builds, the µC needs to be connected over serial with Folie and the proper DTR/RTS hookup.

RE: Resolved: Analog over wireless/ Unhandled Interrupt 00000003 crash - Added by Remcokortekaas about 1 month ago

Do the standard Mecrisp-binaries included in Folie (!u ) also need an update?

RE: Resolved: Analog over wireless/ Unhandled Interrupt 00000003 crash - Added by jcw about 1 month ago

Remcokortekaas wrote:

Do the standard Mecrisp-binaries included in Folie (!u ) also need an update?

Yes. I've been holding off a bit, because of some regressions in the Folie code, which I need to fix before creating a new release.

The 2.10 release is the best one at the moment. And indeed: using !u 3 and !u 6 will still install 2.3.3 binaries. The solution for now is to run Folie from inside 1608-forth/cores/ and use !u f103-mecrisp.bin or !u l052-mecrisp.bin (with latest embello checkout).

    (1-12/12)