Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

GCC Compiler Switch

Altera_Forum
Honored Contributor II
1,057 Views

Hi, 

 

I want to force the Nios II GCC compiler to use a 32-bits memory location for any variable (alt_u32, alt_u16, alt_u8, etc).  

Is there a GCC compiler switch to do this trick? 

 

Best Regards, 

 

Marco
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
248 Views

Hello Marco, 

 

I don't know if there is a switch in GCC but you could change the typedefs in "alt_types.h" for each type to 32-bit. That would be quick and dirty way. 

 

 

Bye, 

niosIIuser
Altera_Forum
Honored Contributor II
248 Views

Hi niosIIuser, 

 

Unfortunately this trick does not work. The reason why I'm asking is the fact that I have a memory perpipheral that only supports 32 and 16 bits (word aligned) access. The Nios II runs code and data from this peripheral without any troubles, but if I uncheck the system library option 'Small C Library' or 'Reduce Device Drivers' the printf output is corrupted or nothing. So I thought that aligning the variables to a word boundary maybe could solve the problem.  

 

Any other ideas?  

 

Best Regards, 

 

Marco
Reply