I've managed to make it work - I've to uncomment the hal.use_small_foot_print.
Right now - i'm having the same problem - you saw.
freezing when erasing sectors
can you be more specific with "For the FLASH_MEM_OP, bit 3 is the write enable bit. First you need to write bit 3 and the sector number, THEN write bits 0 and 1 with the erase command and the sector number"
This is what I see
# define ALTERA_EPCQ_CONTROLLER2_MEM_OP_CMD_MASK (0x00000003)
# define ALTERA_EPCQ_CONTROLLER2_MEM_OP_BULK_ERASE_CMD (0x00000001)
# define ALTERA_EPCQ_CONTROLLER2_MEM_OP_SECTOR_ERASE_CMD (0x00000002)
# define ALTERA_EPCQ_CONTROLLER2_MEM_OP_SECTOR_PROTECT_CMD (0x00000003)