FreeEMS Issues - Firmware
View Issue Details
0000817FirmwareCalculations (Inj/Ign)public2013-01-22 08:282014-02-18 23:05
Fred 
Fred 
normalminorsometimes
assignedopen 
0.2.0-SNAPSHOT 
0.2.1 
Bug
medium
0000817: Table lookup routines contain potential for rare divide by zero
This was found by Eric in his unit testing, thanks Eric!! :-)

I will do some research on the effect this has on a running device and post it here soon. I'll also get a fix pushed soon.
No tags attached.
jpg ediv.jpg (109,190) 2013-01-22 15:07
http://issues.freeems.org/file_download.php?file_id=85&type=bug
jpg

Notes
(0002550)
Fred   
2013-01-22 09:03   
Reduced priority and severity to reflect results from over-the-wires testing which shows that the device responds with the correct value and doesn't go crazy or reset. Further research required to find out why this is. I'll expand my OTW test suite this evening to cover this better.
(0002553)
evortriede   
2013-01-22 15:08   
The EDIV and similar instructions in the S12X appear only to set the C flag upon Divide-by-zero (see attachment) which explains why it does not blow up.
(0002554)
Fred   
2013-01-22 15:12   
That's true, I read about it, however it's likely not in use with my stuff, because:

A) 32 bit divide
B) Old tool chain that didn't use EDIV

Similar stuff likely was used, though, and likely the same thing was done. What's interesting is that it returns the right number! :-)

Next time just refer to the page number/figure number, everyone has that PDF handy at all times ;-)