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.

RTOS/PROCESSOR-SDK-AM335X: NEON assembler function issue

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi, 

I've run into a problem. When I'm trying to add a basic neon assembler function from ne10 project my program crash in a weird spot. It completes the ne10 function fine and after it works for only for a couple cycles and then pauses. When I comment out the ne10 add function everything works fine. The function doesn't produce the crash just after running couple line of codes it magically stops. I'm not sure why. Maybe I have to initialize somehow the neon or do something like that. I have to HWI and all the do is printf buffer 0/1 nothing special. It's really weird if the program would crash right after my ne10 function everything would suggest the assembler function cause the problem now I'm not sure what is the problem. Can anybody help?

  • What software is this? Please provide full details.
  • I'm using SYSBIOS TI RTOS. All my application does is:

    1.Init Board:

    Board_initCfg boardCfg;

    boardCfg = BOARD_INIT_PLL| BOARD_INIT_MODULE_CLOCK | BOARD_INIT_DDR | BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_UART_STDIO;

    Board_init(boardCfg);
    UART_printf("\nBoard init!\n");

    2. START SYSBIOS

    3. Add 2 vectors (each with four elements) using neon function and printf the result

    4. Init pru:
    /* Creates handle for PRUICSS instance */
    handle = PRUICSS_create(pruss_config, instance);
    //PRUICSS_HwAttrs const *hwAttrs = handle->hwAttrs;

    PRUICSS_pinMuxConfig(handle, 0x1); /* PRUSS pinmuxing */

    PRUICSS_pruDisable(handle, PRUICCSS_PRU0);
    PRUICSS_pruDisable(handle, PRUICCSS_PRU1);

    UART_printf("\nPRU beggin to load app!\n");

    PRUICSS_setPRUBuffer(handle, PRUICCSS_PRU0, PRU0buff, 8192);
    PRUICSS_setPRUBuffer(handle, PRUICCSS_PRU1, PRU1buff, 8192);

    PRUICSS_enableOCPMasterAccess(handle);

    PRUICSS_IntcInitData pruss_intc_initdata = PRUSS_INTC_INITDATA;
    PRUICSS_pruIntcInit(handle, &pruss_intc_initdata);

    PRUICSS_pruExecProgram(handle, PRUICCSS_PRU0);
    PRUICSS_pruExecProgram(handle, PRUICCSS_PRU1);

    PRUICSS_pruEnable(handle, PRUICCSS_PRU0);
    PRUICSS_pruEnable(handle, PRUICCSS_PRU1);

    5. Execulte the HWI functions which are basic printf functions:

    void buffor0_Handler(UArg arg0)
    {
    PRUICSS_pruClearEvent(handle, 18);
    UART_printf("buffor0\n");
    }

    void buffor1_Handler(UArg arg0)
    {
    PRUICSS_pruClearEvent(handle, 19);
    UART_printf("buffor1\n");
    }


    When I dont execute neon function (3.) everything works fine and I get on the console infinite signes
    Buffor 0
    Buffor 1
    But when I want to use neon functio something crash
  • Ok, I found my bug. I'm new to assembly and I start my code by pushing form stack r5 r6 and r7:

    push {r5}
    push {r6}
    push {r7}
    mov r5, r2
    ...(here is the rest of the code but not important for the problem)

    and I end it up with:

    mov r0, #0
    bx lr

    I forgot to pop r5, r6, r7 so my end of code should look like

    pop {r5}
    pop {r6}
    pop {r7}
    mov r0, #0
    bx lr

    probably the r5 r6 or r7 register get stock and the rest of my code couldn't use it. If someone could leave a comment about what exactly happen I would appreciate it.