Internal error at line 99999 (?!?) on OpenPandora RO 5.20, not on RPI RO5.21
François Vanzeveren (2221) 241 posts |
Hello all I am facing a problem that drives me nuts.
As you can guess, I am running the application under BASIC64 to have floating point precision of 64 bits. The first step is to populate the data block with the simulation parameters entered by the user in the appropriate dialog box.
And I use it as follow:
On raspberrypi RO 5.21, I encounter no error. The application seems to run smoothly. If, in my !Run file, I switch to BASIC (not 64), then the error does not occur! I have no idea how to fix this. Thank you for your help. François |
Holger Palmroth (487) 115 posts |
I expierenced an error with the same unique line number (at least I think it was 99999 and not 9999) on a friend’s BeagleBoard when he tried to play a game I knocked together. But that was (most likely) under the regular BASIC. I was blindy blaming my hand-made sprite plotter at that time. Didn’t investigated further as some rewrite is due anyway to make it Raspberry-friendly. To make it more confusing, the game runs happily on my own BeagleBoard. |
Fred Graute (114) 645 posts |
If data% is word-aligned then data%!6 won’t be which is not allowed on ARMv7 (I’m guessing that’s what the OpenPandora is running). The RPi is probably set to ARMv5 compatibility mode where unaligned accesses are allowed. If you set the RPi to ARMv7 mode you’re likely to get the same error. To get rid of the error you’ll need to rearrange things such that the data is located on a word boundary, or do two byte size reads. |
Steve Drain (222) 1620 posts |
When I read that structure definition my thoughts went straight to the many unaligned locations. Fred suggests that the compatibility mode will be important, but even without that, BASIC VI itself requires floats to be word-aligned. Try storing and reloading a float from an unaligned location and you will not get back what you expect. ;-) I thought I would quote a reference to this, but I could not find one, and I have not even metioned it in my StrongHelp BASIC manual. I must have assumed that it was ‘obvious’. ;-( A little experiment shows that a two-word float is actually stored at the aligned word below the location specified. In that case, some of your data is overwriting other data, in particular the word at data%!6. In BASIC V, the floats are 5 bytes and expected to be byte-aligned, so that will work without problems. |
François Vanzeveren (2221) 241 posts |
Thank you for your help… I am pretty sure this is the problem. I will therefore “word align” my data blocks! Regards François |
Martin Avison (27) 1494 posts |
I think I can explain some of what François and Holger are seeing, but not the aborts! Before Basic v1.54 there was a significant problem when external code was called from Basic using CALL, USR, SYS, or a *command (either directly or using OSCLI), and that code Aborted with Data Transfer, Undefined Instruction or Instruction Fetch. The Error Line (ERL) then given by Basic was often the last line of the program, rather than the Basic line containing the CALL, USR, SYS or *command. This was (1) useless, (2) misleading, and (3) generally frustrating! Basic v1.54 (released about 6 months ago) included some changes to try and return the correct ERL after an abort, and to call the Basic error handler. As part of these changes the ERL was set to -1 if the Basic program address was below the Basic program, or 99999 if above. I could not really see how this would ever happen, so could not improve it! It seems that it is possible to cause it to happen! So, some of the differences you have seen may be because of different versions of Basic. v1.54 was in RO5.19 from sometime in March. I would be very interested to have a copy of a problem program, so I can investigate if there is any way to change 99999 in to a more useful ERL. Please email to my first name at avisoft dot f9 dot co dot uk For further details see the change logs for Basic here |
François Vanzeveren (2221) 241 posts |
Hello @Martin Regards. |