UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer cpandya90
Observer
4,358 Views
Registered: ‎05-12-2017

AXI CDMA data transfer stops after some transfers

Jump to solution

Hi

 

I developed a project that transfers data from block Ram to DDR using CDMA in Simple transfer mode.  Block design of my project is given below. Address mapping is also given.

bd.PNG

adressmp.PNG

By using this design, I am transferring block of data from block ram to ddr using cdma in simple transfer mode. I modified xaxicdma_example_simple_poll.c file. In this code file, I am initializing 1K of block ram data and then doing transfer using cdma and at last I also check the data at ddr locations. I am doing same thing for 16 times to transfer 16k of data from block ram to ddr.

 

When I was doing 8k data transfer, It was working fine, but when I did for 16K data transfer it stoped at 0x40002D03. It doesn't go beyond this address. I am also attaching my code file and parameter file. It was working fine with 1K, 2K, 4K and 8K of data transfers.

Can anyone help me with this problem.
Thanks in advance.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Scholar hbucher
Scholar
6,327 Views
Registered: ‎03-22-2016

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

@cpandya90  Well your program/binary, the assembly code that executes, starts at 0x100000.

You are writing over your program code.

This is not memory you can use/write - unless you are planning a crash on purpose.

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
12 Replies
Scholar hbucher
Scholar
4,325 Views
Registered: ‎03-22-2016

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

@cpandya90

Maximum transfer length supported by hardware is 0x7FFFFF (8,388,608 bytes).

See xaxicdma_hw.h

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
axidmalen.png
Highlighted
Observer cpandya90
Observer
4,294 Views
Registered: ‎05-12-2017

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

Thank you @hbucher

I am transferring only 1K of data each time. I am calling XAxiCdma_SimpleTransfer() function each time to transfer 1K of data. After competition of this transfer, I am again doing another 1K of data transfer with different address by calling same function. I am repeating this procedure to do data transfer of 16K. 
Each time I am transferring 1K of data which is less than size you mentioned.

 

Can you help me out?

0 Kudos
Scholar hbucher
Scholar
4,290 Views
Registered: ‎03-22-2016

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

@cpandya90 What happens if you comment out the SrcAddress/DestAddress increment, ie does all transfers from/to the same address?

Look at the link script to see how much memory you have available. Perhaps you're invading some peripheral area.

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
Observer cpandya90
Observer
4,282 Views
Registered: ‎05-12-2017

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

Thanks @hbucher

 

I tried as you said. I tried to transfer 1k of data 16 times at the same locations. It worked fine.

 

As you said I also checked linker script and the starting of this script is as shown below.

/*******************************************************************/
/*                                                                 */
/* This file is automatically generated by linker script generator.*/
/*                                                                 */
/* Version:                                 */
/*                                                                 */
/* Copyright (c) 2010 Xilinx, Inc.  All rights reserved.           */
/*                                                                 */
/* Description : Cortex-A9 Linker Script                          */
/*                                                                 */
/*******************************************************************/

_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x2000;
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x2000;

_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 1024;
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 2048;
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : 1024;
_FIQ_STACK_SIZE = DEFINED(_FIQ_STACK_SIZE) ? _FIQ_STACK_SIZE : 1024;
_UNDEF_STACK_SIZE = DEFINED(_UNDEF_STACK_SIZE) ? _UNDEF_STACK_SIZE : 1024;

/* Define Memories in the system */

MEMORY
{
   axi_bram_ctrl_0_S_AXI_BASEADDR : ORIGIN = 0x40000000, LENGTH = 0x1000
   ps7_ddr_0_S_AXI_BASEADDR : ORIGIN = 0x100000, LENGTH = 0x1FF00000
   ps7_ram_0_S_AXI_BASEADDR : ORIGIN = 0x0, LENGTH = 0x30000
   ps7_ram_1_S_AXI_BASEADDR : ORIGIN = 0xFFFF0000, LENGTH = 0xFE00
}

/* Specify the default entry point to the program */

ENTRY(_vector_table)

/* Define the sections, and where they are mapped in memory */

Length is only 4K. so I modified linker script and staring lines of new script is as shown below

_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x400;
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x400;

_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 1024;
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 2048;
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : 1024;
_FIQ_STACK_SIZE = DEFINED(_FIQ_STACK_SIZE) ? _FIQ_STACK_SIZE : 1024;
_UNDEF_STACK_SIZE = DEFINED(_UNDEF_STACK_SIZE) ? _UNDEF_STACK_SIZE : 1024;

/* Define Memories in the system */

MEMORY
{
   axi_bram_ctrl_0_S_AXI_BASEADDR : ORIGIN = 0x40000000, LENGTH = 0x4000
   ps7_ddr_0_S_AXI_BASEADDR : ORIGIN = 0x100000, LENGTH = 0x1FF00000
   ps7_ram_0_S_AXI_BASEADDR : ORIGIN = 0x0, LENGTH = 0x30000
   ps7_ram_1_S_AXI_BASEADDR : ORIGIN = 0xFFFF0000, LENGTH = 0xFE00
}

/* Specify the default entry point to the program */

ENTRY(_vector_table)

/* Define the sections, and where they are mapped in memory */

Now I changed this script, SDK is giving some errors.error.PNG

 

Can you Help me out?

0 Kudos
Scholar hbucher
Scholar
4,279 Views
Registered: ‎03-22-2016

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

@cpandya90 Sure. I said LOOK not MODIFY it :)

Just get the script to the original state. 

What I suggest you to do is to create a STATIC variable with the size you want in the body of your main. This way you dont have to be looking into addresses etc.

For example you can do something like

 

static uint8_t SOURCE_MEM[32*1024*1024]; 
static uint8_t TARGET_MEM[32*1024*1024];
int main() { /* Use both here */ }

and then use these as your test memory.

The advantage is that if there is not space available, it will throw you a linker error.

See if it works.

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
Observer cpandya90
Observer
4,275 Views
Registered: ‎05-12-2017

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

Thanks @hbucher for replying me.

 

I made changes in linker script as per previous. I also tried as you said to use static variable and use as test memory. But I am getting same error as previous. This doesn't work well. 
When I was looking at terminal to see output, I can see that processor can write from 0x40000000 to 0x40002BFF locations in block ram and from 0x00100000 to 0x00102BFF location in ddr memory and cdma can transfer up to these locations. While writing next 1k of data in block ram, processor is not able to write data on 0x40002D14 and onward. I can see processor can write data on 0x40002D13 location of block Ram.

terinal.PNG

I am not sure why processor isn't able to write data above mentioned location and onward?  

0 Kudos
Scholar hbucher
Scholar
4,271 Views
Registered: ‎03-22-2016

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

@cpandya90 On your application explorer (see pic), can you double click on your ELF and copy/paste here its contents (right pane).

I think you are trampling over some important memory.

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
elf.PNG
Observer cpandya90
Observer
4,269 Views
Registered: ‎05-12-2017

Re: AXI CDMA data transfer stops after some transfers

Jump to solution
architecture: arm, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00100000

Program Header:
    LOAD off    0x00008000 vaddr 0x00100000 paddr 0x00100000 align 2**15
         filesz 0x0000c00c memsz 0x000119a0 flags rwx
private flags = 5000202: [Version5 EABI] [soft-float ABI] [has entry point]

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00003af4  00100000  00100000  00008000  2**6
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .init         00000018  00103af4  00103af4  0000baf4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .fini         00000018  00103b0c  00103b0c  0000bb0c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  3 .rodata       00000524  00103b24  00103b24  0000bb24  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .data         0000049c  00104048  00104048  0000c048  2**3
                  CONTENTS, ALLOC, LOAD, DATA
  5 .eh_frame     00000004  001044e4  001044e4  0000c4e4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .mmu_tbl      00004000  00108000  00108000  00010000  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .init_array   00000008  0010c000  0010c000  00014000  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  8 .fini_array   00000004  0010c008  0010c008  00014008  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  9 .ARM.attributes 00000033  0010c00c  0010c00c  0001400c  2**0
                  CONTENTS, READONLY
 10 .bss          00000194  0010c00c  0010c00c  0001400c  2**2
                  ALLOC
 11 .heap         00002000  0010c1a0  0010c1a0  0001400c  2**0
                  ALLOC
 12 .stack        00003800  0010e1a0  0010e1a0  0001400c  2**0
                  ALLOC
 13 .debug_info   000061d9  00000000  00000000  0001403f  2**0
                  CONTENTS, READONLY, DEBUGGING
 14 .debug_abbrev 0000199e  00000000  00000000  0001a218  2**0
                  CONTENTS, READONLY, DEBUGGING
 15 .debug_aranges 00000278  00000000  00000000  0001bbb8  2**3
                  CONTENTS, READONLY, DEBUGGING
 16 .debug_macro  0000313c  00000000  00000000  0001be30  2**0
                  CONTENTS, READONLY, DEBUGGING
 17 .debug_line   00002050  00000000  00000000  0001ef6c  2**0
                  CONTENTS, READONLY, DEBUGGING
 18 .debug_str    0000e6fa  00000000  00000000  00020fbc  2**0
                  CONTENTS, READONLY, DEBUGGING
 19 .comment      00000030  00000000  00000000  0002f6b6  2**0
                  CONTENTS, READONLY
 20 .debug_frame  00000e6c  00000000  00000000  0002f6e8  2**2
                  CONTENTS, READONLY, DEBUGGING
 21 .debug_loc    00003326  00000000  00000000  00030554  2**0
                  CONTENTS, READONLY, DEBUGGING
 22 .debug_ranges 000003d0  00000000  00000000  0003387a  2**0
                  CONTENTS, READONLY, DEBUGGING

Thanks @hbucher

0 Kudos
Scholar hbucher
Scholar
4,267 Views
Registered: ‎03-22-2016

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

@cpandya90 Just look at the first line. Address 0x100000 is the beginning of .text section (code). 

You are writing on top of your application code. I wonder how it even worked for your previous runs.

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Observer cpandya90
Observer
2,988 Views
Registered: ‎05-12-2017

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

Thanks @hbucher

Can you throw more light on this. Because I am not aware of this type of situation.

My source location is 0x40000000 onward and destination location is 0x00100000. Each time I am transferring on 0x00000400 bytes of data. 

 

0 Kudos
Scholar hbucher
Scholar
6,328 Views
Registered: ‎03-22-2016

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

@cpandya90  Well your program/binary, the assembly code that executes, starts at 0x100000.

You are writing over your program code.

This is not memory you can use/write - unless you are planning a crash on purpose.

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
Observer cpandya90
Observer
2,983 Views
Registered: ‎05-12-2017

Re: AXI CDMA data transfer stops after some transfers

Jump to solution

Thank you so much @hbucher

I got your point. I have changed my destination memory location from 0x00100000 to 0x10000000. It works with 16K of data transfer from block ram to ddr.
Thanks once again.