Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

7.7.6.4. Example: Creating a BSP with Logging

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

    Example 6–6. Creating BSP With Logging and Options

    nios2-bsp hal my_bsp ../my_hardware.sopcinfo \
    --set hal.log_port uart1 \
    --set hal.make.bsp_cflags_user_flags \
    -DALT_LOG_FLAGS=2 \
    -DALT_LOG_WRITE_ON_FLAG_SETTING=0 \
    -DALT_LOG_JTAG_UART_TICKS_DIVISOR=2r

The -DALT_LOG_FLAGS=2 argument adds -DALT_LOG_FLAGS=2 to the ALT_CPP_FLAGS make variable in public.mk.