Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:20 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CPU exception #6 on Explore-64

Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 02:06am 14 Oct 2018
Copy link to clipboard 
Print this post

I have a 777-line program which, while initializing, dies with a CPU exception #6 error. This is on an Explore-64 with what I think is the latest firmware.

CPU exception #6 (bus error on ifetch) at address 0x3C203B70
Processor restarted

> print mm.ver
5.0409
> print mm.device$
Micromite Plus

It appears to be dying on a PRINT statement. If I comment out that PRINT statement, it dies on the next one. Small programs run without issue.

Here is the program, if anyone can take a look. This previously ran successfully on an E-28 and I've just begun to convert it to the E-64. Some pin numbers could be wrong, but I think it's dying before it gets to their definition or use.

2018-10-14_120622_gh.zip




PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1003
Posted: 03:16am 14 Oct 2018
Copy link to clipboard 
Print this post

I have duplicated your error with MMBasic 5.04.09

CPU exception #6 (bus error on ifetch) at address 0x3C203B70
Processor restarted

It seems to initialise OK with MMbasic 5.04.08 so more invesigation required.

GerryEdited by disco4now 2018-10-15
Latest F4 Latest H7 FotS
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 04:26am 14 Oct 2018
Copy link to clipboard 
Print this post

When you have CPU exception errors, you have to get sneaky to catch the culprit

I added a few PRINT and PAUSE statements to the readHTMLTemplate SUB
  Quote  
SClear htmlBuffer()
PRINT "readHTMLTemplate startx"
PAUSE 3000
FOR i = 1 TO 20
SAddStr htmlBuffer(), A(i)
PRINT "readHTMLTemplate stage "+STR$(i)
PAUSE 3000
NEXT i


OK, I started elsewhere, but that's where I ended up.
The pauses are needed to give the print buffers time to empty before the crash.
The crash occurs on the 4th call to SAddStr. I know nothing about the CSUB so that's as far as I got.

> RUN
~458 14-10-2018 15:20:15
Flash:
31K (30%) Program (802 lines)
1K ( 0%) 6 Embedded C Routines
68K (70%) Free

RAM:
32K (32%) 118 Variables
0K ( 0%) General
65K (68%) Free
DOW: 6 -- ***
DATE: 14-10-2018
TIME: 15:20:15
DS3231 temperature: 999
readHTMLTemplate start
readHTMLTemplate startx
readHTMLTemplate stage 1
readHTMLTemplate stage 2
readHTMLTemplate stage 3


CPU exception #6 (bus error on ifetch) at address 0x3C203B70
Processor restarted

There are a few extra prints in there but the last few tell us where the problem is.

I don't know if its a memory problem or something else.

Jim

Edited by TassyJim 2018-10-15
VK7JH
MMedit
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1003
Posted: 05:32am 14 Oct 2018
Copy link to clipboard 
Print this post

I got down to the same area. Looks like a problem with using the longstring CFunctions after 5.04.08

Once the long string builds up to a length of 881 seems to crash despite its nominal dimension.

Gerry

Latest F4 Latest H7 FotS
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 06:08am 14 Oct 2018
Copy link to clipboard 
Print this post

Congratulations, lizby - it appears you have found a bug.

I have a 1500 line program running on 5.04.09 now, and no problems at all. I am not printing anything other then simple strings though, so the bug must be in the long string handling.
Smoke makes things work. When the smoke gets out, it stops!
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 12:17pm 14 Oct 2018
Copy link to clipboard 
Print this post

Wow. I hadn't expected this kind of response to an obscure problem with a longish program with some lingering chip-shifting issues. I went to bed wondering if it might be a problem with the CFunctions (and not even knowing if it was ok to move them from an MM chip to an MM+--E-28 to E-64).

Thanks, Jim, for the idea of PAUSE statements allowing the PRINT buffers to clear--that had confounded my notion of where the error was occurring--I'll keep that in mind.

Thanks to everyone for investigating. I'll await developments.
Edited by lizby 2018-10-15
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 01:16pm 14 Oct 2018
Copy link to clipboard 
Print this post

Thanks to disco4now's hint in the 5.04.10 Beta thread ("Here is another code snippet that runs OK under 5.04.08 but fails under 5.04.09 and 5.04.10 beta 9"), I flashed 5.04.08 and have successfully gotten past the exception.

So plowing ahead with the conversion from E-28 to E-64, with some changes.

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 05:04am 26 Oct 2018
Copy link to clipboard 
Print this post

I have tracked down this bug and reported the solution in this thread: https://www.thebackshed.com/forum/forum_posts.asp?TID=10720&PN=1&get=last#126794
Geoff Graham - http://geoffg.net
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 02:16pm 26 Oct 2018
Copy link to clipboard 
Print this post

Thank you, Geoff. Long string CFunctions using integers rather than floats tested successfully on the E-64 with V5.04.08. I'll await the next 5.04.10 release rather than re-flashing 5.04.09.


PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025