![]() |
Forum Index : Microcontroller and PC projects : bug in edit. if your program changes to 3,8 f2 black screens lock up?
![]() ![]() |
|||||
Author | Message | ||||
berighteous Senior Member ![]() Joined: 18/07/2020 Location: United StatesPosts: 110 |
It doesn't matter with or without the close. it locks up before the sd card is accessed, at least the light doesn't go on. It seems to lock immediately on f2. |
||||
panky![]() Guru ![]() Joined: 02/10/2012 Location: AustraliaPosts: 1114 |
With a normal (sucessful) F2 close, the SD light goes ON/OFF short pause the ON/OFF, ON/OFF. In a lockup situation, the SD light goes ON/OFF, short pause ON/OFF. That is, there is no third quick flash as happens when a sucessful edit and F2 happens. My test code MODE 3,8 OPEN "cmm2stuff1.bas" FOR INPUT AS #1 END If I play around with comments between MODE and OPEN I can create the fail. Frustratingly, it does not happen every time and I have been unable to determine an EXACT sequence to cause the lockup. ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
berighteous Senior Member ![]() Joined: 18/07/2020 Location: United StatesPosts: 110 |
should be cmm2stuff1.dat, not bas. That would be weird. Does it crash in other modes? Edited 2020-08-24 14:20 by berighteous |
||||
panky![]() Guru ![]() Joined: 02/10/2012 Location: AustraliaPosts: 1114 |
Doesn't really matter what the file is, I don't actually read from it or do anything with it, as long as it exists. In the actual program on the CMM2 I correctly called it a .dat - just a typo when moving to this thread. Have not tried other modes yet. Edit: Mode 1,8 also locks up on F2 after a change. I am using a bigger .dat file now - 270K or so and the lockups happen more frequently. Note: I am NOT reading data in from the file, just opening it. I'm thinking that it may be associated with the SD card - I am using a Sandisk 8GB HC I Micro SD. Will try some other cards when I can find them ![]() Edit 2: With the bigger .dat file (270K), it will lockup every time an edit is made and text is deleted or added and F2 is pressed. MODE 1,8 OPEN "teststuff1.dat" FOR INPUT AS #1 END In the blank line above, I insert or delete the following comment 'junk then press F2 - it will lockup on my machine every time. Edited 2020-08-24 15:41 by panky ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
realmnm![]() Newbie ![]() Joined: 07/07/2020 Location: AustraliaPosts: 34 |
Try not doing the CTRL+C, and try to exit your program normally. I have found that I was locking up the CMM2 quite often if I did a CTRL+C to get out of my program and edit or run again, a couple of cycles of that is all it could handle. If it exits cleanly or with an error, I have no issues with it running, editing etc. for hours. Martin This signature intentionally left blank. |
||||
realmnm![]() Newbie ![]() Joined: 07/07/2020 Location: AustraliaPosts: 34 |
Duplicate post. Martin Edited 2020-08-24 15:35 by realmnm This signature intentionally left blank. |
||||
panky![]() Guru ![]() Joined: 02/10/2012 Location: AustraliaPosts: 1114 |
... last from me tonight - have to go and light the fire for our evening meal. Pressing F1 to save then RUN never fails. PS. Not using Ctrl C at all. Edited 2020-08-24 15:47 by panky ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
berighteous Senior Member ![]() Joined: 18/07/2020 Location: United StatesPosts: 110 |
you have to be able to ctrl-c out of any program. It's like a selling feature of basic. If that causes the problem, it's a bug. Edited 2020-08-24 16:55 by berighteous |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
The bug is caused by not closing the data file. I can replicate the bug and have fixed it by closing all files when ctrl-C is pressed. I'll include the fix in the next beta |
||||
berighteous Senior Member ![]() Joined: 18/07/2020 Location: United StatesPosts: 110 |
But in the game I'm writing I close every data file after I read it. I run the program. It ends and when I edit and make any edits and f2 it locks up. The program in it's run closes every file. There is no ctrl-c. When I edit the file immediately after it finishes running, no ctrl-c and I type anything like a space and hit f2 to save and run it locks up immediately before any files are read. Nothing happens black. Edited 2020-08-24 17:47 by berighteous |
||||
berighteous Senior Member ![]() Joined: 18/07/2020 Location: United StatesPosts: 110 |
I'm open #1 then close #1 then open #1 for the next data file then close #1 then open #1 for the next data file etc until all are loaded and I close #1 the last time then the main program loop happens for 500 frames and then it ends with an end before misc subroutines. Is close not closing? |
||||
capsikin Guru ![]() Joined: 30/06/2020 Location: AustraliaPosts: 341 |
For me I was doing Ctrl-C and then going into the editor before running it the second time. Does it happen if it's the first time you run the program after turning on, or if you otherwise haven't previously used Ctrl-C? (clarification update - so the file could still be open from the first time I ran the program, and hanging the second time I ran it) Edited 2020-08-24 18:03 by capsikin |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
I've fixed the bug in the test program you posted above. If you think there is a different bug where no files are left unclosed (including music) please try and produce a simple program that demonstrates it. Bug fixed hack version attached CMM2V1.5.zip |
||||
berighteous Senior Member ![]() Joined: 18/07/2020 Location: United StatesPosts: 110 |
yes. I have a program that I turn on the maximite, run to an end statement, no ctrl-c, edit, hit space hit f2 and it will lock up. All the files are closed by the end statement. (I've checked 3 times anyway, my 55 year old eyes could have missed one. looking again... lol) I can just hit f2 to run again after it's finished without going to the editor and it runs fine every time. So I dunno. Peter will sort it out, no doubt. |
||||
berighteous Senior Member ![]() Joined: 18/07/2020 Location: United StatesPosts: 110 |
I didn't think about music. I have background wav playing on interrupt repeat. It stops playing at the end of the program... I'll try the new one right now and get back to you... EDIT: Success! (I think - I've tried it a few times and so far so good!) You da man! Edited 2020-08-24 18:34 by berighteous |
||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
I had similar problems with lockup. By experimenting, I found that at least most of them were caused by my use of file I/O to a debug file. I suspect that the hangs are caused by I/O waiting on an interrupt that never happens. Commenting out the file I/O cleared up the hangs. -Bill |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |