Ticket #43 (closed defect: fixed)

Opened 11 months ago

Last modified 11 months ago

Sensor test asserts when run with no sensors connected

Reported by: dave Owned by: sam
Priority: major Milestone: NxOS 0.2
Component: tests Version:
Keywords: Cc:

Description

** Assertion **
sensors.c:59
(sensors_mode[ser
Assertion failed

Without looking at the source, it appears that the sensor test is attempting to poll sensors before initializing them. In any case, the sensor driver is being accessed with an uninitialized sensor. Not good.

Change History

follow-up: ↓ 2   Changed 11 months ago by sam

  • owner changed from dave to sam
  • status changed from new to assigned

A possible code path leading to this assertion :

tests_usb()
  tests_sensors()
  tests_radar()

tests_sensors() will enable all sensor ports in analog, but not disable them. tests_radar() will try to enable in I2C mode the port 0, and will thus fail because sensors_mode[0] != OFF.

in reply to: ↑ 1 ; follow-up: ↓ 3   Changed 11 months ago by sam

Note that I still have no idea why the assertion would popup by itself "after a while".

in reply to: ↑ 2   Changed 11 months ago by sam

Replying to sam:

Note that I still have no idea why the assertion would popup by itself "after a while".

A similar code path is followed by the tests_all() function, where tests_sensors() is called before tests_radar(). I adding the relevant calls to disable the sensors at the end of tests_sensors().

  Changed 11 months ago by sam

Code submitted, requires testing.

  Changed 11 months ago by dave

  • status changed from assigned to closed
  • resolution set to fixed

The change in question is 7ccf88f7afaa , and a few changes preceding it. Looks good to me, merged into devel.

Note: See TracTickets for help on using tickets.