Intermittent system hang during heavy IDE use

60 views
Skip to first unread message

Cube Central

unread,
May 19, 2018, 12:45:54 AM5/19/18
to LiNC80
Howdy all!  

I have seen my LiNC80 SBC1 hang, with no activity on the IDE LED and unresponsive to keyboard input, after running my "Media Mayhem v3" program, attached.

I am using a similar IDE to CF Card adapter to what is pictured on the LiNC80 Tindie page, a StarTech model IDE2CF found here: http://a.co/irCWEv4

This is basically the same program I used to test the IDE Copy issue with the RC2014 that Wayne Warthen solved.  I haven't been able to diagnose why it hangs, but sometimes it will drop out of BASIC to the OS prompt, or a nonsensical error will occur in the running of the program (Syntax Error in 390, for example) after it has run a while.

Warning:  Before running the attached program, image your SD card, as it will write and read to all available partitions (A: - P:)   Please download and run the program on your systems and see if you can replicate the issue.

My procedure to start is simply to power on the LiNC80, type "CPM" to start the OS, and then I go to the "B:" drive, and type:  "MBASIC B:MM3.BAS".

---An example output:---

BASIC-80 Rev. 5.21
[CP/M Version]
Copyright 1977-1981 (C) by Microsoft
Created: 28-Jul-81
29752 Bytes free
Random number seed (-32768 to 32767)? 888
W>K:MM1.DAT   V<K:MM1.DAT   C>D:MM1.DAT   V<D:MM1.DAT    .25 
W>K:MM2.DAT   V<K:MM2.DAT   C>D:MM2.DAT   V<D:MM2.DAT    .75 
W>A:MM3.DAT   V<A:MM3.DAT   C>F:MM3.DAT   V<F:MM3.DAT    1.5 
W>A:MM4.DAT   V<A:MM4.DAT   C>J:MM4.DAT   V<J:MM4.DAT    2.5 
W>I:MM5.DAT   V<I:MM5.DAT   C>L:MM5.DAT   V<L:MM5.DAT    3.75 
W>I:MM6.DAT   V<I:MM6.DAT   C>B:MM6.DAT   V<B:MM6.DAT    5.25 
W>K:MM7.DAT   V<K:MM7.DAT   C>B:MM7.DAT   V<B:MM7.DAT    7 
W>K:MM8.DAT   <hung>

---another last line looked like:---

...
W>I:MM118.DAT V<I:MM118.DAT C>H:MM118.DAT V<H:MM118.DAT  1755.25 
W>H:MM119.DAT ÛOverflow
Overflow
Overflow
Overflow
.... (repeats until I shut off the power)

---another example:---

...
W>N:MM86.DAT  V<N:MM86.DAT  C>F:MM86.DAT  V<F:MM86.DAT   935.25 
W>M:MM87.DAT  V<M:MM87.DAT  C>I:MM87.DAT  
Syntax error in 390
Ok
390 <hung>

---and another:---
...
W>N:MM55.DAT  V<N:MM55.DAT  C>F:MM55.DAT  V<F:MM55.DAT   385 
W>B:MM56.DAT  V<B:MM56.DAT  <hung>

As this system is new, and I'm new to it, I'm not sure if it is the IDE adapter or some other system instability problem.  Tomorrow, I will try running some intensive non-IDE-related programs to see if I can get the system to hang.

As always, your input, suggestions, and comments are welcome, and if there is another test or a modification to my test you would like to see, please don't hesitate to ask.  Cheers!  

    -Randal   (at CubeCentral)
MM3.zip

Cube Central

unread,
May 22, 2018, 11:25:11 PM5/22/18
to LiNC80

An Update for y’all:

 

I think I have the random hanging problem fixed with a couple of changes:

  1. I made sure that the system was getting clean power right at 5.00V ±(0.05%)
  2. I changed the IDE adapter so that it is drawing power from the same source (I can’t use “Pin 20” to do this as it is missing on my adapter) – before the computer had one power supply and the IDE/CF card another.  (I will try another test with a different adapter later this week - I will update this as soon as the current problem is fixed, see below)
  3. I’ve removed all the ICs from the board and gone over it twice with Flux Remover and Isopropyl Alcohol.  There was some residual stickiness on top of some of the IC sockets, so I wanted to re-clean those to be sure the contacts were clear.

 

The system stopped randomly hanging, but other problems persisted, seeming to be something in the program I was using.  Given the same initial conditions, the program’s output would change randomly.  (and, no, it’s not the program, really!)

 

I changed the version of MBASIC I was using from the included Rev. 5.21 to one I used on the RC2014, Rev. 5.29:

----------------------------------------

BASIC-80 Rev. 5.21

[CP/M Version]

Copyright 1977-1981 (C) by Microsoft

Created: 28-Jul-81

29752 Bytes free

----------------------------------------

…vs…..

----------------------------------------

BASIC-85 Rev. 5.29

[CP/M Version]

Copyright 1985-1986    by Microsoft

Created: 28-Jul-85

29752 Bytes free

----------------------------------------

 

This didn’t solve the problem I was having.  Read on: 


After many dozens of hours later, I seem to have chased it down to the STRING$ function not reliably providing the length of string requested.  It would never fail in the same place twice, and I have proof in output logs that it would (randomly?) create, for example, an 88 character string when a 69 character string was asked for.  Beyond frustrated, I changed to manually generating lengths of strings to write, verify and copy files to and from the IDE/CF card.  (using an alternate adapter did not change the results)

 

The next issue was that sometimes the program would generate the incorrect solution to some modulus arithmetic used to create varying content of the test strings and files.  This was so unbelievable that for some time I refused to think it was happening, but after removing all modulus arithmetic, and replacing it with a simple integer counter, it seems to have worked.

 

As Carl Sagan said, “extraordinary claims require extraordinary evidence”, and I hope to be able to provide examples of both issues, untangled from the current program.  Expect example programs highlighting these problems as soon as I am able.  I also will be testing these bugs against my RC2014 system, to see if I can replicate them there.  For now, as far as these being symptoms of some sort of bit-shifting or other type of instability with the LiNC80 SBC1 I cannot say.  


Another day of testing is required but, for now, the test program and SBC1 seem to be behaving normally.  If I don't run across any other surprises, I will post a new version of the "Media Mayhem" program after cleaning up the code.

 

I would like to create a new topic focusing on these issues and my findings, separate from the existing topic, and cross-post it to the RC2014 group.  I’m sure this would be of interest there - especially if I am able to replicate the BASIC function problems on the RC2014 system.  


    -Randal   (at CubeCentral) 

Jon Langseth

unread,
May 24, 2018, 1:28:56 PM5/24/18
to LiNC80
I'm sorry to read about your stability issues, and also glad to see you have resolved a lot of the issues :)

Yes, the LiNC80 SBC1 requires a fairly stable and noise free voltage supply. The CF should also be powered from the same supply. 
It is also important that any IDE cable used for a CF adapter be as short as possible, to avoid loading the data bus and to avoid electrical noise and/or ringing on the data lines.
As mentioned in the assembly guide, a clean board is essential to avoid impedance and also to avoid noise ingress. 

By the way, I am using three of the same adapter as you are. Oddly, two of mine arrived with all 40 pins, and one arrived with pin 20 missing. Possibly just as odd, is that they arrived in this order: 40pins, 39pins, 40pins. So it seems it's not a "revision" thing, but a bit random. I've resolved the missing pin 20 by simply adding it: I took a header pin from a spare connector I had, and soldered it in :) 

We also have a parallel talk going in private mail about other possible sources of hang/stability issues.

I have not read the code of your MM3.BAS, and I don't believe it to be relevant as we are using the Disk BASIC 80 version of MBASIC80, but it may be worth mentioning that for 8k basic-80 only the first two characters are used in variable names, a very common source of "variable collisions" (example, code trying to use two variables called tool$ and today$ would actually be using one, called 'to'. Documentation of this issue is at https://archive.org/stream/BASIC-80_MBASIC_Reference_Manual#page/n7/mode/2up ). I don't think this is the issue you are hitting, but felt the need to mention it while on the topic of BASIC :)

Cube Central

unread,
May 26, 2018, 12:20:07 PM5/26/18
to LiNC80
A quick update for this topic, as it has spawned other posts, I wanted to post a conclusion to this one.

After making modifications to the test program to avoid the previously discussed issues, I am able to conclude that the IDE Interface is stable.  With some caveats.

For these tests I am using a StarTech brand IDE adapter (I have two, and they both test good).  I am powering the adapter from the same source as the SBC1 after some suspicious behavior powering it from a stand-alone supply.  Note that I am not using the power from Pin 20 on the IDE interface for this adapter, as it is missing that pin and I don't trust myself to add it.  I will perform additional testing to verify no issues with the stand-alone supply now that I have a good baseline test.

However, running the same test program on a new adapter I acquired was a disaster.  There was obvious data corruption reading from the drive, as well as random system hangs.  I concluded that there was something wrong with the adapter (I will try it out on the RC2014 later this week to confirm). I have ordered a replacement adapter to see if I can replicate the issues.  That testing will have to wait until it arrives, this weekend or later this week.

Rather than adding to this post, now with its outdated topic, I will create a new Topic outlining the testing of these IDE adapters.  I hope that this is proved helpful or enlightening, and - as always - please do let me know if there is a test you would like to see and I would be happy to perform it.  Cheers!

    -Randal   (at CubeCentral)

Reply all
Reply to author
Forward
0 new messages