Altera_Forum
Honored Contributor
12 years agoHSMC board flash LED from Linux
Hi I am new to the Altera products and I am busy learning how to develop on it
I have the Altera Cyclone V Soc dev kit with the HSMC debug header plugged in I already flashed the LED's on the board itself using the provided libraries# !/bin/sh
insmod /lib/modules/3.7.0/kernel/drivers/gpio/gpio-generic.ko
insmod /lib/modules/3.7.0/kernel/drivers/gpio/gpio-dw.ko
insmod /lib/modules/3.7.0/kernel/drivers/gpio/gpio-altera.ko
insmod /lib/modules/3.7.0/kernel/drivers/leds/led-class.ko
insmod /lib/modules/3.7.0/kernel/drivers/leds/leds-gpio.ko
//Switch LED On
echo 1 > /sys/class/leds/fpga_led0/brightness
sleep 1
//Switch LED Off
echo 0 > /sys/class/leds/hps_led0/brightness
and via "RAW" access using the code
//Set All LEDS off (put IO's High to switch Off)
alt_clrbits_word( ( virtual_base + ( ( uint32_t )( ALT_LWFPGASLVS_OFST + LED_PIO_BASE ) & ( uint32_t )( HW_REGS_MASK ) ) ), 0x0000000F );
//Turn LED_FPGA_0 On (put IO low to switch the LED On)
alt_setbits_word( ( virtual_base + ( ( uint32_t )( ALT_LWFPGASLVS_OFST + LED_PIO_BASE ) & ( uint32_t )( HW_REGS_MASK ) ) ), 0x00000001 );
Now I want to do the same for the LED on the HSMC board I need to set this pin LOW DIFFIO_TX_T18p,DQ3T (Altera Pin A4) and I need to set this pin High DIFFIO_RX_T39p,DQ5T (Altera Pin F9) But I do not know where to find the memory map to show me what memory to write to. Can anybody please guide me in the correct direction? Thanks Walter