Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add bmi088 driver. #15483

Closed
wants to merge 22 commits into from
Closed

add bmi088 driver. #15483

wants to merge 22 commits into from

Conversation

JerrySlhao
Copy link
Contributor

drivers/sensors/bmi088: add bmi088 driver.

Summary

Increase the driver of BMI088, convenient for everyone to use. Can open it using the device file interface or use the uorb interface.Currently support SPI, IIC interface has not been tested. Open with the following macro definition:

#define CONFIG_SENSORS_BMI088 1
#define CONFIG_SENSORS_BMI088_UORB 1
#define CONFIG_SENSORS_BMI088_SPI 1

Impact

Is new feature added?

Yes.

Impact on user (will user need to adapt to change)?

NO.

Impact on build (will build process change)?

NO.

Impact on hardware (will arch(s) / board(s) / driver(s) change)?

YES,add bmi088 driver.

Impact on documentation (is update required / provided)?

NO.

Impact on security (any sort of implications)?

NO.

Impact on compatibility (backward/forward/interoperability)?

NO.

Testing

Acceleration and gyroscope data have been tested by opening the bmi088 device file.
Opening and reading accelerometer and gyroscope data using IO multiplexing via the uorb interface was also tested.

host

ubuntu20.04

complier

arm-none-eabi-gcc (15:9-2019-q4-0ubuntu1) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]

Signed-off-by: jerryslhao <jerryslhao@gmail.com>
@github-actions github-actions bot added Area: Sensors Sensors issues Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. labels Jan 10, 2025
@nuttxpr
Copy link

nuttxpr commented Jan 10, 2025

[Experimental Bot, please feedback here]

Fill In The Commit Message: This PR contains a Commit with an Empty Commit Message. Please fill in the Commit Message with the PR Summary.

This PR mostly meets the NuttX requirements but could be improved in terms of clarity and detail. Here's a breakdown:

Strengths:

  • Provides a clear statement of the overall change: adding a BMI088 driver.
  • Identifies configuration options required to enable the driver.
  • Lists tested host and compiler.
  • Confirms testing functionality via device file and uorb interface.

Weaknesses:

  • Summary lacks detail:

    • The "why" is weak. State the benefit of adding this driver. Is it for a specific application or general purpose?
    • The "how it works" is vague. Explain briefly how the driver interfaces with the hardware and software. Mention key data structures or algorithms if applicable.
    • No related NuttX issues are referenced. If there isn't one, consider creating one to track the feature request.
  • Impact section lacks detail:

    • While answering "YES" to impacting hardware, it simply restates that the driver is added. Specify which hardware (specific architectures, boards) this driver supports. List the SPI controller it uses. Mention any required board configuration changes (e.g., pinmuxing).
    • "NO" to documentation impact is problematic. At minimum, the Kconfig file needs updating to document the new configuration options. Ideally, there should be some documentation in the docs/ directory explaining how to use the driver.
  • Testing section lacks essential information:

    • No "before change" logs: This makes it impossible to assess the impact of the change.
    • "After change" logs are missing crucial data: What specific values were read? Include examples of the output showing the accelerometer and gyroscope readings. This proves the driver is functioning correctly.
    • Target(s) missing: Which architecture and board was this tested on? Just stating "ubuntu20.04" is the build host information; we need the target details. e.g., sim:nsh, stm32f4discovery:nsh

Recommendations for Improvement:

  1. Expand the Summary: Explain the motivation for adding the driver and provide more technical detail about its implementation.
  2. Detail the Hardware Impact: Specify supported architectures, boards, SPI controller used, and any necessary board configuration updates.
  3. Address Documentation: Update the Kconfig file and consider adding documentation in the docs/ directory on how to use the driver.
  4. Provide Complete Testing Logs: Include "before" logs, and in the "after" logs, show specific accelerometer and gyroscope readings. State the target used for testing (architecture, board, configuration).
  5. Link to a NuttX Issue: If one doesn't exist, create one to track the feature request and link it in the PR.

By addressing these weaknesses, the PR will be significantly stronger and more likely to be accepted.

@xiaoxiang781216
Copy link
Contributor

@JerrySlhao please squash your patch into one.

@xiaoxiang781216
Copy link
Contributor

please try:
git rebase --interactive HEAD~5...HEAD
and change pick to squash

no1wudi and others added 21 commits January 10, 2025 22:36
Add a new guide documenting how to integrate Rust with NuttX, including:
- Prerequisites and supported platforms
- Setup instructions for Rust toolchain
- Required NuttX configurations
- Example build and run instructions for RISCV32 target

The guide provides an experimental but working example of running
a Rust application on NuttX using the rv-virt:nsh board.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
 This commit cleans up redundant header file includes throughout the codebase.
 The changes include:

 - Removing duplicate #include directives that were present in the same file
 - Consolidating includes that were split across multiple lines unnecessarily
 - Removing unused includes that were no longer needed
 - Fixing some formatting issues with includes

 The changes improve code organization and maintainability by:
 - Reducing unnecessary dependencies
 - Making include dependencies more explicit
 - Following consistent include patterns
 - Removing dead code

 No functional changes are made - this is purely a code cleanup commit.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
…T_Conf.h

Signed-off-by: hujun5 <hujun5@xiaomi.com>
Fix crashes with "popen" example.

```
dump_tasks:    PID GROUP PRI POLICY   TYPE    NPX STATE   EVENT      SIGMASK          STACKBASE  STACKSIZE      USED   FILLED    COMMAND
dump_tasks:   ----   --- --- -------- ------- --- ------- ---------- ---------------- 0x800525e0      2048      1016    49.6%    irq
dump_task:       0     0   0 FIFO     Kthread -   Ready              0000000000000000 0x80056550      2032      1168    57.4%    Idle_Task
dump_task:       1     0 224 RR       Kthread -   Waiting Semaphore  0000000000000000 0x80057500      1968       768    39.0%    hpwork 0x80051470 0x800514b8
dump_task:       2     0 100 RR       Kthread -   Waiting Semaphore  0000000000000000 0x80057e48      1960       720    36.7%    lpwork 0x80051400 0x80051448
dump_task:       3     3 100 RR       Task    -   Waiting Semaphore  0000000000000000 0x80058ca0      3024      3008    99.4%!   nsh_main
dump_task:       4     4 100 RR       Task    -   Ready              0000000000000000 0x8005a2f0      2000      1376    68.8%    popen
riscv_exception: EXCEPTION: Load access fault. MCAUSE: 0000000000000005, EPC: 000000008000594e, MTVAL: fffffffffffffffc
riscv_exception: PANIC!!! Exception = 0000000000000005
```
when accept conn timeout, only accept conn itself should handle the event
(send TCP_RESET), and there is no need to notify the listening conn.
otherwise, the server's poll will return with POLLERR and POLLHUP.
this may cause some applications to execute incorrect logic in the future.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
- Replace direct string comparisons with regex pattern matching for ARCHCPUEXTFLAGS
- Change from using LLVM_CPUFLAGS list to setting LLVM_CPUTYPE directly
- Simplify CPU type detection logic while maintaining same functionality
- Use more consistent string variable naming convention

This change makes the CPU type detection more flexible and maintainable
while keeping the same behavior for supported RISC-V configurations.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Added the ability to set sampling rate for goldfish

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
This adds a driver for the Bosch BMI088 IMU sensor.
The driver supports spi.

Signed-off-by: jerryslhao <jerryslhao@gmail.com>
The method is the same as the method of saving the current DAIF state of the thread
It will pave the way for the future implementation of hwasan's memory management
Allows each thread to independently control the mte switch function

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
Used the STM32H7 as a reference.

Removed APB enabling from stm32h5xx_rcc.c. This is done in timer initialization, like STM32H7.

Also removed LPTIM. Will add later.

tim_lowerhalf: Timers 9, 10, and 11 removed. Timers 15,16, and 17 added.

Removed low-power timers from Kconfig. Not implemented yet.

Style Updates

Added stm32_tim_enable and stm32_tim_disable to Timer operations.
Reformatted the FPU options table to use a clearer markdown-style table format
with proper alignment and column headers. Added visual separators (~~~) to make
the table stand out from surrounding code. Improved consistency in column widths
and fixed line wrapping for better readability.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Added LLVM-specific configuration variables to ARM architecture CMake files:
- LLVM_ARCHTYPE for architecture variant (thumbv6m, thumbv7a, etc)
- LLVM_CPUTYPE for CPU target (cortex-m0, cortex-a5, etc)
- LLVM_ABITYPE for ABI (eabi/eabihf)

These changes enable LLVM/Clang toolchain support while maintaining
compatibility with existing GCC configurations. The LLVM variables
are set based on the same architecture/CPU/FPU configurations used
for GCC flags.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
With today's master, according to up_check_tcbstack(),
the thread consumes 2432 bytes with examples/popen.
…tered while client calls close for the tty

Make sure that the cdcacm is disconnected before the usbdev gets unregistered.

Also, check if the device is connected or not in cdcuart_txempty (uart_txempty). Otherwise there may be a crash during uart_tcdrain, called in tty close path, if the usbdev unregistration happens during the loop.

This issue can be triggered by monitoring the cable connection status in one thread, sending BOARDIOC_USBDEV_DISCONNECT if the usb cable is detached. In another thread close the ttyACM.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
…ng files:

arch/arm/src/armv7-a/arm_l2cc_pl310.c
arch/arm/src/armv7-r/arm_l2cc_pl310.c
arch/arm/src/armv8-r/arm_l2cc_pl310.c

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
Changed the LLVM architecture type from thumbv7 to thumbv7a in
Toolchain.defs to better match the ARMv7-A architecture specification.

This change ensures proper code generation and optimization for
Cortex-A series processors when using the Thumb instruction set.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
    arch/arm/src/am335x/am335x_can.c
    arch/arm/src/am335x/am335x_gpio.c
    arch/arm/src/am335x/am335x_i2c.c
    arch/arm/src/am335x/am335x_irq.c
    arch/arm/src/am335x/am335x_serial.c
    arch/arm64/src/imx9/imx9_gpio.c
    arch/arm64/src/imx9/imx9_lpi2c.c
    arch/arm64/src/imx9/imx9_lpspi.c
    arch/arm64/src/imx9/imx9_usbdev.c
    arch/x86_64/src/intel64/intel64_tsc_tickless.c

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
…armv8-m.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
@github-actions github-actions bot added the Area: Documentation Improvements or additions to documentation label Jan 10, 2025
@github-actions github-actions bot added Area: Bluetooth Area: Networking Effects networking subsystem Arch: arm Issues related to ARM (32-bit) architecture Arch: arm64 Issues related to ARM64 (64-bit) architecture Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Arch: simulator Issues related to the SIMulator Arch: x86_64 Issues related to the x86_64 architecture Arch: xtensa Issues related to the Xtensa architecture Area: Drivers Drivers issues Area: OS Components OS Components issues Area: Audio Area: USB Board: arm Board: renesas Board: risc-v Board: simulator Board: xtensa labels Jan 10, 2025
@JerrySlhao JerrySlhao closed this Jan 10, 2025
@JerrySlhao JerrySlhao reopened this Jan 10, 2025
@JerrySlhao JerrySlhao closed this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: arm Issues related to ARM (32-bit) architecture Arch: arm64 Issues related to ARM64 (64-bit) architecture Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Arch: simulator Issues related to the SIMulator Arch: x86_64 Issues related to the x86_64 architecture Arch: xtensa Issues related to the Xtensa architecture Area: Audio Area: Bluetooth Area: Documentation Improvements or additions to documentation Area: Drivers Drivers issues Area: Networking Effects networking subsystem Area: OS Components OS Components issues Area: Sensors Sensors issues Area: USB Board: arm Board: renesas Board: risc-v Board: simulator Board: xtensa Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.
Projects
None yet
Development

Successfully merging this pull request may close these issues.