SECURE FAULT when trying to use bma4xx driver

Im trying to use the BMA4xx driver (via i2c) in 2.7.0. The driver seems to init the device ok but I am getting a "SECURE FAULT" as soon as I do a sensor_sample_fetch. Attached is a minimal project to reproduce the issue.

[00:00:00.398,223] <dbg> bma4xx: bma4xx_chip_init: chip_id is 0x90
[00:00:00.404,815] <wrn> bma4xx: Driver tested for BMA422. Check for unintended operation.
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
Found bma4xx@14
[00:00:00.428,955] <err> os: ***** SECURE FAULT *****
[00:00:00.434,661] <err> os:   Invalid entry point
[00:00:00.440,155] <err> os: r0/a1:  0x0001d2d8  r1/a2:  0x0000003b  r2/a3:  0x00000000
[00:00:00.448,852] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000004 r14/lr:  0x00019201
[00:00:00.457,550] <err> os:  xpsr:  0x00000000
[00:00:00.462,768] <err> os: Faulting instruction address (r15/pc): 0x00000000
[00:00:00.470,703] <err> os: >>> ZEPHYR FATAL ERROR 38: Unknown error on CPU 0
[00:00:00.478,637] <err> os: Current thread: 0x2000c858 (main)
[00:00:00.485,137] <err> os: Halting system

CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_SENSOR_ASYNC_API=y
CONFIG_BMA4XX=y

&i2c2 {
    status = "okay";

	bma4xx: bma4xx@14 {
        compatible = "bosch,bma4xx";
        reg = <0x14>;
    };
};

const struct device *const bma400_dev = DEVICE_DT_GET_ANY(bosch_bma4xx);

SENSOR_DT_READ_IODEV(bma400_iodev, DT_COMPAT_GET_ANY_STATUS_OKAY(bosch_bma4xx),
		{SENSOR_CHAN_ACCEL_XYZ, 0});

int main(void)
{
    if (bma400_dev == NULL) {
		printk("\nError: no device found.\n");
		return -1;
	}

    if (!device_is_ready(bma400_dev)) {
		printk("\nError: Device \"%s\" is not ready\n", bma400_dev->name);
		return -1;
	}

    printk("Found %s\n", bma400_dev->name);

    sensor_sample_fetch(bma400_dev); // <<< Crash

    return 0;
}


3107.bma4xx_example.zip

Related