Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

west: runner: add support for ecpprog #81482

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

josuah
Copy link
Collaborator

@josuah josuah commented Nov 16, 2024

This adds the ecpprog utility to flash FPGA boards on Zephyr.

There is currently no board upstream configured to use it, but 3rd-party module soon will, and later be submitted to Zephyr.

Example board.cmake:

include(${ZEPHYR_BASE}/boards/common/ecpprog.board.cmake)

Optional Kconfig.defconfig for CONFIG_FLASH_LOAD_OFFSET support:

# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition

config FLASH_LOAD_OFFSET
        default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
        # or directly some number

Sample output:

$ west flash
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner ecpprog
ecpprog -o 0x100000 /home/tinyvision/zephyrproject/tinyclunx33_zephyr_example/build/zephyr/zephyr.bin
init..
IDCODE: 0x010fb043 (LIFCL-33U)
NX Status Register: 0x0000110100000000
reset..
flash ID: 0xEF 0x80 0x18
file size: 157096
erase 64kB sector at 0x100000..
erase 64kB sector at 0x110000..
erase 64kB sector at 0x120000..
programming..  157096/157096
verify..       157096/157096  VERIFY OK
Bye.
$

The ecpprog command is an utility written by Greg Davill for flashing
FPGAs such as ECP5 or CrossLink-NX series. Devkits typically have an
FTDI interface chip to access the external flash. FPGA image is
typically at flash offset 0x00000000 flash offset, and the Zephyr
image offset can be set via CONFIG_FLASH_LOAD_OFFSET.

Signed-off-by: Josuah Demangeon <[email protected]>
@josuah josuah added area: West West utility area: Scripts Scripts area: FPGA Field-Programmable Gate Array (FPGA) labels Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: FPGA Field-Programmable Gate Array (FPGA) area: Scripts Scripts area: West West utility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant