I’m trying to read the onboard LSM6DS3TR-C IMU on a Seeed Studio XIAO nRF52840 Sense board using a small Arduino C test program. The setup is:
Board: Seeed Studio XIAO nRF52840 Sense
Core: Seeed nRF52 Boards, 1.1.13
Arduino IDE 1.8.19
Platform: macOS Sequoia
The program compiles and uploads successfully, but produces no output in Serial Monitor. It seems to be hanging when executing Wire1.endTransmission().
So t’s either the BSP or the LIB version, Look back there are some threads on it being documented, I think it was the wire or Wire1 that had the issue’s. it works with the seeed LIB though forsure.
HTH
GL PJ
I probably have the most demo’s of the IMU on here, btw. Check out the Motion, Fall and Park . demo’s for more.
So I just went and compiled the Low level example and uploaded and ran without issue.
I used the current BSP 1.1.13
FQBN: Seeeduino:nrf52:xiaonRF52840Sense
Using board 'xiaonRF52840Sense' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.13
Using core 'nRF5' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.13
----
Sketch uses 46880 bytes (5%) of program storage space. Maximum is 811008 bytes.
Global variables use 7652 bytes (3%) of dynamic memory, leaving 229916 bytes for local variables. Maximum is 237568 bytes.
Performing 1200-bps touch reset on serial port COM14
Waiting for upload port...
No upload port found, using COM14 as fallback
"C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.13/tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe" --verbose dfu serial -pkg "C:\Users\Dude\AppData\Local\arduino\sketches\853C867E6CF9E33730F30F970CE7DE42/LowLevelExample.ino.zip" -p COM14 -b 115200 --singlebank
Upgrading target on COM14 with DFU package C:\Users\Dude\AppData\Local\arduino\sketches\853C867E6CF9E33730F30F970CE7DE42\LowLevelExample.ino.zip. Flow control is disabled, Single bank, Touch disabled
Opened serial port COM14
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 46888
Sending DFU start packet
Sending DFU init packet
Sending firmware file
########################################
########################################
############
Activating new firmware
Device programmed.
DFU upgrade took 3.405799150466919s
serial output
Device OK.
Accelerometer Counts:
X = 0
Y = 0
Z = 0
Total reported Errors and Warnings: 0
Accelerometer Counts:
X = -317
Y = -143
Z = 4061
Total reported Errors and Warnings: 0
I couldn’t try your example because I don’t have a XIAO expansion board. However I noticed that it refers to “built with BSP 2.9.2” which is the Seeed nRF52 mbed-enabled Boards core. So I tried the latest version of that, 2.9.3, with my test program and it worked:
Wire1 started
WHO_AM_I = 0x6A
So has anyone managed to access the IMU using the Seeed nRF52 Boards core (rather than the mbed core)?
LOL
Ah’ the one I just posted uses the BSP 1.1.13 Which is the latest “Seeed NRF52 Boards” NON- Mbed Scroll right the compiler output window.
I used the low lever example in Arduino.l
OK, thanks for that suggestion. On a hunch I did Burn Bootloader, and now both the LowLevelExample and my test program are working as expected. I think my board had become screwed up in some way.