Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BHI360 BMM350 on custom board, firmware and quaternions/euler

    BHI360 BMM350 on custom board, firmware and quaternions/euler

    fcovely
    Established Member

    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?

    4 REPLIES 4

    maxswjeon
    New Poster

    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.

    fcovely
    Established Member

    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);

    fcovely
    Established Member

    At length I found this post: 

    https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/BHI360-BMM350-No-Mag-data-on-custom-boar...

    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!

    BSTRobin
    Community Moderator
    Community Moderator

    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

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist