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.

Can't capture Vps_printf messages to file

Guru 10685 points
Other Parts Discussed in Thread: CCSTUDIO

I'm trying to debug the EZSDK media controller binaries, but I can't get any output from them. Attaching a serial interface is not an option due to the way our design has been laid out.

I've tried to use

/usr/remote_debug_client 0xBF900000 &

for my 1GB design that uses the normal DM8168 memory map but I don't get anything useful. Here is the output:

[c6xdsp ] Remote Debug Shared Memory @ 0xbf900000
[m3video] Remote Debug Shared Memory @ 0xbf905020
[m3vpss ] Remote Debug Shared Memory @ 0xbf90a040
notify_shm_drv_sendevent failed! status = 0xfffffff0
notify_send_event failed! status = 0xfffffff0

notify_shm_drv_sendevent failed! status = 0xfffffff0
notify_send_event failed! status = 0xfffffff0
notify_shm_drv_sendevent failed! status = 0xfffffff0
notify_send_event failed! status = 0xfffffff0

etc

I've also tried these memory addresses in case they work, but they give no output at all:

 0xBFB00000
 0xBFD00000
 0xBFF00000
 0xC0000000

Incidentally, loggerSMDump.out works fine for debugging the OpenMAX side of the MC.

Thanks,
Ralph

  • Hello,

    Are you using the latest version of the EZSDK 5.05.01.04? Could you please provide your boot arguments and more specific the value of notifyk.vpssm3_sva ?

    Regards,

    Pavel

  • Hi Pavel, yes I'm using EZSDK 5.05.01.04.

    notifyk.vpssm3=0xbf900000

    My relevant other boot arguments are:

    mem=364M mem=324M@0x9F900000 vmalloc=500M earlyprintk

    I am loading the VPSS module using:

    modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:1080p-60,dvo2:1080p-60,hdcomp:1080p-60 i2c_mode=0

    Thanks,
    Ralph

  • Can you try with:

    mem=364M@0x80000000 mem=320M@0x9FC00000 vmalloc=500M  notifyk.vpssm3_sva=0xBF900000

    Regards,

    Pavel

  • Hi Pavel, you were correct as I wasn't using the correct second boot argument. I have corrected this to use 320M however it still produces the same results as before.

    Ralph

  • Try with:

    modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:1080p-60,dvo2:1080p-60,hdcomp:1080p-60 i2c_mode=1

    The entire flow should be:

    echo "Loading HDVICP2 Firmware"
    prcm_config_app s
    modprobe syslink
    until [[ -e /dev/syslinkipc_ProcMgr && -e /dev/syslinkipc_ClientNotifyMgr ]]
    do                                                
          sleep 0.5
    done
    firmware_loader $HDVICP2_ID /usr/share/ti/ti-media-controller-utils/dm816x_hdvicp.xem3 start
    echo "Loading HDVPSS Firmware"
    firmware_loader $HDVPSS_ID /usr/share/ti/ti-media-controller-utils/dm816x_hdvpss.xem3 start
    modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:1080p-60,dvo2:1080p-60,hdcomp:1080p-60 i2c_mode=1
    modprobe ti81xxfb vram=0:24M,1:16M,2:6M
    fbset -depth 32 -rgba 8/16,8/8,8/0,0/0
    modprobe ti81xxhdmi

    Regards,

    Pavel

  • Hi Pavel,

    I cannot use the argument change you suggested as my ARM must master the I2C bus, not the media controller, due to the way we have our I2C busses set up.

    Regarding the flow, mine is identical to yours except for these two lines:

    firmware_loader $HDVPSS_ID /tmp/ti-media-controller-utils/dm816x_hdvpss_v4l2.xem3 start -i2c 0
    modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:1080p-60,dvo2:1080p-60,hdcomp:1080p-60 i2c_mode=0

    I don't see myself how changing the I2C arguments will affect the debug statements anyway...

    Ralph

  • Hi Ralph,

    Here we have some threads related to Vps_printf, and how to enable it:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/185162.aspx

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/178312.aspx

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/232736/818376.aspx#818376

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/228678.aspx

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/222543/785599.aspx#785599

    Regards,

    Pavel

  • Hi Pavel,

    Thanks for the links however I've already read most of those and they don't really give anything new. I've tried attaching a JTAG debugger to the ARM to read the memory using CCS. If I connect to the ARM while capture_encode is running and try to read 0xBF900000 using the memory browser it just comes up with "????????????" and says "Target failed to read memory".

    Any more ideas?

    Thanks,

    Ralph

  • Here something similar is discussed:

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/195083.aspx

    For the last question, you can ask in our CCStudio forum:

    http://e2e.ti.com/support/development_tools/code_composer_studio/default.aspx

    BR,

    Pavel

  • Hi Pavel,

    I tried the recommendation in the first thread but it doesn't change anything and in my experience I've not had to do anything like that before to read physical memory.

    I'll post on the CCS forums and see if that gets me anywhere.

    Thanks,
    Ralph

  • Hi Ralph,

    Meanwhile, you can try if this user-space executable will work for you:http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/717/4137.readmem

    #include <stdio.h>
    #include <stdlib.h>
    #include <sys/mman.h>
    #include <fcntl.h>
    #include <stdint.h>
    
    #define MEM_SIZE 4096
    #define MEM_MASK (MEM_SIZE - 1)
    #define MEMORY "/dev/mem"
    
    void memaccess(unsigned int reg_addr, unsigned int *reg_val, int access_width)
    {
    	int fd;
    	void *mem_map, *mem_addr;
    
    	fd = open(MEMORY, O_RDWR|O_SYNC);
    	if(fd < 0) {
    		perror(MEMORY);
    		exit(1);
    	}
    
    	mem_map = mmap(0, MEM_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, reg_addr & ~MEM_MASK);
    
    	if(mem_map == (void*) - 1) {
    		perror("mmap()");
    		exit(1);
    	}
    
    	mem_addr = mem_map + (reg_addr & MEM_MASK);
    
    	if (reg_val)
    		switch(access_width) {
    		case 8:
    			*(uint8_t*)mem_addr = *reg_val;
    			break;
    		case 16:
    			*(uint16_t*)mem_addr = *reg_val;
    			break;
    		case 32:
    			*(uint32_t*)mem_addr = *reg_val;
    			break;
    		default:
    			fprintf(stderr, "Invalid access width!\n");
    		}
    	else
    		switch(access_width) {
    		case 8:
    			printf("0x%02X\n", *(uint8_t*)mem_addr);
    			break;
    		case 16:
    			printf("0x%04X\n", *(uint16_t*)mem_addr);
    			break;
    		case 32:
    			printf("0x%08X\n", *(uint32_t*)mem_addr);
    			break;
    		default:
    			fprintf(stderr, "Invalid access width!\n");
    		}
    }
    
    static void usage(const char *prog)
    {
    	fprintf(stderr, "\nUsage:\t%s [-8|-16|-32] <reg_addr> [value]\n\n\n", prog);
    }
    
    int main(int argc, char *argv[])
    {
    
    	unsigned int reg_addr, reg_val, *reg_val_ptr;
    	char **p;
    	int n, access_width = 32;
    
    	if (argc  < 2) {
    		usage(argv[0]);
    		exit(1);
    	}
    
    	p = argv+1;
    	n = argc-1;
    
    	if ((*p)[0] == '-') {
    		if (!strcmp(*p, "-8"))
    			access_width = 8;
    		else if (!strcmp(*p, "-16"))
    			access_width = 16;
    		else if (!strcmp(*p, "-32"))
    			access_width = 32;
    		else {
    			usage(argv[0]);
    			exit(1);
    		}
    		n--;
    		p++;
    	}
    
    	if (n < 1) {
    		usage(argv[0]);
    		exit(1);
    	}
    
    	reg_addr = strtoul(*p, NULL, 0);
    	p++;
    	n--;
    
    	if (n) {
    		reg_val = strtoul(*p, NULL, 0);
    		reg_val_ptr = &reg_val;
    	}
    	else
    		reg_val_ptr = NULL;
    
    	memaccess(reg_addr, reg_val_ptr, access_width);
    	return 0;
    }

    I can read/write physical memory without CCS with readmem:

    root@dm816x-evm:~# ./readmem 0xBF900000
    0xA9C8B7D6
    root@dm816x-evm:~#

    Regards,

    Pavel

  • Fixed with some help from our TI rep. Apparently I was using the wrong definition of Vps_printf.

  • Hi Ralph,

          I am having the same problem, which address did you use to solve it??

    Thanks in advance,

    -David

  • Search for the definition of Vps_printf in your source files and switch over the "other" one by commenting out the current definition.

  • Hi Ralph, 

           Thanks for your help, I found where Vps_printf is defined and the other similar function that I found was Vps_rprintf, the only difference between them is a System_printf(buf); call at the end of the Vps_printf which is not present in Vps_rprintf.
           Anyway, I tried commenting that part of the code and creating a new firmware for both scenarios with the line and without the line but I am still getting the same error with that address. My goal is to be able to see the debug messages of the hdvpss driver in order to try to find a bug. I am using EZSDK 5.05.02.00 and I tried with addresses:


    1)
    0xBF900000 -> Produce syslink error that you got

    2) 
     0xBFB00000 

     0xBFD00000 
     0xBFF00000

    Produce 

    [c6xdsp ] Remote Debug Shared Memory @ 0x9e400000
    [m3video] Remote Debug Shared Memory @ 0x9e410820
    [m3vpss ] Remote Debug Shared Memory @ 0x9e421040

    but no messages are shown from the VPSS.

    3) I also tried reading the .map file of the vpss firwmare (http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/247984/872309.aspx) which says:

                      bfef0000    0000f060                         : remote_debug_server.oem3 (.bss:extMemNonCache:remoteDebugCoreShm)

    using the  bfef0000 address I got the same output like 2) no messages coming from the VPSS.

    4) Furthermore I have tried running  remote_debug_client.out before to mount the syslink module but the same result is obtained, no messages. 

    I am not using CCS, were you able to get messages without using CCS?

    Any suggestion is really appreciated,

    -David 

  • Hi,

          Any idea about why it doesn't work in the EZSDK?

    Thanks in advance,

    -David

  • Probably because they had the wrong definition uncommented when they built the media controller binaries.

  • Hi Ralph,

         I have access to the code to build the media controller binaries but I don't see that function that you uncommented, just those two that I mentioned before, can you paste here the definition that you are using?

    Thanks

  • Sorry, I can't easily find out where the issue is as I've modified so many files and it's hard to find the exact definition. All I can suggest is search all the header files for "Vps_printf" and try commenting/uncommenting different definitions. Also, look out for any #defines that may need to be set at the top of source files.

    Ralph

  • Hi David,

    I am having a similar problem getting the logs from M3 using remote_debug_client. I have tried the ideas from this thread (and other threads) but I cannot get any proper output.

    Were you able to find the fix and get the messages?

    Thanks,
    Przemek