Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12744 Discussions

Problem with the new Quartus 4.2/Nios2 update

Altera_Forum
Honored Contributor II
1,370 Views

Hello, 

 

I just updated the Quartus 4.2.  

I used the vga streaming example. Compiled the sopc block new, synthesized the whole project again and when I use a simple hello world example the compiler tells me that there is a problem with the DMA c file it tries to include.  

Somehow this has to do with the update, but I have no idea where to start debug the problem. The forum often has good hints. Does anybody have a similar problem?
0 Kudos
10 Replies
Altera_Forum
Honored Contributor II
611 Views

Can you post the compiler error message?

0 Kudos
Altera_Forum
Honored Contributor II
611 Views

What version of the Nios II processor are you using? (before and after the upgrade of Quartus)

0 Kudos
Altera_Forum
Honored Contributor II
611 Views

I changed the original design to include the JTAG-UART and mabye have screwed up the configuration.  

I need to check the design. Funny thing is, that the SOPC and Quartus does not complain.  

My error message in the IDE is  

error: `ALT_DMA_SET_MODE_128' undeclared (first use in this function)[/cygdrive/c/altera/quartus42/sopc_builder/components/altera_avalon_dma/HAL/src/altera_avalon_dma.c] 

 

I upgraded to Quartus4.2 and now also to NiosII 1.01 

Thanks
0 Kudos
Altera_Forum
Honored Contributor II
611 Views

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

I upgraded to Quartus4.2 and now also to NiosII 1.01[/b] 

--- Quote End ---  

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

error: `ALT_DMA_SET_MODE_128&#39; undeclared (first use in this function)[/cygdrive/c/altera/quartus42/sopc_builder/components/altera_avalon_dma/HAL/src/altera_avalon_dma.c][/b] 

--- Quote End ---  

 

If that may be of use: I have the exact same error message with this combination of tools: I did not upgrade to niosII 1.1. Only went from quartus 4.1sp2 to quartus4.2, and this error showed up.  

Actually I noticed that the error pointed to the file altera_avalon_dma.c in the quartus2 directory and not to the file with the same name in the niosII kits folders. This scared me off to remove q4.2 again as I was suspecting installation problems and instead await Nios forums experience with the new release. 

I did not find any way to tweek library paths, and probably good so. Maybe installing both Q4.2 AND niosII1.1 will solve this? But has the library moved in the new releases?
0 Kudos
Altera_Forum
Honored Contributor II
611 Views

Hello Larsen, 

 

I could also not find any differences in the files. So I updated the NIOS2 to version 1.1.  

The compiling and synthesis does works with the new versions, but now here is the big big surprise.  

The IDE eclipse has changed quiet a bit. I am in the process to relearn how to create a project, because it is different now. 

I don&#39;t understand why Altera has done this. It is frustrating to me, because I find it more work now to build a project. 

I guess many more people will soon complain about it.
0 Kudos
Altera_Forum
Honored Contributor II
611 Views

Just to want to let you know what my problem was with the NIOS IDE upgrade. 

 

I upgraded the NIOS2 version 1.1. First you need to remove the software, than you can install the new version. I did that and started Quartus and NIOS2 IDE. 

Somehow the program had only the simple new project in the start phase. After some trial and error I thought something went wrong during the update. 

I uninstalled the NIOS2 again and removed all files and programs in the NIOS2 directory. Now after reinstalling NIOS2 v1.1 the New Project "Altera NIOSII" wizard is back in town. :-)
0 Kudos
Altera_Forum
Honored Contributor II
611 Views

I reported this to Altera way back before Christmas, there is a thread somewhere on this site with the messages in it. 

 

NIOS 1.01 (NIOS II V1.0 with service pack 1 applied) is not compatible with Quartus 4.2. 

I got the same DMA_128 etc messages as you were getting when I tried a compilation. I&#39;m afraid you need to make sure you have the proper NIOS II V1.1 and Quartus 4.2 in order for it to work properly. I believe that a demo version of NIOS 1.1 is now available for download from Altera, personally I&#39;m licensed and am going to wait until the proper updates come out as I can&#39;t risk a weeks downtime trying to get the new stuff working, shame really since Q4.2 20% compilation speed increase was damn useful. 

 

Regards,...
0 Kudos
Altera_Forum
Honored Contributor II
611 Views

I had the exact same error message with Quartus 4.2 and NIOS 1.0.0. The problem arose when I upgraded Quartus from 4.0 to 4.2, it seems to be related to the fact that the 4.2 install creates a components dir located at c:/altera/quartus42/sopc_builder/components but the NIOS IDE still has it’s components at C:\altera\kits\nios2\components.  

In both of these dirs there is a component called “altera_avalon_dma” a quick file compare shows that dma the components are different. More specifically the file altera_avalon_dma.c located in 

c:/altera/quartus42/sopc_builder/components/Hal/src (the new dma component). 

This file contains a new case sentence called “ALT_DMA_SET_MODE_128” (line 199), exactly the name as in the error message. So the problem seems to be that “ALT_DMA_SET_MODE_128” is not defined anywhere (as the error massage states). This indicates that the NIOS IDE is using the new DMA component and not the one located in C:\altera\kits\nios2\components. I found out that there must be another file that should contain the definition for “ALT_DMA_SET_MODE_128”, but this file was apparently not updated during the quartus 4.2 installation. After some searching I found this file. 

It’s located in “C:\altera\kits\nios2\components\altera_hal\HAL\inc\sys” and is called alt_dma_dev.h  

 

So to fix the problem I copied the new dma component dir from “c:/altera/quartus42/sopc_builder/components” to “C:\altera\kits\nios2\components” overwriting the old one (I don’t now if this I necessary but I did it anyway). 

Then I edited the C:\altera\kits\nios2\components\altera_hal\HAL\inc\sys\ alt_dma_dev.h file adding the line “#define ALT_DMA_SET_MODE_128 (0xA)” 

at line 92. I then rebuild the project without errors. 

Please let me know if this works for you or if I have forgotten something.
0 Kudos
Altera_Forum
Honored Contributor II
611 Views

I have a DMA-problem perhaps related to this upgrade: 

I copied an example from the Altera Nios II Software Developer’s Handbook, chapter "Using DMA Devices" using memory to memory data transfer. I modified the code a bit  

 

The good tghing is that there are no error messages, but the dma-transfer does not finish by setting the rx_done flag. 

Perhaps a beginners fault? Can somebody help me? 

 

Freeck 

 

# include <stdio.h># include "system.h"# include "sys/alt_dma.h"# include "alt_types.h" 

 

/* Create the transmit channel */ 

static volatile int rx_done = 0; 

static void done (void* handle, void* data) 

rx_done++; 

 

int main (int argc, char* argv[], char* envp[]) 

int rc; 

alt_u8 Inbuf[1024], Outbuf[1024]; 

alt_dma_txchan txchan; 

alt_dma_rxchan rxchan; 

void* tx_data = (void*) &Inbuf[0]; /* pointer to data to send */ 

void* rx_buffer = (void*) &Outbuf[0]; /* pointer to rx buffer */ 

 

if ((txchan = alt_dma_txchan_open("/dev/dma_0")) == NULL) 

printf ("Failed to open transmit channel\n"); 

exit (1); 

/* Create the receive channel */ 

if ((rxchan = alt_dma_rxchan_open("/dev/dma_0")) == NULL) 

printf ("Failed to open receive channel\n"); 

exit (1); 

/* Post the transmit request */ 

if ((rc = alt_dma_txchan_send (txchan,tx_data,1024,NULL,NULL)) < 0) 

printf ("Failed to post transmit request, reason = %i\n", rc); 

exit (1); 

/* Post the receive request */ 

if ((rc = alt_dma_rxchan_prepare (rxchan,rx_buffer,1024,done,NULL)) < 0) 

printf ("Failed to post read request, reason = %i\n", rc); 

exit (1); 

/* wait for transfer to complete */ 

printf ("wait for transfer to complete\n"); 

while (!rx_done); 

printf("Transfer successful!\n"); 

return 0; 

}
0 Kudos
Altera_Forum
Honored Contributor II
611 Views

I also emailed Jesse from Altera if he has a DMA example. Maybe someone else has an example to share? ..richard

0 Kudos
Reply