03-31-2024 08:02 AM
I have the BHI360 hooked up to the BMM350 on a custom PCB. Everything seems to work fine except for interrupts in some cases. The firmware download works, it boots properly returns valid product id, version, etc. and the selftest for the magnetometer, accelerometer, and gyro all work (BHY2_PHYS_SENSOR_ID_ACCELEROMETER, BHY2_PHYS_SENSOR_ID_GYROSCOPE, BHY2_PHYS_SENSOR_ID_MAGNETOMETER)
I'm using the BHI360_BMM350C.fw.h from Coines 2.8.8 (.h is 820kb)
Im using the sensor in the quaternion example which is ultimately BHY2_SENSOR_ID_RV, but have also tried the euler example.
I get Meta events, but don't get any interrupts that drive actual data events. Im on an nrf5340 and my interrupt config is:
hintr_ctrl = (BHY2_ICTL_DISABLE_STATUS_FIFO | BHY2_ICTL_DISABLE_DEBUG | BHY2_ICTL_ACTIVE_LOW);
slt = bhy2_set_host_interrupt_ctrl(hintr_ctrl, &bhy2);
If I set the sensor config for just the accelerometer I do get interrupts, but get nothing for quaternions or euler.
Any ideas or thoughts?
03-31-2024 12:47 PM
Hi, not a solution but can you share your code for the BHI360 firmware uploading & basic booting?
We are trying to use BHI360 Shuttle Board for BHI360 & BMM350 & BMP580, but we are constantly failling.
03-31-2024 05:53 PM - edited 03-31-2024 08:54 PM
Sure, I am using the code exactly as it is in euler and quaternion and other examples. The BHI360 has no flash, so its only the ram upload. Also I'm using the BHI360_BMM350C.fw.h file. All of this is in the Coines 2.8.8 release under examples/bhy2/examples.
rslt = bhy2_init(BHY2_SPI_INTERFACE,
BHI360_msg_read,
BHI360_msg_write,
BHI360_delay_us,
BHI360_RD_WR_LEN,
NULL,
&bhy2);
print_api_error(rslt, &bhy2);
rslt = bhy2_soft_reset(&bhy2);
print_api_error(rslt, &bhy2);
// Check for a valid product ID.
rslt = bhy2_get_product_id(&product_id, &bhy2);
print_api_error(rslt, &bhy2);
if (product_id != BHY2_PRODUCT_ID)
{
printf("Product ID read %X. Expected %X\r\n", product_id, BHY2_PRODUCT_ID);
}
else
{
printf("BHI360 found. Product ID read %X\r\n", product_id);
}
// Check the interrupt pin and FIFO configurations. Disable status and debug.
//YOU MAY NOT NEED ACTIVE LOW DEPENDING ON THE HOST MCU
hintr_ctrl = (BHY2_ICTL_DISABLE_STATUS_FIFO | BHY2_ICTL_DISABLE_DEBUG |
BHY2_ICTL_ACTIVE_LOW);
rslt = bhy2_set_host_interrupt_ctrl(hintr_ctrl, &bhy2);
print_api_error(rslt, &bhy2);
// Configure the host interface.
hif_ctrl = 0;
rslt = bhy2_set_host_intf_ctrl(hif_ctrl, &bhy2);
print_api_error(rslt, &bhy2);
// Check if the sensor is ready to load firmware.
rslt = bhy2_get_boot_status(&boot_status, &bhy2);
print_api_error(rslt, &bhy2);
if (boot_status & BHY2_BST_HOST_INTERFACE_READY)
{
uint8_t sensor_error;
int8_t temp_rslt;
printf("Loading firmware.\r\n");
// THE upload_firmware routine, as is most of this code in euler.c and quaternion.c
upload_firmware(boot_status, &bhy2);
rslt = bhy2_get_kernel_version(&version, &bhy2);
print_api_error(rslt, &bhy2);
if ((rslt == BHY2_OK) && (version != 0))
{
printf("Boot successful. Kernel version %u.\r\n", version);
03-31-2024 09:06 PM
At length I found this post:
That appears to be exactly what is happening with my board. The potential answer is on page 2 and shows that the bhi360 will work with the 350 using the current firmware but if and only if the JTAG_DIO pin on the 360 is wired to the BMM350 interrrupt.
The board was reviewed by bosch and we believe it is wired correctly, attaching for further review. That would indicate to me that the BHI360_BMM350C.fw.h in the COINES 2.8.8 is buggy.?
Help!
04-06-2024 03:43 PM
Hi fcovely,
We have the following suggestions:
1. Ensure that you strictly refer to the schematic diagram of BHI360 Shuttle Board 3.0(https://www.bosch-sensortec.com/media/boschsensortec/downloads/shuttle_board_flyer/application_board...);
2. Ensure that your host MCU can respond correctly to interrupts;
3. I have also uploaded an example of BHI360+BMM350 on STM32 for your reference, enabling the following macro definitions in the user-define.h file:
#define USE_BHI260
#define BHI260AP_BMM150_9DOF
#define BHI260_FIFO_INTERRUPT_MODE
4.The firmware BHI360_BMM350C.fw.h has been verified on the reference board to function properly. You can use the BHI360 sensor API and firmware on GitHub as they may update faster. https://github.com/boschsensortec/BHY2_SensorAPI