cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lucas_zyq
Adventurer
Adventurer
1,176 Views
Registered: ‎09-19-2017

sds_alloc can only allocate up to 128KB

Jump to solution

Hello

I created my own SDSoC platform on the DP-8020 board (XCZU2EG-2SFVA625I). I ran a 32x32 matrix multiply-addition example and it worked fine. But when I use sds_alloc to allocate more than 128KB of memory, although it can compile, but the runtime will report an error.

Is this somewhere wrong when I create the SDSoC platform, or is it limited by tools or chips?

Thank you!

0 Kudos
1 Solution

Accepted Solutions
lucas_zyq
Adventurer
Adventurer
1,031 Views
Registered: ‎09-19-2017

后面发现是我的DDR配错了,重新配置过就正常了

View solution in original post

7 Replies
nutang
Moderator
Moderator
1,147 Views
Registered: ‎08-20-2018

Hi @lucas_zyq 

There is no limitation as such.

1. Have you used sds_free() ?

2. What is the error?

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
lucas_zyq
Adventurer
Adventurer
1,140 Views
Registered: ‎09-19-2017

Hi, @nutang 

the test code:

int main(int argc, char **argv)
{
    .......
    printf("----debug-0-----\n");
    signed char *sds_ptr = (signed char *)sds_alloc(sizeof(signed char) * 129* 1024);

    ......
}

Runtime phenomenon:

When I allocate 128×1024 or less, it can run normally. However, when it exceeds 128×1024, it will report an error. Phenomenon: 1. Direct Linux kernel crashes. 2. Output “Internal error: Undefined command: 0 [#1] SMP", the kernel then crashes (when the allocation is far more than 128 × 1024, such as 1024 × 1024)

Thanks!

0 Kudos
nutang
Moderator
Moderator
1,137 Views
Registered: ‎08-20-2018

Hi @lucas_zyq 

Please use sds_free() then it should not happen.

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
lucas_zyq
Adventurer
Adventurer
1,128 Views
Registered: ‎09-19-2017

@nutang ,

I did use sds_free() when I no longer need this memory.

By the way, as long as the program runs to this location and the allocated memory is greater than 128*1024, the kernel collapses.

 

0 Kudos
lucas_zyq
Adventurer
Adventurer
1,125 Views
Registered: ‎09-19-2017

The direct cause of the problem is the size of memory allocated by sds_alloc

0 Kudos
nutang
Moderator
Moderator
1,115 Views
Registered: ‎08-20-2018

Hi @lucas_zyq 

Okay. Got it.

Let me check other possiblities and get back to you.

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
lucas_zyq
Adventurer
Adventurer
1,032 Views
Registered: ‎09-19-2017

后面发现是我的DDR配错了,重新配置过就正常了

View solution in original post