Site Search

How do I use Nios® II to manipulate QSPI protection via the Altera Generic QUAD SPI Controller implemented in my MAX® 10 FPGA Development Kit design?

MAX Nios II

Category: Nios® II
tool:-
Device: MAX® 10


Use the Nios® II HAL API alt_lock_flash() to determine the protection area by setting the values in the Protected Area Sizes – Upper Area and Protected Area Sizes – Lower Area tables in the Micron MT25Q512 series (successor to N25Q512) datasheet.
The summary of the alt_lock_flash() HAL API is as follows:

prototype
int alt_lock_flash(alt_flash_dev * flash_info, alt_u32 sectors_to_lock)

Include


Locks a range of flash memory sectors.
Protect against writing and erasing by passing a 32-bit unsigned integer value to the sectors_to_lock argument.
The value for this argument can be found in the data sheet of the flash device being used.

For supported flash devices, see the Embedded Peripherals IP User Guide.
https://www.altera.com/en_US/pdfs/literature/ug/ug_embedded_ip.pdf
(Please check the Configuration Device Types in the Altera Generic QUAD SPI Controller Core section)

argument

  • *flash_info: A pointer to a general flash device structure.
  • sectors_to_lock: Block protection bits in EPCQ/QSPI ⇒ Bit4 | Bit3 | Bit2 | Bit1 | Bit0 TB | BP3 | BP2 | BP1 |


For more information about the alt_lock_flash() HAL API, see the Nios II Classic Software Developer's Handbook.
https://www.altera.com/en_US/pdfs/literature/hb/nios2/n2sw_nii5v2.pdf

MT25Q512 Series Datasheet (Successor to N25Q512)
https://www.micron.com/products/storage/nor-flash/serial-nor/part-catalog?capacity=512Mb

reference
alt_flash.h - GitHub
https://github.com/conorpp/codesign-challenge-2015/blob/master/circle-modules-in-parallel/HAL/inc/sys/alt_flash.h


Experienced FAE
Free consultation is available.

From specific product specifications to parts selection, the Company FAE will answer your technical concerns free of charge. Please feel free to contact us.