Skip to content

apps/scl3300: Add uORB inclinometer and SCL3300 test application - #3825

Open
acassis wants to merge 2 commits into
apache:masterfrom
acassis:scl3300
Open

acassis wants to merge 2 commits into
apache:masterfrom
acassis:scl3300

Conversation

@acassis

@acassis acassis commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds support to sensor inclinometer using uORB and adds a scl3300test application.
Depends-on: apache/nuttx#20567

Impact

Users will be able to use and test SCL3300

Testing

nsh> scl3300test -n 0 all                                                         
WHOAMI: 0xc1 -> PASS                                                              
SELFTEST: 0 -> PASS                                                               
INFO inclinometer: Murata SCL3300 v1, 1.20 mA, range 90.0000, resolution 0.005493s
INFO accel: Murata SCL3300 v1, 1.20 mA, range 11.7828, resolution 0.0016365, intes
READ:                                                                             
  200/200 samples, temperature 25.25 C                                            
  X: mean   -1.6082 deg, stddev 0.02439 deg                                       
  Y: mean    0.0730 deg, stddev 0.02526 deg                                       
  Z: mean   88.3900 deg, stddev 0.02418 deg                                       
MODE 1:                                                                           
INFO inclinometer: Murata SCL3300 v1, 1.20 mA, range 90.0000, resolution 0.005493s
INFO accel: Murata SCL3300 v1, 1.20 mA, range 11.7828, resolution 0.0016365, intes
  200/200 samples, temperature 25.25 C                                            
  X: mean   -1.6069 deg, stddev 0.01853 deg                                       
  Y: mean    0.0734 deg, stddev 0.01455 deg                                       
  Z: mean   88.3919 deg, stddev 0.01857 deg                                       
MODE 2:                                                                           
INFO inclinometer: Murata SCL3300 v1, 1.20 mA, range 90.0000, resolution 0.005493s
INFO accel: Murata SCL3300 v1, 1.20 mA, range 23.5656, resolution 0.0032730, intes
  200/200 samples, temperature 25.25 C                                            
  X: mean   -1.6016 deg, stddev 0.02828 deg                                       
  Y: mean    0.0698 deg, stddev 0.02199 deg                                       
  Z: mean   88.3974 deg, stddev 0.02818 deg                                       
MODE 3:                                                                           
INFO inclinometer: Murata SCL3300 v1, 1.20 mA, range 90.0000, resolution 0.005493s
INFO accel: Murata SCL3300 v1, 1.20 mA, range 9.8190, resolution 0.0008182, inters
  200/200 samples, temperature 25.25 C                                            
  X: mean   -1.6170 deg, stddev 0.00956 deg                                       
  Y: mean    0.0760 deg, stddev 0.00936 deg                                       
  Z: mean   88.3809 deg, stddev 0.00951 deg                                       
MODE 4:                                                                           
INFO inclinometer: Murata SCL3300 v1, 1.20 mA, range 90.0000, resolution 0.005493s
INFO accel: Murata SCL3300 v1, 1.20 mA, range 9.8190, resolution 0.0008182, inters
  200/200 samples, temperature 25.62 C                                            
  X: mean   -1.6292 deg, stddev 0.00574 deg                                       
  Y: mean    0.2262 deg, stddev 0.00552 deg                                       
  Z: mean   88.3546 deg, stddev 0.00696 deg                                       
MODE 1:                                                                           
INFO inclinometer: Murata SCL3300 v1, 1.20 mA, range 90.0000, resolution 0.005493s
INFO accel: Murata SCL3300 v1, 1.20 mA, range 11.7828, resolution 0.0016365, intes
  200/200 samples, temperature 25.36 C                                            
  X: mean   -1.6100 deg, stddev 0.02059 deg                                       
  Y: mean    0.0716 deg, stddev 0.01432 deg                                       
  Z: mean   88.3886 deg, stddev 0.02066 deg                                       
MODE 5: rejected -> PASS                                                          
POWER: 100 power-down/wake-up cycles                                              
POWER: 0 failures -> PASS                                                         
RESET: 0 -> PASS                                                                  
READ:                                                                             
  200/200 samples, temperature 25.41 C                                            
  X: mean   -1.5659 deg, stddev 0.03361 deg                                       
  Y: mean   -0.2436 deg, stddev 0.03985 deg                                       
  Z: mean   88.4156 deg, stddev 0.03271 deg                                       
ALL: PASS                                                                         
nsh> 

NuttX adds SENSOR_TYPE_INCLINOMETER and struct sensor_inclinometer
(X, Y and Z tilt in degrees, plus temperature) for the Murata SCL3300
driver.  Define the sensor_inclinometer topic, so that uorb_listener
can print it, and add it to sensortest.  The struct has the same layout
as struct sensor_accel, so sensortest prints it with print_vec3.

This depends on the NuttX commit that adds the sensor type.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
Comment thread examples/scl3300test/scl3300test_main.c Outdated
@cederom

cederom commented Oct 9, 2026 via email

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown

🔗 Cross-repo PR dependencies

The read-only Build run reported the following dependent PR(s) and fetched head SHA(s):

CI run: https://github.com/apache/nuttx-apps/actions/runs/37969785765

Add a program to check the SCL3300 driver on a board.  It goes through
the driver's uORB topics and ioctls and reports PASS or FAIL for each
test:
 - whoami: SNIOC_WHO_AM_I returns 0xC1.
 - selftest: SNIOC_SELFTEST succeeds.
 - info: prints SNIOC_GET_INFO for each topic.
 - read: mean and standard deviation of 200 samples per axis.
 - modes: Modes 1, 2, 3, 4 and 1, with the info and noise of each,
   and an invalid mode is rejected.
 - power: 100 power-down/wake-up cycles with SCL3300_POWER_DOWN_IDLE,
   checking that the mode survives.
 - reset: SNIOC_RESET, then read.
 - all: every test above.

Tested on an STM32F4Discovery with an SCL3300.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
@github-actions

Copy link
Copy Markdown

🔗 Cross-repo PR dependencies

The read-only Build run reported the following dependent PR(s) and fetched head SHA(s):

CI run: https://github.com/apache/nuttx-apps/actions/runs/39427198711

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants