Skip to content

Conversation

@Otpvondoiats
Copy link
Contributor

@Otpvondoiats Otpvondoiats commented Jan 11, 2026

Summary

  • bugfix
  1. add sensor_device_info when sensor_regsiter by usensor
  2. uorb:Fixed O_DIRECT flag triggering rpmsg cross-core
  3. sensor:Added virtual sensor flag to prioritize reading of driver information.

Impact

Cross-core direct connection and cross-core information retrieval

Testing

grass:/ # uorb
uorb_advertise_demo  uorb_downsample      uorb_listener        uorb_rpmsg_test      uorb_unit_test
grass:/ # uorb_listener -n 10 sensor_accel                                                                                                                                                                                               

Mointor objects num:1
object_name:sensor_accel, object_instance:0
sensor_accel(now:2225773497):timestamp:193400799,x:0.229420,y:0.309188,z:9.802140,temperature:28.654297
sensor_accel(now:2225775471):timestamp:193441149,x:0.286881,y:0.232574,z:9.833264,temperature:28.654297
sensor_accel(now:2225776827):timestamp:193481499,x:0.243785,y:0.218209,z:9.802140,temperature:28.654297
sensor_accel(now:2225777142):timestamp:193521849,x:0.306035,y:0.158354,z:9.756650,temperature:28.654297
sensor_accel(now:2225777429):timestamp:193562199,x:0.267727,y:0.290035,z:9.766227,temperature:28.654297
sensor_accel(now:2225778291):timestamp:193602549,x:0.303640,y:0.199055,z:9.823688,temperature:28.654297
sensor_accel(now:2225779478):timestamp:193642899,x:0.272516,y:0.244545,z:9.766227,temperature:28.654297
sensor_accel(now:2225779971):timestamp:193683249,x:0.346736,y:0.316371,z:9.696795,temperature:28.654297
sensor_accel(now:2225780657):timestamp:193723599,x:0.320400,y:0.239756,z:9.794957,temperature:28.654297
sensor_accel(now:2225781241):timestamp:193763949,x:0.296458,y:0.285246,z:9.814111,temperature:28.654297
Object name:sensor_accel0, recieved:10
Total number of received Message:10/10

uniy test

grass:/ # uorb_unit_test                                                                                                                                                                                                                 
uORB note: try single-topic support
uORB note: PASS single-topic test
uORB note: PASS orb 10-instances
uORB note: try multi-topic support
uORB note: PASS multi-topic test
uORB note: try multi-topic support subscribing before publishing
uORB note: PASS multi-topic reversed
uORB note: Testing unadvertise
uORB note: Testing multi-topic 2 test (queue simulation)
uORB note: PASS multi-topic 2 test (queue simulation)
uORB note: Testing orb queuing
uORB note:   Testing to write some elements...
uORB note:   Testing overflow...
uORB note:   Testing underflow...
uORB note: PASS orb queuing
uORB note: Testing orb queuing (poll & notify)
TEST PASS

@github-actions github-actions bot added Area: Sensors Sensors issues Size: S The size of the change in this PR is small labels Jan 11, 2026
@github-actions github-actions bot added Area: OS Components OS Components issues Size: M The size of the change in this PR is medium labels Jan 12, 2026
@jerpelea jerpelea changed the title sensor bug fix - part 1 drivers/sensors: sensor bug fix - part 1 Jan 12, 2026
jerpelea
jerpelea previously approved these changes Jan 12, 2026
Copy link
Contributor

@jerpelea jerpelea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add "drivers/sensors:" in front of commit title

@Otpvondoiats
Copy link
Contributor Author

wait for #17837 and apache/nuttx-apps#3312

Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this could be three separate PRs since the commits seem unrelated.

We have conducted tests on the following platforms

Can you please provide more information about your testing? What did you test on the platforms, how do you know the behaviour is correct, etc.

@Otpvondoiats
Copy link
Contributor Author

depend on apache/nuttx-apps#3332

@Otpvondoiats Otpvondoiats force-pushed the lk_fix_direct_flag branch 2 times, most recently from ad37cc7 to a5b1d1b Compare January 16, 2026 14:42
@Otpvondoiats
Copy link
Contributor Author

please add "drivers/sensors:" in front of commit title

done

Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide more information about your testing? What did you test on the platforms, how do you know the behaviour is correct, etc.

@xiaoxiang781216 as we voted in the mailing list, do not dismiss other reviewers comments please. I am always happy to re review.

@Otpvondoiats
Copy link
Contributor Author

Can you please provide more information about your testing? What did you test on the platforms, how do you know the behaviour is correct, etc.

@xiaoxiang781216 as we voted in the mailing list, do not dismiss other reviewers comments please. I am always happy to re review.

Updated,You don't need to xiaoxiang781216, just contact me and I'll see your comments.

@Otpvondoiats
Copy link
Contributor Author

This patch depends on apache/nuttx-apps#3332. I'll try modifying build.yaml to see if it can build successfully.

@xiaoxiang781216
Copy link
Contributor

@Otpvondoiats please rebase your patch to the last master which conatain patch to fix the build break.

Comment on lines -447 to -455
#ifdef CONFIG_USENSOR
/* Command: SNIOC_SET_INFO
* Description: Set device information. Only used by user space.
* Argument: This is the device info pointer.
*/

# define SNIOC_SET_INFO _SNIOC(0x009C)
#endif

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this considered a breaking change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ioctl is normally used with Android sensor HAL to report the additional sensor info required by Android, since both side is modified, the impact is minimal.

Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Also, is the Unity test an internal tool?

@xiaoxiang781216
Copy link
Contributor

@Otpvondoiats please rebase your patch to the last master which fix the ci build break.

@Otpvondoiats
Copy link
Contributor Author

Looks good! Also, is the Unity test an internal tool?

yes,This includes basic functional tests for the sensor framework;

Donny9 and others added 3 commits January 18, 2026 12:12
The logic for obtaining the info and configuring the user buffer
have been optimized.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Signed-off-by: likun17 <likun17@xiaomi.com>
Fixes the issue of cross-core IPC being triggered when using
O_DIRECT in non-cross-core scenarios.

Signed-off-by: likun17 <likun17@xiaomi.com>
of driver information.

When the local core is a virtual sensor, attempt to retrieve
information from a remote core.

Signed-off-by: likun17 <likun17@xiaomi.com>
@Otpvondoiats
Copy link
Contributor Author

@Otpvondoiats please rebase your patch to the last master which fix the ci build break.

Done

@Otpvondoiats
Copy link
Contributor Author

I pushed it again, and then a case failed. I built it locally, posted the logs, and then merged it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: OS Components OS Components issues Area: Sensors Sensors issues Size: M The size of the change in this PR is medium Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants