Why the CMSIS DSP Matrix Multiplication outputs 0 after few iterations?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why the CMSIS DSP Matrix Multiplication outputs 0 after few iterations?

1,857 Views
shreyas123
Contributor III

Hi.

I am using the CMSIS DSP library for multiplying two matrices on the keil mcb 1800 board using MCU Xpresso IDE. I am using the external SDRAM of 16 MB for storing the result.

Matrix "xmat" is 1604*8 and omega_transpose is of size 8*100.....Thus the resulting matrix is of size 1604*100.

I am printing the resulting matrix. I am also printing the row number each time and I find that at 65599 the result becomes 0.00000.

Can someone tell me why this is happening and how to solve it?

Please find attached the screenshot of the error and the code (test3.c).

Thanks

error.png

Labels (1)
0 Kudos
10 Replies

1,566 Views
soledad
NXP Employee
NXP Employee

Hi, 

I want to isolate the issue, could you please try with smaller dimensions of the matrix. I want to check if the is a RAM issue.  Check the linker map file for the RAM used by the variables. 

Regards 

Soledad

0 Kudos

1,566 Views
shreyas123
Contributor III

Hi soledad,

I tried to store a matrix of size 11958*8 in the SDRAM and tried to read it.

I find that the 0.000 starts at elemnt 12831 now.

Please see the attached image. What is the real problem?

error_2.png

0 Kudos

1,566 Views
soledad
NXP Employee
NXP Employee

Hi, 

Seems to be a problem with available RAM. You need to check the linker map file for the RAM used and then play with the heap size.

Regards

Soledad

0 Kudos

1,566 Views
shreyas123
Contributor III

Hi.

I have tried these settings:

Can you please check and see if I am doing anything wrong?linkersetting.png

0 Kudos

1,566 Views
soledad
NXP Employee
NXP Employee

Hi,

There is not necessarily something wrong, you need to play with the RAM values in order you can do your application.  You need to test.

Have a nice day!

Regards 

Soledad

0 Kudos

1,566 Views
shreyas123
Contributor III

Hi,

I tried with different values of RAM from 5MB to 16MB. Nothing helped actually. Still the multiplication result becomes 0 after some iterations.

I also tested with a normal multiplication program(without using CMSIS-DSP) and the result is perfect without any errors.

why is it that the CMSIS is giving such wierd problems.

Please help!!

Thanks

0 Kudos

1,566 Views
soledad
NXP Employee
NXP Employee

Hello,

You mention that smaller dimension matrices 10*10 size, works, have you try with a Square Matrix of the size that you request,  this would be the problem if the RAM it is not fixing the issue.  

0 Kudos

1,566 Views
shreyas123
Contributor III

Hello. 

I tried your suggestion. The bigger sized square matrix didn"t fit in my memory like 1000*1000.

The program works for smaller dimensions of matrices. 

It would be great if you could replicate the issue on your side if possible.

I am really stuck with this. Please help.

If I write my own program for the same multiplication and use SDRAM, there isn"t any issue. But the CMSIS DSP isn"t working for larger matrices.

Thanks

0 Kudos

1,566 Views
soledad
NXP Employee
NXP Employee

Hi,

This confirms what it is detailed in the CMSIS DSP libraries, the Matrix Multiplication only supports square matrix and it is not working with bigger  dimension matrices due to RAM constrains.  Unfortunately CMSIS libraries handle the memory in a different way and this is out of our scope of support.

Have a nice day!

Regards

Soledad

0 Kudos

1,566 Views
shreyas123
Contributor III

Hi soledad

I tried it with smaller dimension matrices 10*10 size.

There is no problem with that at all. It gives me correct output.

Really need your help.

Thanks,

Shreyas

0 Kudos