FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5921 Discussions

Bare metal access to HPS GPIO pins

MCOUNSELL
New Contributor I
985 Views

 

Hi,

 

Do I need anything to init the HPS GPIO before I start using it from a bare metal application?

 

I start debugging from DS5 and it never gets past alt_setbits_word()

 

Does the FPGA have to be initialised before hand?? Or do the HPS GPIO work regardless of the FPGA programming status?

 

Doubt I'll get any answers/help ---- p***ing into the wind here...

 

#define GPIO_SPAN 0x1000 // 4 KB 4096DECIMAL #define GPIO0_BASE_ADDRESS 0xFF208000 #define GPIO1_BASE_ADDRESS 0xFF209000 #define GPIO2_BASE_ADDRESS 0xFF20A000   #define gpio_swporta_dr 0x0 // 32 RW 0x0 Port A Data Register #define gpio_swporta_ddr 0x4 // 32 RW 0x0 Port A Data Direction Register     int main(void) {   alt_setbits_word( GPIO1_BASE_ADDRESS + gpio_swporta_ddr, USER_IO_DIR ); alt_setbits_word( GPIO1_BASE_ADDRESS + gpio_swporta_dr, BIT_LED );   while(1) { puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ }   return EXIT_SUCCESS; }

 

0 Kudos
3 Replies
EBERLAZARE_I_Intel
692 Views

Hi,

 

If you don't mind me asking, where did you find this design? or this is your own design?

 

I recommend that you go through this user guide on how to set up and debug using the ARM DS-5:

https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/ug/ug_bm.pdf

 

Regards.

0 Kudos
MCOUNSELL
New Contributor I
692 Views

HI,

 

The alt_setbits_word lines came from an example of code. I can't remember what..... it was some example regarding a switch and a LED..... seems super super simple but does not work... I must have something wrong?

 

Mike

0 Kudos
EBERLAZARE_I_Intel
692 Views

Hi,

 

I see, may I ask is there any error code? Or any booting issue?

 

Regards.

0 Kudos
Reply