HP Forums
Notes crashes the Prime - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Notes crashes the Prime (/thread-3181.html)

Pages: 1 2


Notes crashes the Prime - bobkrohn - 02-23-2015 12:25 AM

I'm programmatically writing to a Notes file.
About half the time (same coding) when I
-go to the Notes file selector
-select the Notes file I wrote to
-click to open

The Prime will reboot.
Sometimes corrupting the Notes file selector with "Chinese" file names and
then I have to to a "Pin Hole" reset.

I have not pinned down any particular behavior that causes it.

Each line is written with a LF char at end.
I thought that "closing" the file with a CR or CR + LF might help.
There are some low number ASCII codes like EOF (End Of File)
Didn't try those yet.
Is there some magic code or technique to properly close the Note?


RE: Notes crashes the Prime - Thomas_Sch - 02-23-2015 09:53 AM

Please have a look at http://www.hpmuseum.org/forum/thread-2575.html?highlight=notes%28, and http://www.hpmuseum.org/forum/thread-2824-post-24424.html#pid24424.
Most visitors are not clairvoyant. Please post yours programs, or almost the relevant parts.


RE: Notes crashes the Prime - bobkrohn - 02-24-2015 03:43 AM

I'm not clairvoyant either.
None of the links you gave had any relevant or helpful information.

I guess I was addressing my question to those that had some experience in accessing the Notes App.
So didn't think there was a need to explain much.
Apparently I am the only person on the planet actually doing much programming with the Prime and the Notes App in particular since anyone doing same would have run into these problems too.
It's a b#%@h being on the leading edge.

The code below "seems" to work.
There is some extra debugging stuff in there.
Unless you have an inquisitive mind and are diligent in testing you would be satisfied.

1-run the program. run it several times. OK
2-open Notes and open the file. OK
3-DELETE the Notes file.
4-run the program. run it several times.
5-the Prime will crash.
6-if it doesn't, open Notes and see gibberish file names.
5-Prime is either locked up or will crash if you try to open the file.

I just did this six times in a row to be sure.
See attached photos of Notes App screen to see gibberish file names that are mysteriously created.
In one there were 3 files that are 16mb of what???
One with no name.
Another screen has two files with basically the same name.
Nobody has seen this before??



PHP Code:
EXPORT MyNote(MyText,NewL,NoteName)
BEGIN

//MyNote(" ABCDE",0,"ABC")

// APPENDS A LINE OF TEXT TO EXISTING OR NEW NOTE

LOCAL i,n,temp,ans;
LOCAL Disp;

LOCAL LF   :=CHAR(10);
LOCAL CR   :=CHAR(13);
LOCAL TAB  :=CHAR(9);
LOCAL NULL :=CHAR(0);

// for debugging from Prgm Editor since it only accepts REAL numbers.
//MyText:="ABCDE";
//NewL:=0;
//NoteName:="ABC";


//  MSGBOX("Continue?",1)▶ans;
 
ans:=1;

IF 
NoteName=="" THEN
 NoteName
:="SampleNote";
END;


  IF 
ans THEN

   
//STUFF GOES HERE
   //--------------V

   
temp:="";

    
// IF NOT EXIST  CREATE
    
IFERR Notes(NoteName)▶temp THEN
     
// need space or Note is not created-Deleted
     // maybe not necessary?
     
Notes(NoteName):=" "
    
END;

    
Notes(NoteName)▶temp;

    IF 
temp==" " THEN
      
// remove space from above 
      
temp:=""
    
END;

    IF 
RIGHT(temp,1)==CR THEN
      
//MSGBOX("Found CR");
      // thought CR might be the problem 
      
temp:=LEFT(temp,DIM(temp)-1);
    
END;

//-------user wants new line

    
IF NewL==AND DIM(temp)≥1 THEN 
     
//MSGBOX(DIM(temp));
     
temp:=temp LF MyText;
    ELSE

     
temp:=temp MyText;

    
END;
   
    
// if was to be last line
    // thought CR might "close" file
    
Notes(NoteName):=temp CR;


  ELSE
   
MSGBOX("Aborted!");
  RETURN 
0
  
END;


RETURN 
1;

//-----
END



RE: Notes crashes the Prime - Joe Horn - 02-24-2015 04:40 AM

bobkrohn -- Sorry to ask the obvious question, but are you running firmware rev 6975 (the most recent revision at the time of this posting)? The memory corruptions you're experiencing sounds to me very similar to corruptions caused by bugs which were eliminated by the more recent upgrades.

If you are in fact running rev 6975, another possibility might be cascading memory corruption. In other words, once memory is corrupted by a bug, ANYTHING (even non-buggy operations) can further corrupt memory. To eliminate that possibility, you have to perform a total memory wipe to start with a clean slate. Please try that, and see if Notes continues to misbehave.


RE: Notes crashes the Prime - Thomas_Sch - 02-24-2015 08:27 AM

(02-24-2015 03:43 AM)bobkrohn Wrote:  .. The code below "seems" to work. There is some extra debugging stuff in there.
.. See attached photos of Notes App screen to see gibberish file names that are mysteriously created.
Many thanks for supplying your code and the screen shots. This will make it easier to track down the problems.
Do you get the errors also in the virtual prime, or only on the real hardware?

The indications of Joe in terms of version and memory corruption are very valuable.
Thanks Joe!


RE: Notes crashes the Prime - Han - 02-24-2015 04:10 PM

On my calculator, I cannot seem to duplicate the misbehavior. How many times should I run MyNote prior to and after deleting of the note named "ABC" ?

I did notice an odd behavior in that the notes created by using the Notes("filename") command creates a note that is very small in size. However, if I simply open the file and exit it, then the file size jumps from something like .07kb to .40kb.


RE: Notes crashes the Prime - bobkrohn - 02-24-2015 04:20 PM

Yes I am on rev 6975.

Due to buggy nature of the Emulator/Connectivity Kit I don't do any programming there.
(I'm not doing anything with CAS)

I am forced to do BACKUP/RESTORE at least every day due to the above mentioned bug and apparently other bugs.

This BACKUP/RESTORE exercise was required before I started dealing with Notes.

Another symptom was excessive program compile time, on the order of 1-2 minutes.
This would be "fixed" by BACKUP/RESTORE.
This symptom was also apparently unknown to anyone else.

The "On"+"Symb" reset method does not fix any problems.
Only the "Pin Hole" reset method will allow you to function enough to do a BACKUP/RESTORE.

My suggestion is that on future designs they include a receptacle on the Prime itself to hold a pin type tool. (just kidding)
Actually, a larger hole, big enough to fit a pen point, would be nice.


RE: Notes crashes the Prime - Han - 02-24-2015 04:28 PM

Strangely I did manage to crash the virtual calc (I think). I ran MyNote() like 10-15 times, deleted the note, and then ran MyNote() again another 10-15 times. Nothing appeared out of the ordinary. I was able to continue using the virtual calc. However, when I swapped out applications (e.g. my web browser) and came back to the virtual calc a bit later, tapping on a button presented me with the hour-glass icon, and the virtual calc was hung. Closing out the program and restarted resulted in what appears to be a corrupt state, and I was given a new state. (I had to copy the programs from the other folder into the newly created folder)

Edit: Further testing on the hardware -- still no issues. Testing on the virtual calc results in crashes in a predictable manner, now. I think I may have even found the culprit in the virtual calculator. When you create a note in the virtual calc, a new note file is not created on the PC until a savestate occurs (e.g. by turning off the virtual calc or by closing the program). However, when you delete a note, it takes effect immediately (on the PC side). Thus, deleting the note, creating a new one, and then deleting it again results in a crash because the second attempt to delete will try to also delete the PC file, which doesn't exist yet if no savestate occurred in between. But nevertheless, this is for the virtual calc and not hardware (which, from your posts, I presume is where you are having issues).


RE: Notes crashes the Prime - bobkrohn - 02-24-2015 10:16 PM

(02-24-2015 04:10 PM)Han Wrote:  On my calculator, I cannot seem to duplicate the misbehavior. How many times should I run MyNote prior to and after deleting of the note named "ABC" ?

I did notice an odd behavior in that the notes created by using the Notes("filename") command creates a note that is very small in size. However, if I simply open the file and exit it, then the file size jumps from something like .07kb to .40kb.

All I have to do is run MyNote to create the Note
Delete Note.
run MyNote once after deleting the note to get the crash.
--(after Prime restarts the new Note is not there)
I did it again just now.

I did a RESTORE to see if that fixes anything.
Same behavior.
Only difference was that Prime didn't crash immediately when MyNote was run.
It crashed when I tried to open the new Note in Note Catalog.

Maybe its possible I have a defective calculator???
May try re-install of the Firmware.

Thank you for testing the program and trying to be helpful.


RE: Notes crashes the Prime - bobkrohn - 02-24-2015 10:30 PM

(02-24-2015 04:40 AM)Joe Horn Wrote:  bobkrohn -- Sorry to ask the obvious question, but are you running firmware rev 6975 (the most recent revision at the time of this posting)? The memory corruptions you're experiencing sounds to me very similar to corruptions caused by bugs which were eliminated by the more recent upgrades.

If you are in fact running rev 6975, another possibility might be cascading memory corruption. In other words, once memory is corrupted by a bug, ANYTHING (even non-buggy operations) can further corrupt memory. To eliminate that possibility, you have to perform a total memory wipe to start with a clean slate. Please try that, and see if Notes continues to misbehave.

By "total memory wipe" would doing a RESTORE be adequate?
Or does that bring in old bad stuff?
I think I asked about this somewhere before, how to do a "Factory Reset".
Maybe take the battery out? For how long? (if there is a backup power feature.)
Obvious next question is how to reload all my saved programs if RESTORE does, in fact, "re-infect" the machine.



Thanks for your help.


RE: Notes crashes the Prime - Han - 02-24-2015 10:54 PM

(02-24-2015 10:30 PM)bobkrohn Wrote:  By "total memory wipe" would doing a RESTORE be adequate?
Or does that bring in old bad stuff?
I think I asked about this somewhere before, how to do a "Factory Reset".
Maybe take the battery out? For how long? (if there is a backup power feature.)
Obvious next question is how to reload all my saved programs if RESTORE does, in fact, "re-infect" the machine.

Thanks for your help.

A total memory wipe consists of "formatting" the calculator (this does not affect the firmware at all). This basically puts the calculator back into the "from factory" state. I would not recommend a restore. Instead, I recommend an actual file transfer of only what it is you plan to test. Only then will you know if it's your program causing the issue. Otherwise, as Joe mentioned, your issues may have been the result of something completely unrelated to this program, and this program only makes those issues more readily recognizable (in the form of bad notes).


RE: Notes crashes the Prime - bobkrohn - 02-25-2015 02:04 AM

(02-24-2015 10:54 PM)Han Wrote:  A total memory wipe consists of "formatting" the calculator (this does not affect the firmware at all). This basically puts the calculator back into the "from factory" state. I would not recommend a restore. Instead, I recommend an actual file transfer of only what it is you plan to test. Only then will you know if it's your program causing the issue. Otherwise, as Joe mentioned, your issues may have been the result of something completely unrelated to this program, and this program only makes those issues more readily recognizable (in the form of bad notes).

Do this? Correct?
It's from this Forum and not in User Manual.
Just double checking with you.


1. Press and hold down the 3 keys letters "C", "F" and "O".
2. While holding the CFO keys, use a paperclip into the RESET hole in the back of the Prime.
3. The diagnostic menu will show up and now you can release the CFO keys.
4. From the Menu, use key 4, then key 3, and then Enter. This will reset the calculator to factory defaults.
5. Wait for the next menu and press Esc key and at last the key 9.


RE: Notes crashes the Prime - Joe Horn - 02-25-2015 05:42 AM

(02-25-2015 02:04 AM)bobkrohn Wrote:  Do this? Correct?
It's from this Forum and not in User Manual.
Just double checking with you.

1. Press and hold down the 3 keys letters "C", "F" and "O".
2. While holding the CFO keys, use a paperclip into the RESET hole in the back of the Prime.
3. The diagnostic menu will show up and now you can release the CFO keys.
4. From the Menu, use key 4, then key 3, and then Enter. This will reset the calculator to factory defaults.
5. Wait for the next menu and press Esc key and at last the key 9.

All correct, although you can also do it without a paperclip by replacing just steps 1 and 2 above with the following: Turn off the calculator, press and hold down "C", "F", and "O", then press On. (Continue at step 3 above.)


RE: Notes crashes the Prime - Thomas_Sch - 02-25-2015 07:21 AM

(02-24-2015 04:20 PM)bobkrohn Wrote:  .. Due to buggy nature of the Emulator/Connectivity Kit ..
.. I am forced to do BACKUP/RESTORE at least every day .. and apparently other bugs.
.. Another symptom was excessive program compile time, on the order of 1-2 minutes.
..
&
(02-24-2015 10:16 PM)bobkrohn Wrote:  .. Maybe its possible I have a defective calculator???
My guess: yes.
Contact your seller and/or HP and ask for a replacement.


RE: Notes crashes the Prime - bobkrohn - 02-26-2015 02:14 AM

Called HP Customer Support and had fast and great service.
The guy on the phone took me through all the steps for resetting which I'd already done.

Then we got down to the Factory Reset process.
He sent an email with Username/Password and link to download the Utility program that resets the Firmware. (don't know why the Username/Password is needed)
Using the Connectivity Kit I then reloaded the latest Firmware.

Unfortunately, my crash problem still persists.

I asked about possibility of a defective calculator. He said before doing that he may want to get a copy of the program to test.
Also said he'd never heard of anyone Reading/Writing to Notes as a data transfer technique. So I guess I really am on the leading edge.

So it goes on.

Again, I was very pleased with the help I got from HP.


RE: Notes crashes the Prime - Tim Wessman - 02-26-2015 03:38 AM

Well, I would appreciate the program because we just can't figure out how you could be hitting that same issues continually like you report. Most likely there is something you've stumbled across and I'd love to be able to fix it but without the program it won't really be possible.

If you do give it to them it will end up on my desk in a few days. :-)


RE: Notes crashes the Prime - d b - 02-26-2015 05:13 AM

(02-26-2015 02:14 AM)bobkrohn Wrote:  Called HP Customer Support and had fast and great service.
The guy on the phone took me through all the steps for resetting which I'd already done.
.............(details left out for brevity).............Again, I was very pleased with the help I got from HP.
And then to top it off you get a personal answer here from the head of the calculator group.
We expect this from HP but Bob; you must be livin right.


RE: Notes crashes the Prime - bobkrohn - 02-27-2015 02:15 AM

The fellow's name who I talked to is Paul Lapensee.
Said he was physically located in Niagara Falls.
He sent an email to me saying he ran the program but neglected to say if it caused a crash. Did say that it was being forwarded to someone else.
It still could be a defective machine I have.

Attached another picture showing a Notes file that is supposedly 832MB!

Which brings up another thing I noticed.
ASCII text files that I have Copied/Pasted via Connectivity Kit from PC show up as substantially larger on the Prime.

ex.

ASCII File on PC = 10k

Copy/Paste to my Prime via CK

At first peek in Notes Catalog it shows up as 20k

open the file, just look at it, close it.

Now the Catalog shows it's 57k !! 6 time larger???

There is definitely something wrong with the Notes firmware.


RE: Notes crashes the Prime - bobkrohn - 02-27-2015 06:23 AM

Just ran the MyNote program in the Emulator.

Crash. (See screen shots)

So it probably isn't a defect in the the Prime Calculator itself


RE: Notes crashes the Prime - Thomas_Sch - 02-27-2015 07:11 AM

(02-27-2015 06:23 AM)bobkrohn Wrote:  So it probably isn't a defect in the the Prime Calculator itself
Correct. It also may be defects or results in/from the programs or the data supplied to the Prime.
Every input to a system changes the behavior.
Please keep HP informed like they requested, and wait for the results from HP.