This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: Boot failed: -22

Part Number: TDA4VM

Tool/software:

Hello TI Adventurers:

Please help... I'm encountering a "Boot failed: -22" during attempts to load and run a very simple application on one of the C66x processors. Main C-code is as follows:

#pragma DATA_SECTION(obs_data, ".data")
#pragma RETAIN(obs_data)

static float obs_data[1000];

int main(void) {

    int _count = 0;
    while (1) {
        _count++;
        obs_data[_count % 1000] = _count % 1000;
    }
    return 0;
}

The C-code is built and linked to a very generic cmd file:

/* 
 * This file is derived from:
 * https://git.ti.com/cgit/processor-sdk/vision_apps/tree/platform/j721e/rtos/c66x_1/linker_mem_map.cmd?h=main
 * and
 * https://git.ti.com/cgit/processor-sdk/vision_apps/tree/platform/j721e/rtos/c66x_1/j721e_linker_freertos.cmd?h=main
 */ 
-stack  0x2000      /* SOFTWARE STACK SIZE */
-heap   0x1000      /* HEAP AREA SIZE      */
--symbol_map _Hwi_intcVectorTable=Hwi_intcVectorTable

MEMORY
{
	/* L2 for C66x_1 [ size 224.00 KB ] */
    L2RAM_C66x_1             ( RWIX ) : ORIGIN = 0x00800000 , LENGTH = 0x00038000
    /* DDR for C66x_1 for Linux resource table [ size 1024 B ] */
    DDR_C66x_1_RESOURCE_TABLE ( RWIX ) : ORIGIN = 0xA6100000 , LENGTH = 0x00001000
    /* DDR for C66x_1 for boot section [ size 1024 B ] */
    DDR_C66x_1_BOOT          ( RWIX ) : ORIGIN = 0xA6200000 , LENGTH = 0x00000400
    /* DDR for C66x_1 for code/data [ size 14.00 MB ] */
    DDR_C66x_1               ( RWIX ) : ORIGIN = 0xA6201000 , LENGTH = 0x00DFFC00
    /* DDR for C66x_1 for Linux IPC [ size 1024.00 KB ] */
    DDR_C66x_1_DMA           ( RWIX ) : ORIGIN = 0xA6000000 , LENGTH = 0x00100000
    /* Memory for IPC Vring's. MUST be non-cached or cache-coherent [ size 32.00 MB ] */
    IPC_VRING_MEM                     : ORIGIN = 0xAA000000 , LENGTH = 0x02000000
    /* Memory for remote core logging [ size 256.00 KB ] */
    APP_LOG_MEM                       : ORIGIN = 0xAC000000 , LENGTH = 0x00040000
    /* Memory for TI OpenVX shared memory. MUST be non-cached or cache-coherent [ size 63.75 MB ] */
    TIOVX_OBJ_DESC_MEM                : ORIGIN = 0xAC040000 , LENGTH = 0x03FC0000
    /* Memory for remote core file operations [ size  4.00 MB ] */
    APP_FILEIO_MEM                    : ORIGIN = 0xB0000000 , LENGTH = 0x00400000
    /* Memory for shared memory buffers in DDR [ size 512.00 MB ] */
    DDR_SHARED_MEM                    : ORIGIN = 0xB8000000 , LENGTH = 0x20000000
    /* DDR for c66x_1 for local heap [ size 16.00 MB ] */
    DDR_C66X_1_LOCAL_HEAP    ( RWIX ) : ORIGIN = 0xDC000000 , LENGTH = 0x01000000
    /* DDR for c66x_1 for Scratch Memory [ size 48.00 MB ] */
    DDR_C66X_1_SCRATCH       ( RWIX ) : ORIGIN = 0xDD000000 , LENGTH = 0x03000000
}

SECTIONS
{
    .text:csl_entry:{}  > DDR_C66x_1
    .text:_c_int00 load > DDR_C66x_1 ALIGN(0x400)
    .text:   > DDR_C66x_1
    .stack:  > DDR_C66x_1
    .const:  > DDR_C66x_1
    .data:   > DDR_C66x_1
}

The A72 running Debian version 5.10.168-ti-arm64-r118 reports the following:

[ 1988.711638] remoteproc remoteproc12: powering up 4d80800000.dsp
[ 1988.711919] remoteproc remoteproc12: Booting fw image dsp12, size 48448
[ 1988.712618] remoteproc remoteproc12: Boot failed: -22

Would someone please help me understand what's going wrong?

  • Hi Steve,

    Could you try to insert your code into the default ipc_echo_test firmware that is known to work?
    Failure can be due to memory mapping or some resource table issue.

    Are you loading the firmware at U-Boot or Kernel?

    - Keerthy

  • Hello Keerthy and Happy Wednesday,

    Many thanks for your time and expertise to help me understand what's going on. The firmware is loaded using the kernel provisions. Although I haven't had a chance to build the ipc_echo_test app (I have to rewrite its constructs to build within the TDA4VM's A72 cores), the /lib/firmware/vision_apps_eaik/vx_app_rtos_linux_c6x_1.out loads and runs great.

    It's gotta be something in the memory map assignments in the cmd file? The C-source has been simplified to the most basic form and strongly typed (that I believe even a toaster could load and run) and yet, no joy... Confused

    #include <stdint.h>
    #include <string.h>
    
    #include <stddef.h>
    
    #include <rsc_types.h>
    
    #pragma DATA_SECTION(obs_data, ".data")
    #pragma RETAIN(obs_data)
    
    static float obs_data[1000];
    
    int main(void) {
        int _count_i32 = 0;
        float _count_s = 0.0f;
        while (1) {
            _count_s = _count_s + 1.0f;
            obs_data[0] = _count_s;
            if (_count_i32 > 1000) {
            	_count_s = 0.0f;
            	_count_i32 = 0;
            }
        }
        return 0;
    }

  • Happy Wednesday evening Keerthy...

    And, a happy one indeed! Figured it out (took long enough, though). The base address for the TDA4VM c66_0 device is not what's listed in the device tree file (k3-j721e-beagleboneai64.dtb, listed as 0xA610'0000), but it's the address encountered in the "./vision_apps/platform/j721e/rtos/c66x_1/linker_mem_map.cmd" file, listed as follows:


    /* DDR for C66x_1 for Linux resource table [ size 1024 B ] */
    DDR_C66x_1_RESOURCE_TABLE ( RWIX ) : ORIGIN = 0xA8100000 , LENGTH = 0x00000400
    /* DDR for C66x_1 for code/data [ size 14.00 MB ] */
    DDR_C66x_1 ( RWIX ) : ORIGIN = 0xA8200400 , LENGTH = 0x00DFFC00

    Phew! Sweat smile Again, many thanks for stepping up to assist!