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.

DSP2ARM communication driver can't insmod

DSP2ARM.rar

Hi, all

I want to achieve Dual Core Communication between DSP Core0 and ARM Core0. In ARM side, run Linux OS while DSP side run No OS program. Dual core communication finished by configure interrupts each side. In ARM side, I need configure interrupts through Linux driver. In my driver, I have configured the GIC-400 registers for IPCGR0, which is 4# SPI event. The configuration of GIC register is according to the NO OS IPC demo downloaded from TI forum, which is work fine.

I have compiler my driver by using cross compiler within Linux kernel 4.1.8 come with mcsdk3.1.4.7 successfully, however, when I install driver by using command

insmod ./DSP2ARMdri.ko

Linux console is can't work anymore, it seem that Linux system halted. I can't find the reason of this.

Is my driver wrong, or the configuration of GIC-400 is wrong in Linux driver.

(1) I build the kernel by using the configuration file in /arch/arm/configs/tisdk-k2k-deconfig

(2)SDK version:MCSDK3.1.4.7

(3)Driver source file is DSP2ARMdri.c and DSP2ARMdri.h

Thanks in advance

------------------------------------

Yours,

xiaop

  • Hi Xiaop,

    I've forwarded this to the software experts. Their feedback should be posted here.

    BR
    Tsvetolin Shulev
  • Hi Xiaop,

    Can you use printk's in your module to see where the hang happens at?

    It might be risky to reprogram the GIC during runtime, as Linux is using it.

    Regards,

    Mike

  • Hi, Mike

    First of all, thank for your response. 

    I have test my driver in steps below:

    (1) Insmod DSP2ARMdri.ko

    (2)run dsp demo by using mpmcl

    (3)run linux user space program named armapp

    However, when I implement the 1st step, it can't work anymore. The linux console is halt, and can't excute any

    command anymore, just print some unexceptly message. Here is the print mesage when I insmod the driver.

    It it clear the driver has finish the initialization process, however then it is wrong, which I can't figure it out. I want

    to know whether I can solve the problem. I think there is a risky between my driver and the cofiguration within IPC

    components.

    Do you have any advice to archieve the communication between ARM and DSP in this way?

    Here I post my linux user space source file here

    armapp.c
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <unistd.h>
    #include <fcntl.h>
    
    #include <sys/stat.h>
    #include <sys/mman.h>
    #include <sys/ioctl.h>
    #include <sys/types.h>
    
    /* Using 'k' as magic number */
    #define ARM2DSP_IOC_MAGIC   'k'
    /* Give DSP interrupt commmand */
    #define ARM2DSP_IOC_IRQ     _IO(ARM2DSP_IOC_MAGIC,0)
    /* Max ioctl command number */
    #define ARM2DSP_IOC_MAXNR   1
    
    int main (void)
    {
    	int ret = 0;
    	unsigned char irqno = 0;
    
    	char* dsp2arm_dev = "/dev/DSP2ARM_DEVICE";
    	int dsp2arm_fd = 0;
    
    	/* open dsp2arm device */
    	dsp2arm_fd = open(dsp2arm_dev, O_RDWR);
    	if (dsp2arm_fd == -1)
    	{
    		printf("Error: cannot open DSP2ARM_DEVICE\n");
    		return -1;
    	}
    
    	/* inform dsp */
    	ret = ioctl(dsp2arm_fd, ARM2DSP_IOC_IRQ, 0);
    	if (ret == -1)
    	{
    		printf("Inform DSP failed!\n");
    		return -1;
    	}
    
    	/* wait dsp interrupt */
    	ret = read(dsp2arm_fd, &irqno, 1);
    	if (ret <= 0)
    	{
    		printf("ARM infomed failed!\n");
    		return -1;
    	}
    	printf("\nARM INFORMED\n");
    	printf("IRQ number is %d\n", irqno);
    
    	return 0;
    }
    

    Yours,

    xiaop