Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Issues Initializing MAX-M10S GNSS on ZephyrRTOS #196

Description

@AarC10

Hello.

Currently trying to integrate ubxlib into my software which utilizes ZephyrRTOS on an STM32 F446RE. I've worked through a few issues, but my teammate and I seem to be stumped on getting uDeviceOpen to work. At this point, we have ran into a U_ERROR_COMMON_PLATFORM (-8) error code both when trying to use I2C or UART. The -8 error occurs from trying to power on the GNSS and doing the controlled GNSS hot start. Trying to do a GNSS hot start which runs uGnssPrivateSendReceiveUbxMessage yields a U_ERROR_COMMON_DEVICE_ERROR (-10). We can confirm the chip works since we can probe the UART lines and see messages being output from the GPS chip regardless of the software being ran. Can also confirm we were able to communicate with the chip and get GPS data before using Zephyr and ubxlib and were using our own custom drivers and software over I2C. Was hoping to get some support on determining what the issue could be and if there needs to be any improvements to our software, Here is some of our relevant code, debug logs and gdb showing our system state. Thank you for your time.

Calling Code:

int init_maxm10s(gnss_dev_t *dev) {
    int ret = uPortInit();
    if (ret != 0) {
        LOG_ERR("uPortInit() returned %d\n", ret);
        return ret;
    }

    ret = uPortI2cInit();
    if (ret != 0) {
        LOG_ERR("uPortI2cInit() returned %d\n", ret);
        return ret;
    }

    ret = uDeviceInit();
    if (ret != 0) {
        LOG_ERR("uDeviceInit() returned %d\n", ret);
        return ret;
    }

    ret = uDeviceOpen(NULL, &dev->gnssHandle);
    if (ret != 0) {
        LOG_ERR("uDeviceOpen() returned %d\n", ret);
        return ret;
    }

    return 0;

}

Device Tree:

/ {
    cfg-device-gnss {
            compatible = "u-blox,ubxlib-device-gnss";
            status = "okay";
            transport-type = "i2c1";
    //        transport-type = "usart2";
            module-type = "U_GNSS_MODULE_TYPE_M10";
        };

    aliases {
        ubxlib-uart2 = &usart2;
    };
}

&usart2 {
    pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
    pinctrl-names = "default";
    current-speed = <9600>;
    status = "okay";
};

&i2c1 {
    pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
    pinctrl-names = "default";
    status = "okay";
    clock-frequency = <I2C_BITRATE_FAST>;

    max0: maxm10s@42 {
        status = "okay";
        compatible = "u-blox,maxm10s";
        reg = <0x42>;
    };
};

Config:

# U-Blox
CONFIG_GNSS=y
CONFIG_GNSS_SATELLITES=y
CONFIG_GNSS_NMEA0183=y
CONFIG_UBXLIB=y
CONFIG_UBXLIB_GNSS=y

# Need the following for U-Blox as well
CONFIG_INIT_STACKS=y
CONFIG_THREAD_STACK_INFO=y
CONFIG_THREAD_NAME=y
CONFIG_KERNEL_MEM_POOL=y
CONFIG_HEAP_MEM_POOL_SIZE=20000
CONFIG_MINIMAL_LIBC_MALLOC=n

Screenshot_20240204_225315
Screenshot_20240204_230159
Screenshot_20240204_221819

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions