RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
Forums → Bugs →

OS_IICOp error when device not present on bus

Subscribe to OS_IICOp error when device not present on bus 11 posts, 4 voices

 
Aug 16, 2016 7:11pm
Avatar Andrew Conroy (370) 684 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 :(

 
Aug 17, 2016 8:59pm
Avatar Jeffrey Lee (213) 5984 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

 
Aug 17, 2016 10:10pm
Avatar Andrew Conroy (370) 684 posts

DIM iic_tx% 255
iic_bus% = 0
temp_sensor_write% = &4F << 1
temp_sensor_read% = (&4F << 1) + 1

iic_tx%!0 = temp_sensor_write% : REM Address of device
iic_tx%!4 = iic_tx%+32         : REM Pointer to data to write
iic_tx%!8 = 2                  : REM number of bytes to write

REM data to write to device
iic_tx%?32 = 1  : REM Register pointer (configuration register)
iic_tx%?33 = 0  : REM settings (9bit resolution)

SYS "OS_IICOp" ,iic_tx%, 1+(iic_bus%<<24) TO ;flags

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!

 
Aug 18, 2016 12:28am
Avatar Jeffrey Lee (213) 5984 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.

 
Aug 18, 2016 5:23pm
Avatar Andrew Conroy (370) 684 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!

 
Aug 18, 2016 8:31pm
Avatar Jeffrey Lee (213) 5984 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)

 
Aug 18, 2016 9:12pm
Avatar Andrew Conroy (370) 684 posts

Thanks Jeffrey, glad you’ve managed to track it down and it wasn’t me going mad!

 
Aug 19, 2016 8:21am
Avatar Chris Evans (457) 1601 posts

Unfortunately there wasn’t a Pi ROM build overnight! It has now been updated as at 10:30a.m.

 
Aug 19, 2016 9:37am
Avatar David Pitt (102) 743 posts

Unfortunately there wasn’t a Pi ROM build overnight!

It’s there now, build 19-Aug-16. (Builds appear on the ROOL site at about 10am.)

 
Aug 19, 2016 9:40am
Avatar Chris Evans (457) 1601 posts

Yes just spotted that David. I’m sure the builds used to appear about 2-4a.m. not an issue now I know.

 
Aug 19, 2016 10:17am
Avatar Andrew Conroy (370) 684 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.

Reply

To post replies, please first log in.

Forums → Bugs →

Search forums

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Description

Bug discussions that aren’t covered by the bugs database.

Voices

  • Andrew Conroy (370)
  • Jeffrey Lee (213)
  • Chris Evans (457)
  • David Pitt (102)

Options

  • Forums
  • Login
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Beast theme is based on Beast's default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Beast © 2006 Josh Goebel and Rick Olson
This site runs on Rails

Hosted by Arachsys