Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16602 Discussions

File Descriptor Handle for internal Flash on Max10 FPGA

AAnch
New Contributor I
1,458 Views

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

0 Kudos
3 Replies
Ahmed_H_Intel1
Employee
460 Views

Hi,

Can you download the BUP design from here

https://www.intel.com/content/dam/altera-www/global/en_US/support/boards-kits/max10/max10_10m50daf484c6ges_v15.0.0_RevC.zip

And then open the Eclipse>New>NIOS II application and BSP from template>choose the memtest template

Run this test and see if you will get the same error. This should be working fine

Please also check SW1 and SW2 in the bottom of the board.

 

0 Kudos
AAnch
New Contributor I
460 Views

I see this error message while simulating the C code with modelsim. So could you please check if the above C code can be simulated for Max 10 FPGA?

0 Kudos
Ahmed_H_Intel1
Employee
460 Views

Can you please create the MEM-test application to test your flash?

Go to File>> New>>application and PSB from template>> choose the sopicinfo file and choose "Memory test application".

Regards.

0 Kudos
Reply