This is an updated version of the old title "DS-5 Utilization Technique - Flash Programming Alternative".

Arm® Development Studio for Intel® SoC FPGA Edition (Arm® DS ) has been changed to Arm® DS is the successor to DS-5, and usability does not change significantly. Most of the content in this series of articles can be applied to both Arm® DS / DS-5, but where there are differences, we have updated them to that effect.

 

***

 

This article provides supplementary information on how to use Arm® DS / DS-5, which can be used as a software integrated development environment for Intel® SoC FPGAs.

This time, I will introduce "Arria 10 Flash Programming Alternative", a method of writing to Flash for HPS boot posted on RocketBoards.org.

*Note: Scripts posted on Rocketboards.org are intended for DS-5. Some modifications are required to work with Arm® DS.

A modified version of the script for Arm® DS is attached to this article for reference. We have confirmed that writing is possible, but we do not guarantee that it will work, so please use it as a reference only and at your own risk. (Conditions for redistribution and use are also stated at the top of the script)

Introduction

The methods presented in this article do not directly manipulate the Arm® DS/DS-5 Debugger. Since Arm® DS / DS-5 is operated via Python scripts, it is the best method for users who are unfamiliar with debugger operations to write Flash using Arm® DS / DS-5. It is

Also, to write to Flash, use the command function implemented in U-Boot. U-Boot's command function has the advantages of "faster programming" and "more supported Flash devices" than HPS Flash Programmer (a flash programming tool that comes with SoC EDS) However, these are also advantages of using this method.

Please also refer to the following article for Flash writing using U-Boot.
Faster than HPS Flash Programmer! How to write to QSPI in U-Boot

Original page (RocketBoards.org)

・ URL of the original page:

 https://rocketboards.org/foswiki/Documentation/Arria10NANDFlashProgramming 

 *For detailed information, please check the original page (English).

Figure 1 Original page Top screen (quoted from RocketBoards.org)

 

The original article was intended for older versions of the tools environment.

When using the latest development tool environment, refer to Rocketboards.org "SoCEDS and ARM Development Studio" and perform the following items.
- Installation
- Running the Tools
- SoC EDS Licensing

*Note: For Windows, Cygwin must be installed separately. The Cygwin setup procedure is also described on the above page, but the described procedure does not install python2 necessary for executing Flash Programming scripts.
When checking here, after comparing with the Cygwin environment attached to the old version (v18.1) of SoC EDS, the following packages were added and installed. "python2, bcrypt, ccrypt, libprocps8, tcsh"

 

Preparation 1: Downloading scripts, etc.

Download the archive containing the script (flash_programmer.tgz)

Download the script "flash_programmer.tgz" published on the original page.

Unzip the file on your PC

● Extract "flash_programmer.tgz" on the host PC where SoC EDS is installed.

1. Start Embedded Command Shell.

2. Execute the TAR extraction command on the shell.

$ tar -xzvf ./flash_programmer.tgz

3. Change to the extracted directory.

$ cd flash_programmer

 

● The directory after expansion has the following structure.

Figure 2 Configuration after decompressing the archive

 

●flash_programmer.py is the main script for flash writing.

 

●Other design files for the Arria® 10 SoC Development Kit are available for each boot source (NAND/QSPI/SDMMC) and board revision (Rev.B/Rev.C).

 

● Each design contains the following three files.

‐ \output_files\ghrd_10as066n2.sof … FPGA configuration data (.sof)

- \software\bootloader_extcfg_semihosting\devicetree.dtb … Device tree binary for U-Boot (.dtb)

‐ \software\bootloader_extcfg_semihosting\uboot-socfpga\u-boot … U-Boot itself (executable file)

 

* The standard design files are only for Arria® 10 SoC Development Kit, but by preparing design files with the same configuration, it is possible to apply the same mechanism to various target boards. .

* According to the information on the original page, the only supported device is Arria® 10 SoC. However, as far as the contents of the script are checked, some descriptions are prepared to support Arria® V SoC and Cyclone® V SoC in addition to Arria® 10 SoC. It seems that it may be possible to support Arria® V SoC and Cyclone® V SoC by modifying the contents. Please check the contents and operation of flash_programmer.py before using.

*For Arm® DS, download and unzip the flash_programmer_armds.zip attached to this article, and replace it with flash_programmer.py.

Preparation 2: Prepare design file for original target (optional)

Prepare a design directory (naming rules)

● Prepare a design directory for storing design files for the original target directly under flash_programmer.

○ Naming rule: <device>_<bootsource>_<board_name>_design

- <device> = select from {a10 / av / cv}

- <bootsource> = select from {qspi/sdmmc/nand}

- <board_name> = specify a meaningful name for board identification

* Example (Arria® 10, QSPI boot, board name: testboard01): a10_qspi_testboard01_design

 

Create and store design files

● Store the following three files in the created design directory.

‐ \output_files\ghrd_10as066n2.sof … FPGA configuration data (.sof)

- \software\bootloader_extcfg_semihosting\devicetree.dtb … Device tree binary for U-Boot (.dtb)

‐ \software\bootloader_extcfg_semihosting\uboot-socfpga\u-boot … U-Boot itself (executable file)

 

* For the FPGA configuration data (.sof), use the file generated by the Quartus® project for the original target as it is.

* Since the following options must be specified for the U-Boot itself and the device tree, they must be created separately from those for production use.

- Enable External Configulation (check external_fpga_config on bsp-editor)

- Enable SemiHosting (Edit definition under U-Boot source tree)

[Before editing] #undef CONFIG_SEMIHOSTING

[After editing] #define CONFIG_SEMIHOSTING

 

Flash Programming execution

Connection with target board

Connect the target board and host PC with a USB-Blaster (JTAG) cable. (Only this one connection is OK)

programming execution

After powering on the target board, just run flash_programmer.py on the Embedded Command Shell.

1. Start Embedded Command Shell.

2. Move to the directory where the script is extracted.

- $ cd flash_programmer

3. Script execution (Example: Arria® 10, QSPI, board name: testboard01 )

‐ $ ./flash_programmer.py --board=testtarget01 --soc=a10 --flash=qspi --operation=epv --address=0x0 --size=0x100000 --file=uboot_w_dtb-mkpimage.bin

 

* Please refer to RocketBoards.org for details of flash_programmer.py options.
(There is also a speed-up procedure using TFTP that is not covered in this article.)

Figure 3 flash_programmer.py options (quoted from RocketBoards.org)

Execution example

I will post the contents of the console display when programming is executed.

Execution example (1/5)
Execution example (2/5)
Execution example (3/5)
Execution example (4/5)
Execution example (5/5)

Modified script for Arm® DS

Please check the original flash_programmer.py and the attached file with the comparison tool for the modified contents.

The changes are as follows.
・Change debugger command name: debugger -> armdbg
・Change JTAG connection name (CDB_ENTRY): Altera -> Intel SoC FPGA
Before) CDB_ENTRY = "Altera::Arria 10 SoC::Bare Metal Debug ...
After change) CDB_ENTRY = "Intel SoC FPGA::Arria 10 SoC::Bare Metal Debug ...
・Changed reset command: reset system -> reset


Supplement: For Arm® DS, the following warning is displayed after writing is completed (success).
------
INFO: WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.python.netty.util.internal.PlatformDependent0 (file:/opt/arm/developmentstudio-2020.0/sw/ide/plugins/com.arm.tpip.jython_2.7.0.20200331_211023/lib/jython -2.7.0-standalone.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of org.python.netty.util.internal.PlatformDependent0
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Jul 21, 2020 2:03:47 PM org.python.netty.util.internal.PlatformDependent <clinit>
INFO: Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system unstability.
------


The above warning seems to be due to the implementation method in jython-2.7.0-standalone.jar included in Arm® DS. It seems that it is displayed because the implementation method of the corresponding .jar is implemented in a method that has been changed and not recommended in the recent Java environment.
Flash writing has been successful, so if this warning is displayed, you can ignore it and use it.

Summary

This time, I introduced a Flash programming method that indirectly uses Arm® DS / DS-5 in a python script.

Finally, this method does not launch the Arm® DS / DS-5 Debugger GUI, but the Arm® DS / DS-5 license is required as usual. Please note that if you try to run this script on a PC that has not been licensed for Arm® DS / DS-5, a license error will occur and programming will not be possible.

 

Click here for recommended articles/materials

List of articles on Arm DS utilization
SoC FPGA related articles and resources
Intel® FPGA SoC FPGA
Intel® FPGA Development Flow/FPGA Top Page

Click here for recommended FAQ

SoC FPGA related FAQ
Intel® FPGA FAQs

Click here for recommended seminars/workshops

SoC Startup Trial <Free>