AN 741: Remote System Upgrade for MAX 10 FPGA Devices over UART with the Nios II Processor

ID 683661
Date 2/21/2017
Public
Document Table of Contents

1.6.2.1. Updating Application Images Remotely

After you have transmitted a programming bit stream file using the Remote Terminal, the Nios II software application is designed do the following:

  1. Set the Altera On-Chip Flash IP core Control Register to un-protect the CFM1 & 2 sector.
  2. Perform sector erase operation on CFM1 and CFM2. The software polls the status register of the Altera On-Chip Flash IP core to ensure successful erase has been completed.
  3. Receive 4 bytes of bit stream at a time from stdin. Standard input and output can be used to receive data directly from the host terminal and print output onto it. Types of standard input and output option can be set through the BSP Editor in Nios II Eclipse Build tool.
  4. Reverses the bit order for each byte.
    Note: Due to the configuration of Altera On-Chip Flash IP Core, every byte of data needs to be reversed before writing it into CFM.
  5. Start to write 4 bytes of data at a one time into CFM1 and CFM2. This process continues until the end of programming bit stream.
  6. Polls the status register of Altera On-Chip Flash IP to ensure successful write operation. Prompts a message to indicate the transmission is complete.
    Note: If the write operation fails, the terminal will halt the bit stream sending process and generate an error message.
  7. Sets the Control Register to re-protect CFM1 and CFM2 to prevent any unwanted write operation.