FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6356 Discussions

mmu libm error in atan2

Altera_Forum
Honored Contributor II
921 Views

I'm using nios2-linux-20100621.tar with my 3C120 Dev Board (ghrd.sof) and my statically compiled application is getting a segfault when I use the atan2 function in the math library from the binary mm toolchain. 

 

root:/tmp> ./atan2_test 0 1 

y = 0.000000 

x = 1.000000 

fabs (0.000000 / 1.000000) = 0.000000 

atan (0.000000 / 1.000000) = 0.000000 

atan (fabs(0.000000 / 1.000000)) = 0.000000 

atan2 (0.000000, 1.000000) = 0.000000 

root:/tmp> ./atan2_test 1 -1 

y = 1.000000 

x = -1.000000 

fabs (1.000000 / -1.000000) = 1.000000 

atan (1.000000 / -1.000000) = -0.785398 

atan (fabs(1.000000 / -1.000000)) = 0.785398 

SEGV 

 

Although the atan function seems to work, it appears that the atan2 function dies trying to call it. We've also had memory leaks with printf when using %d or %f format specifiers. 

 

To get past this, I've been reading all the threads about the mmu toolchain and it does not appear that anyone has ever successfully recompiled the mmu toolchain. Is this the case? I've seen a few notes that a common toolchain is coming but they were old (2009?). Can anyone help point me to a resource on how to rebuild the mmu toolchain?
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
206 Views

Hi, 

 

Any luck getting the atan2 to work? I also having same difficulty. 

 

 

Moganesh
0 Kudos
Reply