Repository navigation
Fix incorrect TARGET_NAME/TARGET_SEEED_XIAO_NRF52840_SENSE_PLUS define - #23
Open
jgastonraoul wants to merge 1 commit into
Open
jgastonraoul wants to merge 1 commit into
jgastonraoul wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an incorrect
TARGET_NAME/TARGET_SEEED_XIAO_NRF52840_SENSE_PLUSdefine in theSEEED_XIAO_NRF52840_SENSE_PLUSvariant. The variant'sdefines.txtstill carries the target name of the plainSEEED_XIAO_NRF52840_PLUSvariant (no "Sense"), which appears to be a leftover from copying that variant's generated files when the Sense Plus variant was added.Problem
Third-party libraries commonly guard board-specific behavior behind the
TARGET_SEEED_XIAO_NRF52840_SENSE_PLUSdefine — for example, Seeed_Arduino_LSM6DS3 uses it to redirect the onboard IMU to the internalWire1bus and to enablePIN_LSM6DS3TR_C_POWER, both required for the onboard LSM6DS3TR-C to respond on this board.Because the variant's
defines.txtdefinesTARGET_SEEED_XIAO_NRF52840_PLUSinstead, that#ifdefnever triggers, and the onboard IMU is silently undetectable on this variant when using this core — with no compile-time warning, since the code compiles fine either way.Root cause
variants/SEEED_XIAO_NRF52840_SENSE_PLUS/defines.txt
-DTARGET_NAME=SEEED_XIAO_NRF52840_PLUS <- should be SEEED_XIAO_NRF52840_SENSE_PLUS
-DTARGET_SEEED_XIAO_NRF52840_PLUS <- should be SEEED_XIAO_NRF52840_SENSE_PLUS
Both defines match the
SEEED_XIAO_NRF52840_PLUS(no Sense) variant'sdefines.txtexactly, which strongly suggests these files were copied from that variant whenSEEED_XIAO_NRF52840_SENSE_PLUSwas created, without regenerating the target-specific defines.Scope of the fix
This PR only touches
defines.txt. I checked whetherincludes.txt(which referencesTARGET_SEEED_XIAO_NRF52840_PLUSin an mbed-os include path) needed the same treatment, but confirmed there is no dedicatedcores/arduino/mbed/targets/.../TARGET_SEEED_XIAO_NRF52840_SENSE_PLUSdirectory in this core — onlyTARGET_SEEED_XIAO_NRF52840_PLUSandTARGET_SEEED_XIAO_NRF52840_SENSEexist. The Sense Plus variant genuinely borrows the Plus variant's mbed-os target tree (which makes sense, since the underlying SoC/SDK support is identical — only the PCB differs, adding the onboard IMU/mic). Soincludes.txtis correct as-is and should not be changed; the preprocessor-levelTARGET_NAME/TARGET_SEEED_XIAO_NRF52840_SENSE_PLUSdefines are what's actually broken and consumed by userland code.Testing
Verified on physical hardware (Seeed XIAO nRF52840 Sense Plus, this core installed via Boards Manager, v2.9.3): before this fix,
Seeed_Arduino_LSM6DS3'simu.begin()fails to detect the onboard LSM6DS3TR-C. After applying this fix,TARGET_SEEED_XIAO_NRF52840_SENSE_PLUSis correctly defined, the library's existing#if defined(TARGET_SEEED_XIAO_NRF52840_SENSE_PLUS)branch triggers as intended, and the onboard IMU is detected and reads correctly with no changes needed on the library or sketch side.