I've created a PFL project to program the flash device for MAX 10. but it isn't working.
I will share the Qsys design for you to tell me what I am doing wrong. I don't think that the top level got an issue.
Can you share more information like flash device, quartus version edition used and project.
Are you Dev Kit or custom board?
Refer below link
what are you using the PFL for - FLASH programming/ FPGA configuration/ Both? When you select FPGA Configuration/Both, the Avalon Source port needs to be connected to a streaming sink.
To use a Flash loader with NIOS, you most likely need to use the Avalon Compact Flash IP. This will connect the NIOS2 data master port to the CF slave port and also have external Flash ports to which the FLASH pins are connected.
API support is also there for this IP for SW programming.