Jump to content

    

Recommended Posts

Уважаемые форумчане!

 

Возникла следующая проблема - есть цикл:

while(i<1000){
            delay(100);
            if(*(SourcePtr+3)==0){
                *(SourcePtr+4)=1;
                *(U32Ptr_DDR3_current++)=*(SourcePtr+7);
                xil_printf("%d \t %d \n", i,*(U32Ptr_DDR3_current));
                i++;
            }
            else{
                *(SourcePtr+4)=0;
            }
        }

где:

volatile u32 * U32Ptr_DDR3 =(volatile u32* )XPAR_S6DDR_0_S0_AXI_BASEADDR; - указатель на базовый адрес DDR3

volatile u32 * SourcePtr = (volatile u32* )XPAR_LTC_2208_AXI_0_BASEADDR;

U32Ptr_DDR3_current = U32Ptr_DDR3; - указатель текущей ячейки

volatile u32 i=0; - счетчик

*(SourcePtr+4) - для сигнализации есть в FIFO данные

 

Так вот, цикл заканчивается на 130 и проц героически умирает, кто-нибудь сталкивался с данной проблемой?

 

Share this post


Link to post
Share on other sites

Вот скрипт, не пойму только почему длина 0x08000000, вместо 7FFFFFF

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

/* Define Memories in the system */

MEMORY
{
  microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl : ORIGIN = 0x00000050, LENGTH = 0x00007FB0
  mcb_ddr3_S0_AXI_BASEADDR : ORIGIN = 0xA8000000, LENGTH = 0x08000000
}

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

ENTRY(_start)

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

SECTIONS
{
.vectors.reset 0x00000000 : {
  *(.vectors.reset)
} 

.vectors.sw_exception 0x00000008 : {
  *(.vectors.sw_exception)
} 

.vectors.interrupt 0x00000010 : {
  *(.vectors.interrupt)
} 

.vectors.hw_exception 0x00000020 : {
  *(.vectors.hw_exception)
} 

.text : {
  *(.text)
  *(.text.*)
  *(.gnu.linkonce.t.*)
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.init : {
  KEEP (*(.init))
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.fini : {
  KEEP (*(.fini))
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.ctors : {
  __CTOR_LIST__ = .;
  ___CTORS_LIST___ = .;
  KEEP (*crtbegin.o(.ctors))
  KEEP (*(EXCLUDE_FILE(*crtend.o) .ctors))
  KEEP (*(SORT(.ctors.*)))
  KEEP (*(.ctors))
  __CTOR_END__ = .;
  ___CTORS_END___ = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.dtors : {
  __DTOR_LIST__ = .;
  ___DTORS_LIST___ = .;
  KEEP (*crtbegin.o(.dtors))
  KEEP (*(EXCLUDE_FILE(*crtend.o) .dtors))
  KEEP (*(SORT(.dtors.*)))
  KEEP (*(.dtors))
  PROVIDE(__DTOR_END__ = .);
  PROVIDE(___DTORS_END___ = .);
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.rodata : {
  __rodata_start = .;
  *(.rodata)
  *(.rodata.*)
  *(.gnu.linkonce.r.*)
  __rodata_end = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.sdata2 : {
  . = ALIGN(8);
  __sdata2_start = .;
  *(.sdata2)
  *(.sdata2.*)
  *(.gnu.linkonce.s2.*)
  . = ALIGN(8);
  __sdata2_end = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.sbss2 : {
  __sbss2_start = .;
  *(.sbss2)
  *(.sbss2.*)
  *(.gnu.linkonce.sb2.*)
  __sbss2_end = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.data : {
  . = ALIGN(4);
  __data_start = .;
  *(.data)
  *(.data.*)
  *(.gnu.linkonce.d.*)
  __data_end = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.got : {
  *(.got)
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.got1 : {
  *(.got1)
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.got2 : {
  *(.got2)
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.eh_frame : {
  *(.eh_frame)
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.jcr : {
  *(.jcr)
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.gcc_except_table : {
  *(.gcc_except_table)
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.sdata : {
  . = ALIGN(8);
  __sdata_start = .;
  *(.sdata)
  *(.sdata.*)
  *(.gnu.linkonce.s.*)
  __sdata_end = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.sbss (NOLOAD) : {
  . = ALIGN(4);
  __sbss_start = .;
  *(.sbss)
  *(.sbss.*)
  *(.gnu.linkonce.sb.*)
  . = ALIGN(8);
  __sbss_end = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.tdata : {
  __tdata_start = .;
  *(.tdata)
  *(.tdata.*)
  *(.gnu.linkonce.td.*)
  __tdata_end = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.tbss : {
  __tbss_start = .;
  *(.tbss)
  *(.tbss.*)
  *(.gnu.linkonce.tb.*)
  __tbss_end = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.bss (NOLOAD) : {
  . = ALIGN(4);
  __bss_start = .;
  *(.bss)
  *(.bss.*)
  *(.gnu.linkonce.b.*)
  *(COMMON)
  . = ALIGN(4);
  __bss_end = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

_SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 );

_SDA2_BASE_ = __sdata2_start + ((__sbss2_end - __sdata2_start) / 2 );

/* Generate Stack and Heap definitions */

.heap (NOLOAD) : {
  . = ALIGN(8);
  _heap = .;
  _heap_start = .;
  . += _HEAP_SIZE;
  _heap_end = .;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

.stack (NOLOAD) : {
  _stack_end = .;
  . += _STACK_SIZE;
  . = ALIGN(8);
  _stack = .;
  __stack = _stack;
} > microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl

_end = .;
}

Share this post


Link to post
Share on other sites

банк памяти 1 мегабит

он имеет длину 0x08000000

адрес последнего байта 0x07ffffff

 

массив 0, 1, 2, 3

имеет длину 4

тут как раз нет вопросов...

 

 

нет ли контроля памяти? в смысле нет ли прерывания или экцепшена что обратились вне области? Текст мне кажется странный тем что Pointer+3

Pointer+7 - такое чувство что вы считаете его чаровым указателем, и обращаетесь в последний байт 32 битного слова, но указатель объявлен как ансигнет инт 32, следовательно все обращения вида Pointer+n - будут двигать на n 32 битных слов, а не на n байт...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this