From f39778a8e85946ba508e415d1aaf17e2daca185b Mon Sep 17 00:00:00 2001 From: jhchun Date: Fri, 28 Aug 2026 09:44:46 +0900 Subject: [PATCH] =?UTF-8?q?Ver=202.0.4=20-=20IMU=20direct=20read/FIFO=20FS?= =?UTF-8?q?R=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - zephyr 포팅본에서 누락됨(주기 측정 시 direct read/FIFO 스케일) - accel FSR = + 4g = gyro FSR = ± 500dps --- src/drivers/imu/imu_i2c.c | 12 ++++++------ src/drivers/imu/imu_i2c.h | 4 ++-- src/main.h | 6 ++++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/drivers/imu/imu_i2c.c b/src/drivers/imu/imu_i2c.c index b8254e2..2aa3f2d 100644 --- a/src/drivers/imu/imu_i2c.c +++ b/src/drivers/imu/imu_i2c.c @@ -394,12 +394,12 @@ int imu_read(int16_t accel[3], int16_t gyro[3]) uint8_t raw[12]; int ret; - // 자이로 설정: ±2000dps FSR, 100Hz ODR - ret = imu_write_reg(REG_GYRO_CONFIG0, 0x09); + // 자이로 설정: ±500dps FSR, 50Hz ODR + ret = imu_write_reg(REG_GYRO_CONFIG0, IMU_CFG_50HZ_500DPS); if (ret) { DBG_PRINTF("[IMU] FAIL — gyro config write (ret=%d)\r\n", ret); return -1; } - // 가속도 설정: ±4g FSR, 100Hz ODR - ret = imu_write_reg(REG_ACCEL_CONFIG0, 0x29); + // 가속도 설정: ±4g FSR, 50Hz ODR + ret = imu_write_reg(REG_ACCEL_CONFIG0, IMU_CFG_50HZ_4G); if (ret) { DBG_PRINTF("[IMU] FAIL — accel config write (ret=%d)\r\n", ret); return -1; } ret = imu_set_data_big_endian(); @@ -447,10 +447,10 @@ int imu_read_with_temperature(int16_t accel[3], int16_t gyro[3], int16_t *temp_c return -EINVAL; } - ret = imu_write_reg(REG_GYRO_CONFIG0, 0x09); + ret = imu_write_reg(REG_GYRO_CONFIG0, IMU_CFG_50HZ_500DPS); if (ret) { DBG_PRINTF("[IMU] FAIL — gyro config write (ret=%d)\r\n", ret); return -1; } - ret = imu_write_reg(REG_ACCEL_CONFIG0, 0x29); + ret = imu_write_reg(REG_ACCEL_CONFIG0, IMU_CFG_50HZ_4G); if (ret) { DBG_PRINTF("[IMU] FAIL — accel config write (ret=%d)\r\n", ret); return -1; } ret = imu_set_data_big_endian(); diff --git a/src/drivers/imu/imu_i2c.h b/src/drivers/imu/imu_i2c.h index 2214552..0c19cfe 100644 --- a/src/drivers/imu/imu_i2c.h +++ b/src/drivers/imu/imu_i2c.h @@ -28,8 +28,8 @@ int imu_init(void); * * 센서 설정 → 전원 ON → 80ms 대기 → 12바이트 읽기 → 전원 OFF * - * @param accel 가속도 XYZ (int16, ±4g, 100Hz) - * @param gyro 자이로 XYZ (int16, ±2000dps, 100Hz) + * @param accel 가속도 XYZ (int16, ±4g, 50Hz) + * @param gyro 자이로 XYZ (int16, ±500dps, 50Hz) * @return 0 성공, 음수 에러 */ int imu_read(int16_t accel[3], int16_t gyro[3]); diff --git a/src/main.h b/src/main.h index a442444..0f50d2e 100644 --- a/src/main.h +++ b/src/main.h @@ -16,9 +16,9 @@ * Firmware identification : Default values, can be overridden by NVS *============================================================================*/ #define HARDWARE_VERSION "VB0HW0000" -#define SERIAL_NUMBER "VBT260300ZZ" +#define SERIAL_NUMBER "VBT2608000Z" #define DEFAULT_PASSKEY "123456" -#define FIRMWARE_VERSION "VBTFW0203" +#define FIRMWARE_VERSION "VBTFW0204" /* * Firmware Version History @@ -26,6 +26,8 @@ * 2026-07-31 | VBTFW0200 | 2.0.0+0 | Initial release * 2026-08-05 | VBTFW0201 | 2.0.1+0 | Added allowlist, fixed bond delete issue * 2026-08-05 | VBTFW0202 | 2.0.2+0 | Added production command(mpd?) + * 2026-08-25 | VBTFW0203 | 2.0.3+0 | Fixed piezo power on/off timing, piezo sweep timing, and BLE settings + * 2026-08-28 | VBTFW0204 | 2.0.4+0 | Align IMU direct read(mbb?) FSR with FIFO scale */ /*==============================================================================