Altera_Forum
Honored Contributor
11 years agoHow to access FPGA Manager's Input & Output ?
I am using Cyclone V SoC Dev Kit.
I want to write a bare-metal program to access PUSH_BUTTON & DIP SWITCH on the board. I check the schematic of EVK, BUTTON & DIPSW is connect to FPGA manager's Input port. I have write a code as below, but can't read the input data from FPGA manager. How to make it available to access FPGA manager's Input ? ----------- Bare-metal source code ------------- // Download SOF before running program !!! int main(int argc, char** argv) { ALT_STATUS_CODE status = ALT_E_SUCCESS; ALT_FPGA_CFG_MODE_t mode; status = alt_fpga_init(); if(status != ALT_E_SUCCESS) return 1; if (alt_fpga_state_get() != ALT_FPGA_STATE_USER_MODE) { printf("\n not in USER_MODE. \n"); return 1; } status = alt_fpga_control_enable(); if(status != ALT_E_SUCCESS) return 1; while(1) { uint32_t input = alt_fpga_gpi_read(0xFFFFFFFF); printf(" input = 0x%X. \n", input); } return 0; } -------------- result --------- intput val = 0xFFFFFFFF intput val = 0xFFFFFFFF intput val = 0xFFFFFFFF