Forum Discussion

AAnch's avatar
AAnch
Icon for New Contributor rankNew Contributor
7 years ago

File Descriptor Handle for internal Flash on Max10 FPGA

I wanted to perform write and reads on the internal flash of the Max10 FPGA. Using the below code the file handle is getting zero return from this function (i have ensured that Flash device name matches the one included in system.h). How do i access the internal flash using the built in flash functions available in HAL (alt_read_flash,alt_write_flash)? In BSP i have also ensured enable_small_c_library, enable_reduced_device_drivers and enable_sim_optimize flags are disabled(unchecked). Is there any other setting to be done to access the internal flash on the Max10 FPGA.

fd = alt_flash_open_dev("/dev/flash_control");

system.h:

#define DMA_READ_MASTER_FLASH_CONTROL_NAME "/dev/flash_control"

Getting below Error message:

# -ERROR: Could not open /dev/flash_control,FD:0

3 Replies