OS_IICOp error when device not present on bus
Andrew Conroy (370) 740 posts |
Using recent versions of the ROM (July/August), trying to access an IIC address which isn’t present on the IIC Bus generates an Abort on Data Transfer @ &FC01A2B4 (which is in the Kernel) on the Pi2/3 but “No acknowledge from IIC device” on the Pi1. I’ve not been able to test on earlier ROMs or other Pis. Is this inconsistent behaviour across the different versions correct? I’ve always expected/received the “No acknowledge from IIC device” error before, so the A.O.D.T. is new to me. I’ve just spent a couple of days trying to find the cause of the AODT in my code, only to find it was in fact a “No Ack” error :( |
Jeffrey Lee (213) 6048 posts |
Can you give an example of a call that’s crashing? Everything seems to be OK for me when testing the current nightly build on a Pi 3 |
Andrew Conroy (370) 740 posts |
This is the configuration for an IIC temperature sensor. On a Pi2, this gives an AODT when the sensor is not present, and on a Pi1 it gives “No acknowledge from IIC device”. Both Pis are currently running RISC OS 5.23, 7th Aug 2016. The code is about 3yrs old! |
Jeffrey Lee (213) 6048 posts |
Hmm, still seems to work OK for me. Can you try entering the following to enable the annotated exception dumps and then make it crash: *set Debugger$DumpOptions -file annotated *set Debugger$AnnotatedFile $.excdump And then post the dump file ($.excdump) here, or have a go at deciphering it yourself. I believe &FC01A2B4 is in the middle of OS_FindMemMapEntries, so I’m not quite sure how it could be getting there from OS_IICOp. |
Andrew Conroy (370) 740 posts |
Thanks Jeffrey. The debug output mentioned Reporter, so I RMKilled the Reporter module (v2.71) and now I get the “No acknowledge form IIC device” error message back, so it’s in some way linked to the Reporter module being loaded! Still odd that it should behave differently on the Pi1 compared with Pi2 or Pi3. Would it still be helpful to post the debug output? I have Reporter running as standard, so I’d forgotten that it was even loaded! |
Jeffrey Lee (213) 6048 posts |
Should be fixed now – it looks like it was a bug in OS_FindMemMapEntries that was introduced when I added the PMP support, which can cause it to crash or return incorrect results if you try looking up certain addresses that aren’t mapped in L2PT. (It looks like Reporter was using OS_FindMemMapEntries to validate the error pointer OS_IICOp was returning, but the “No ack” error is actually an untranslated block that’s held in the ROM, and ROM pages generally aren’t found in L2PT) |
Andrew Conroy (370) 740 posts |
Thanks Jeffrey, glad you’ve managed to track it down and it wasn’t me going mad! |
Chris Evans (457) 1614 posts |
Unfortunately there wasn’t a Pi ROM build overnight! It has now been updated as at 10:30a.m. |
David Pitt (102) 743 posts |
It’s there now, build 19-Aug-16. (Builds appear on the ROOL site at about 10am.) |
Chris Evans (457) 1614 posts |
Yes just spotted that David. I’m sure the builds used to appear about 2-4a.m. not an issue now I know. |
Andrew Conroy (370) 740 posts |
I can confirm that the new build does fix this issue, I get the “No acknowledge from IIC device” message with or without Reporter loaded now. |