FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
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.
4953 Discussions

Bare metal access to HPS GPIO pins

MCOUNSELL
New Contributor I
432 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
139 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.

MCOUNSELL
New Contributor I
139 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

EBERLAZARE_I_Intel
139 Views

Hi,

 

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

 

Regards.

Reply