Specifications
The bsp-set-defaults.tcl script sets the following defaults:
• stdio character device (bsp-stdio-utils.tcl)
• System timer device (bsp-timer-utils.tcl)
• Default linker memory regions (bsp-linker-utils.tcl)
• Default linker sections mapping (bsp-linker-utils.tcl)
• Default boot loader settings (bsp-bootloader-utils.tcl)
You run the default Tcl script on the nios2-bsp-create-settings, nios2-bsp-query-settings, or nios2-bsp-
update-settings command line, by using the --script argument. It has the following usage:
bsp-set-defaults.tcl [<argument name> <argument value>]*
All arguments are optional. If present, each argument must be in the form of a name and argument value,
separated by white space. All argument values are strings. For any argument not specified, the
corresponding helper script chooses a suitable default value. In every case, if the argument value is
DONT_CHANGE, the default Tcl scripts leave the setting unchanged. The DONT_CHANGE value allows fine-
grained control of what settings the default Tcl script changes and is useful when updating an existing
BSP.
Table 4-9: Default Tcl Script Command-Line Options
Argument Name Argument Value
default_stdio Slave descriptor of default stdio device
(stdin, stdout, stderr). Set to none if no
stdio device desired.
default_sys_timer Slave descriptor of default system timer
device. Set to none if no system timer device
desired.
default_memory_regions Controls generation of memory regions By
default, bsp-linker-utils.tcl removes and
regenerates all current memory regions.
Use the DONT_CHANGE keyword to suppress
this behavior.
default_sections_mapping Slave descriptor of the memory device to
which the default sections are mapped. This
argument has no effect if default_memory_
regions == DONT_CHANGE.
enable_bootloader Boolean: 1 if a boot loader is present; 0
otherwise.
Specifying the Default stdio Device
The bsp-stdio-utils.tcl script provides procedures to choose a default stdio slave descriptor and to set the
hal.stdin, hal.stdout, and hal.stderr BSP settings to that value.
For more information about these settings, refer to the Nios II Software Build Tools Reference chapter of
the Nios II Software Developer’s Handbook.
The script searches the .sopcinfo file for a slave descriptor with the string stdio in its name. If bsp-stdio-
utils.tcl finds any such slave descriptors, it chooses the first as the default stdio device. If the script finds
no such slave descriptor, it looks for a slave descriptor with the string jtag_uart in its component class
name. If it finds any such slave descriptors, it chooses the first as the default stdio device. If the script
4-36
Specifying the Default stdio Device
NII5V2
2015.05.14
Altera Corporation
Nios II Software Build Tools
Send Feedback