async_adapter_uart pointer fails test

After defining the ADAPTER and initializing UART2 the 
The adapter pointer fails a test on line 287. FATAL: async_adapter_uart2 points to Flash (0x246d4). Linker Error.
This indicates a BUS FAILER.

//1: The device succesfully initializes, and buffer memory is allocated

    // . Initialize UART2 (Modem)
    if (device_is_ready(uart2_dev)) {
        uart_async_adapter_init(async_adapter_uart2, uart2_dev);
        err = uart_callback_set(async_adapter_uart2, uart_cb, (void *)"UART2");
        printk("%d err(%d)\n");
       
        // Allocate and enable RX for UART2
        rx2 = k_malloc(sizeof(*rx2));
        if (rx2) {
            rx2->len = 0;
            err = uart_rx_enable(async_adapter_uart2, rx2->data, sizeof(rx2->data), UART_WAIT_FOR_RX);
            if (err) {
                printk("UART2 RX enable failed: %d", err);
                k_free(rx2);
            } else {
                debug_status |= 1;
            }
        }
    } else {
        printk("%d uart2_dev FAILED\n", __LINE__);
    }

2: In the management thread the adapter 
MANAGEMENT_TRHEAD:
{...

main.c:287: if (((uintptr_t)async_adapter_uart2 < 0x20000000)) {
main.c:288: printk("FATAL: async_adapter_uart2 points to Flash (%p). Linker Error.\n", (void *)async_adapter_uart2);

...

}

main.c:84:UART_ASYNC_ADAPTER_INST_DEFINE(async_adapter_uart2);
main.c:229: uart_async_adapter_init(async_adapter_uart2, uart2_dev);
main.c:230: err = uart_callback_set(async_adapter_uart2, uart_cb, (void *)"UART2");


main.c:237: err = uart_rx_enable(async_adapter_uart2, rx2->data, sizeof(rx2->data), UART_WAIT_FOR_RX);
main.c:287: if (((uintptr_t)async_adapter_uart2 < 0x20000000)) {
main.c:288: printk("FATAL: async_adapter_uart2 points to Flash (%p). Linker Error.\n", (void *)async_adapter_uart2);

main.c:300: * The macro UART_ASYNC_ADAPTER_INST_DEFINE creates a pointer named 'async_adapter_uart2'.
main.c:302: int err = uart_tx(async_adapter_uart2, (const uint8_t *)cmds[i], strlen(cmds[i]), 100000);
270 multi_uart_init err(0)
468 multi_uart_init(): err(0)
[00:00:00.608,245] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.608,245] <inf> fs_nvs: alloc wra: 0, fd0
[00:00:00.608,245] <inf> fs_nvs: data wra: 0, 1c
[00:00:00.640,869] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.640,899] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.640,930] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
[00:00:00.675,537] <inf> bt_hci_core: No ID address. App must call settings_load()
475, err(0) Bluetooth initialized
502 ble_write_thread
FATAL: async_adapter_uart2 points to Flash (0x246d4). Linker Error.
[00:00:00.676,574] <inf> bt_hci_core: Identity: C3:D0:0C:53:F4:92 (random)
[00:00:00.676,605] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x21fb, manufacturer 0x0059
[00:00:00.676,635] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x21fb
486 main(): err(0)

Parents Reply Children
No Data
Related