Nios® V Processor Software Developer Handbook

ID 743810
Date 5/26/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

6.6.6.4. Example: Creating a BSP with Logging

  • System clock log
  • JTAG startup log
  • JTAG interval log, logging twice a second
  • No write echo

Creating BSP With Logging and Options

niosv-bsp -c -s=<path to .qsys file> -t=<bsp type> settings.bsp 
--cmd=”set_setting hal.log_port {uart1}”
--cmd=”set_setting hal.make.cflags_user_flags {-DALT_LOG_FLAGS=2
-DALT_LOG_WRITE_ON_FLAG_SETTING=0 -DALT_LOG_JTAG_UART_TICKS_DIVISOR=2r}”

This niosv-bsp command modify toolchain.cmake to use uart1 for log output, and to add -DALT_LOG_FLAGS=2 when calling gcc to compile the program.