Closed bstbud closed 1 year ago
Memory usage change @ 2aa90fc4ad2199a588afebcd1ad76a3744d7b277
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:mbed_nicla:nicla_sense |
:grey_question: -64 - +64 | -0.01 - +0.01 | :small_red_triangle: 0 - +8 | 0.0 - +0.01 |
arduino:mbed_portenta:envie_m7 |
N/A | N/A | N/A | N/A |
arduino:samd:mkrgsm1400 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrnb1500 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwan1310 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwifi1010 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrzero |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
Hello,
Following the result from tests with multiple boards / firmware I can share that:
For the accelerometer, gyroscope, gas and rotation values included in the modified standalone.ino
sketch, values are NOT printed when zero. However, the temperature is still printed when it is zero, indicating that temperature data is sent even when not available.
When the quaternion data is displayed, the accuracy is always set to 3.142
. What does this refer to?
The firmware must be updated (via the BHYFirmwareUpdate.ino
sketch), otherwise the quaternion data may not be visible on the terminal.
The quaternion sensor values are delivered on two out of the four boards tested.
Note: The loop was set to run continuously, with the following if
statement commented out in all tests:
if (millis() - printTime >= 1000) {
printTime = millis();
//call sensors
}
Thanks @jacobhylen for the helpful discussions 🌟
Hello,
Following the result from tests with multiple boards / firmware I can share that:
For the accelerometer, gyroscope, gas and rotation values included in the modified
standalone.ino
sketch, values are NOT printed when zero. However, the temperature is still printed when it is zero, indicating that temperature data is sent even when not available.Serial Output with previous
Standalone.ino
sketchacceleration: XYZ values - X: 0 Y: 0 Z: 0 gyroscope: XYZ values - X: 0 Y: 0 Z: 0 temperature: 0.000 gas: 0.000 rotation: Quaternion values - X: 0.000 Y: 0.000 Z: 0.000 W: 0.000 Accuracy: 0.000
Serial Output with modified
Standalone.ino
sketchacceleration: XYZ values - X: -1123 Y: -287 Z: 4099 gyroscope: XYZ values - X: 1 Y: 15 Z: -3 temperature: 0.000 acceleration: XYZ values - X: -1130 Y: -288 Z: 4117 gyroscope: XYZ values - X: 2 Y: 16 Z: -1 acceleration: XYZ values - X: -1132 Y: -283 Z: 4099 gyroscope: XYZ values - X: -1 Y: -14 Z: -4 acceleration: XYZ values - X: -1116 Y: -295 Z: 4091 gyroscope: XYZ values - X: 0 Y: 3 Z: -2 temperature: 24.430 acceleration: XYZ values - X: -1138 Y: -281 Z: 4104 ... rotation: Quaternion values - X: -0.032 Y: 0.134 Z: -0.000 W: 0.990 Accuracy: 3.142 acceleration: XYZ values - X: -1132 Y: -268 Z: 4120 gyroscope: XYZ values - X: 1 Y: 6 Z: 0 rotation: Quaternion values - X: -0.032 Y: 0.134 Z: -0.000 W: 0.990 Accuracy: 3.142 acceleration: XYZ values - X: -1126 Y: -289 Z: 4090 gyroscope: XYZ values - X: 0 Y: 5 Z: -2 gas: 812613.000 rotation: Quaternion values - X: -0.032 Y: 0.134 Z: -0.000 W: 0.990 Accuracy: 3.142
When the quaternion data is displayed, the accuracy is always set to
3.142
. What does this refer to?The firmware must be updated (via the
BHYFirmwareUpdate.ino
sketch), otherwise the quaternion data may not be visible on the terminal.The quaternion sensor values are delivered on two out of the four boards tested.
Note: The loop was set to run continuously, with the following
if
statement commented out in all tests:if (millis() - printTime >= 1000) { printTime = millis(); //call sensors }
Thanks @jacobhylen for the helpful discussions 🌟
hi @aliphys, did you use the Standalone.ino from the examples w/o modifications? could you post the sketch you used? It could be because of missing initialization of _dataAvail member causing the _dataAvail to be random when the Sensor object is dynamically created, which has been fixed in the new commit (please checkout and see if the issue is resolved but pls share your sketch still to confirm ).
Memory usage change @ b7dc6a60308093febddabf5082360dfbee1045b0
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:mbed_nicla:nicla_sense |
:small_red_triangle: 0 - +64 | 0.0 - +0.01 | :small_red_triangle: 0 - +8 | 0.0 - +0.01 |
arduino:mbed_portenta:envie_m7 |
N/A | N/A | N/A | N/A |
arduino:samd:mkrgsm1400 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrnb1500 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwan1310 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwifi1010 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrzero |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
Hello @bstbud ,
TLDR: With latest firmware/checkout, the temperature and gas data are inaccurate upon device startup even when .dataAvaliable()
is used to check virtual sensor status.
could you post the sketch you used?
This is the sketch I used. Note that the initial one second delay is commented out.
This is the Serial Monitor output:
acceleration: XYZ values - X: -246 Y: -136 Z: 4216
gyroscope: XYZ values - X: 0 Y: 4 Z: 0
temperature: 0.000
acceleration: XYZ values - X: -249 Y: -129 Z: 4212
gyroscope: XYZ values - X: 0 Y: -3 Z: 0
acceleration: XYZ values - X: -238 Y: -139 Z: 4199
gyroscope: XYZ values - X: 0 Y: -5 Z: -3
rotation: Quaternion values - X: -0.016 Y: 0.030 Z: 0.000 W: 0.999 Accuracy: 3.142
acceleration: XYZ values - X: -241 Y: -145 Z: 4223
gyroscope: XYZ values - X: -1 Y: 12 Z: 0
temperature: 32.110
rotation: Quaternion values - X: -0.016 Y: 0.030 Z: 0.000 W: 0.999 Accuracy: 3.142
Following tests with the latest commit temperature values are still reported as zero initially: temperature: 0.000
. To show this more clearly, here is a sketch to only output tempertature values.
The first value for this sketch is zero in both devices.
0.000
32.310
32.320
32.300
32.270
32.250
32.220
32.170
32.130
0.000
31.100
31.110
31.100
31.080
31.070
31.080
31.070
31.060
You can see that the initial value is about two orders of magnitude higher, then drops down before settling at about 20,000 for Nicla Sense ME A or 10,000 for Nicla Sense ME B. Note that both sensor were on for over five minutes, before they were reset and data collected.
1181898.000
6240.000
11753.000
15872.000
18306.000
20072.000
21422.000
22262.000
23094.000
24014.000
24404.000
24734.000
447114.000
2568.000
4039.000
5539.000
6619.000
7381.000
7883.000
8316.000
8632.000
8950.000
9178.000
9410.000
9644.000
9891.000
10082.000
10301.000
10403.000
Please let me know if I can provide more info and thanks again for looking into this @bstbud ! 😄
@aliphys Thanks for the info provided. tried to reproduce using the sketch for the temperature sensor output only and unfortunately, with 10+ times of resetting the device, the 1st temperature sensor output are always valid (non-zero).
so would like to learn more:
Regarding both comments, the answer is yes.
@aliphys it was found that the old BHI260 firmware presents this issue and the new BHI260 firmware will eradicate this issue. Would you like to try the new BHI260 firmware from: https://github.com/arduino/nicla-sense-me-fw/pull/85
@the latest BHI260 FW from fea_bsec2 branch is copied to this branch and with the new BHI260 FW (fw.h), you should see the issue of initial 0-values gone. You could give it a shot, simply check out the latest code, update the BHI260 fw and then use your sketch to verify the issues.
Memory usage change @ e4b435adc05c20fd3afc63e8c04eebab7dfde0ba
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:mbed_nicla:nicla_sense |
:grey_question: -2180 - +64 | -0.41 - +0.01 | :small_red_triangle: 0 - +8 | 0.0 - +0.01 |
arduino:mbed_portenta:envie_m7 |
N/A | N/A | N/A | N/A |
arduino:samd:mkrgsm1400 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrnb1500 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwan1310 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwifi1010 |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrzero |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
The new firmware does indeed solve the problem. Tested on multiple Nicla Sense ME boards:
user@user-laptop:~/github/nicla-sense-me-fw$ arduino-cli monitor -p /dev/ttyACM0 -c baudrate=115200
Monitor port settings:
baudrate=115200
Connected to /dev/ttyACM0! Press CTRL-C to exit.
29.590
29.600
29.610
29.620
29.640
29.660
29.680
29.690
user@user-laptop:~/github/nicla-sense-me-fw$ arduino-cli monitor -p /dev/ttyACM0 -c baudrate=115200
Monitor port settings:
baudrate=115200
Connected to /dev/ttyACM0! Press CTRL-C to exit.
5684.000
5684.000
5684.000
5684.000
5684.000
5684.000
Description
add a flag to indicate if a new data is available so that no dummy data is printed
Pull request type