Hi,
I'm using a record defined in the device_pkg.vhd to represent the Avalon-MM bus. If you look in the test bench tb_fpga_updater.vhd you can see how the record is used to connect the FLAH_BUS port on the instance of the state machine fpga_updater_1, and the On-Chip Flash Intel FPGA IP instance flash_controller.
The state machine in the file fpga_updater.vhd is based on the state machine in the file MAX10_FLASH_INTERFACE.v associated with the application note "I2C Remote System Upgrade Example (Max 10)". the state machine is using the sector erase mechanism and works fine on a 10M02SC device using the appropriate control interface settings for the On-Chip Flash Intel FPGA IP control register. The settings I used for the 10M02 device can be seen commented out in the file device_pkg.vhd.
However having modified the On-Chip Flash Intel FPGA IP control register settings as shown in my previous post the sector erase is not working on the 10M04SA device.