Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20725 Discussions

Cyclone V Soc LEDs Issue- Help Required

Altera_Forum
Honored Contributor II
2,839 Views

Hi, 

I am using cyclone V Soc HPS. Issue I am facing is I have been able to access GPIOs button and DIP switches but i am unable to access LEDs. I am using lauterbach for debugging. Changes made by the application are reflected in the CPUs registers. Toggling DIP switches toggles corresponding bits in registers but toggling LEDs bits have no effect on LEDs. 

 

(*((int * ) 0xFF709004)) = 0x0000F000; // DDR of GPIO1 module : 1-> LED pins as O/P [bits: 12-15] 

(*((int * ) 0xFF709000)) = 0x00000000; // DR of GPIO1 module : 0-> LEDs ON (active low) [bits: 12-15] 

 

Above locations are being used for LEDs. Let me know if I am missing anything. 

 

Thanks in advance.
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
1,056 Views

Hi Waleedabbasi, 

 

I too not able to Switch on the HPS_LED0 to HPS_LED3, using the below code.. I am using ARM-DS5 Compiler for compiling and debugging. 

 

// initialising the memory locations of the registers using 

# define gpio1_gpio_swporta_ddr (*((volatile unsigned long *) 0xFF709004)) 

# define gpio1_gpio_swporta_dr (*((volatile unsigned long *) 0xFF709000)) 

# define clkmgr_bypass (*((volatile unsigned long *) 0xFFD04004)) 

# define clkmgr_en (*((volatile unsigned long *) 0xFFD04060)) 

 

 

 

void Init_showactivity(void); 

void Init_clock(void); 

 

int main() 

Init_clock(); 

Init_showactivity(); 

while(1); 

 

 

 

void Init_showactivity(void) 

gpio1_gpio_swporta_ddr |= 0x0000F000; 

gpio1_gpio_swporta_dr &= 0xFFFF5FFF; 

 

void Init_clock(void) 

clkmgr_bypass = 0x00000019; 

//clkmgr_en = 0x00000006; 

 

Have you got any solution or code for blinking the LED. Could you please guide me..
0 Kudos
Altera_Forum
Honored Contributor II
1,056 Views

I used u-boot which resolved the issue.

0 Kudos
Altera_Forum
Honored Contributor II
1,056 Views

Hi, 

 

Thanks for your suggestion, 

 

Could you please guide me more regarding the U-Boot.
0 Kudos
Altera_Forum
Honored Contributor II
1,056 Views

Actually i was using lauterbach, I got an example targetting GPIOs of altera Cyclone V Soc, when you build this application using ARM-DS5, along with the binary of your target application a uboot binary is generated, and a script is available for loading both of these binaries to target platform. I ported the script for lauterbach and used same uboot binary generated with the example and voila it worked :)

0 Kudos
Altera_Forum
Honored Contributor II
1,056 Views

Hai, 

 

Thanks,  

 

From where you got the sample LED project for cyclone.
0 Kudos
Altera_Forum
Honored Contributor II
1,056 Views

Kindly find attached.

0 Kudos
Altera_Forum
Honored Contributor II
1,056 Views

Hai, 

Thnaks for the sample codes. 

 

While compiling using the project using ARM-DS5, the system can't find the header file "Alt_clock_manager.h" 

 

Below is the error .. No header files are available in the root directory path of ARM DS5. 

 

"arm-altera-eabi-gcc -g -O0 -Wall -Werror -std=c99 -mcpu=cortex-a9 -mfloat-abi=softfp -mfpu=neon -ID:/altera/15.0/embedded/DS-5//../ip/altera/hps/altera_hps/hwlib/include -c gpio_demo.c -o gpio_demo.o 

gpio_demo.c:36:31: fatal error: alt_clock_manager.h: No such file or directory 

# include "alt_clock_manager.h""
0 Kudos
Altera_Forum
Honored Contributor II
1,056 Views

Hai, 

I generated the preloader and now i has the doubt how to include our code with the preloader.
0 Kudos
Altera_Forum
Honored Contributor II
1,056 Views

Hi,http://rocketboards.org/foswiki/view/documentation/preloaderubootcustomization131 

you may just replace the preloader area with your application execution file then.,.,
0 Kudos
Reply