Skip to content
GeMRTOS
GeMRTOS

The Generic eMbedded Multiprocessor RTOS

  • Home
  • Download Now!
  • GeMRTOS
    • License
    • Download
    • GeMRTOS Documentation
      • Documentation Browser
      • GeMRTOS Manuals
    • GeMRTOS repository
  • Log in
  • Contact us
Search
GeMRTOS
GeMRTOS

The Generic eMbedded Multiprocessor RTOS

  • Download Now!!!
  • GeMRTOS
    • License
    • Download now!
    • GeMRTOS documentation
    • GeMRTOS repository
  • Login
  • Contact us
  • FPGA Laboratory ACCESS
  • Cursos de FPGA (en español)
  • Challenges
GeMRTOS
GeMRTOS

The Generic eMbedded Multiprocessor RTOS

  • Home
  • Download Now!
  • GeMRTOS
    • License
    • Download
    • GeMRTOS Documentation
      • Documentation Browser
      • GeMRTOS Manuals
    • GeMRTOS repository
  • Log in
  • Contact us
Search
GeMRTOS
GeMRTOS

The Generic eMbedded Multiprocessor RTOS

  • Download Now!!!
  • GeMRTOS
    • License
    • Download now!
    • GeMRTOS documentation
    • GeMRTOS repository
  • Login
  • Contact us
  • FPGA Laboratory ACCESS
  • Cursos de FPGA (en español)
  • Challenges

GeMRTOS - Getting started

  • Introduction to GeMRTOS
  • Getting Started with GeMRTOS: Multiprocessor RTOS for Altera FPGA (Nios II & Nios V)
  • API references
  • Platform Designer Flow for GeMRTOS Nios V FPGA Development
  • GeMRTOS RTOS Task Periods: Infinite Loop vs Periodic Tasks
  • Install Quartus Prime and WSL for GeMRTOS Nios V on Windows

GeMRTOS - Features

  • GeMRTOS Mutex and Critical Sections in Multiprocessor RTOS
  • GeMRTOS Signals: Runtime Exception Handling for Nios V RTOS
  • GeMRTOS System Architecture – Multiprocessor Design with Altera Nios V Processors
  • Hybrid Partition Scheduling in GeMRTOS, Multiprocessor RTOS for Altera FPGA
  • GeMRTOS Scheduling Lists: EDF and Fixed Priority RTOS Guide
  • GeMRTOS Tasks: Types, Creation, and Scheduling for Nios V
  • GeMRTOS Trigger Resources: Event Handling Beyond Interrupts
  • GeMRTOS Controller: Complete FPGA RTOS Hardware Guide
  • Data Structures in GeMRTOS: Control Blocks and Linked Lists
  • GeMRTOS Semaphores: Binary and Counting API for Nios V RTOS

General

  • Error (16031): Current Internal Configuration mode does not support memory initialization or ROM. Select Internal Configuration mode with ERAM.
  • newlib Thread Safety in GeMRTOS Nios V Multiprocessor RTOS
  • Set Up Questa-Intel FPGA Edition License for GeMRTOS Nios V
  • Installing Nios II Software Built Tools (SBT) for Eclipse in Quartus Prime starting from version 19.1
  • Fix Quartus Prime 23.1 Fatal Error When Creating ALTPLL IP
  • Fix Missing SDRAM Controller IP in Quartus Prime for GeMRTOS
  • GeMRTOS Nios: Fix 256MB Compile Boundary with -relax-all
  • Questa Simulation Setup for GeMRTOS Nios V: Two Common Fixes
  • Quartus Warning 113015: mem_init.hex Width Mismatch BSP Fix
  • GeMRTOS Secondary Processors Not Booting: nios2-download Fix
  • Fix Quartus Prime System Console: jvm.dll and awt.dll Errors
  • Eclipse does not start after full Quartus Prime instalation
  • Home
  • GeMRTOS KnowledgeBase
  • GeMRTOS
  • GeMRTOS Nios: Fix 256MB Compile Boundary with -relax-all

GeMRTOS Nios: Fix 256MB Compile Boundary with -relax-all

When building a GeMRTOS project with the Nios II toolchain, the linker may fail if functions are located in memory addresses more than 256MB apart. This occurs because the Nios II compiler uses the call instruction, which has a 256MB address boundary limitation. The fix is to use the -relax-all option, which switches to the callr instruction that has no such boundary constraint.

Issue Description #

This error occurs when functions are located in a memory region more than 256MB apart from the main memory. The Nios II compiler’s call instruction cannot reach across this boundary, causing a link failure. Note that using callr instead may slightly impact software performance, as it requires more assembly instructions than call.

How to Fix It #

In ACDS version 13.1 and later, the -relax-all option is available to force the use of the callr instruction. In Software Build Tools for Eclipse, add the -Wa,-relax-all option in the Application and/or BSP properties as user flags.

For GeMRTOS, the BSP is configured with -Wa,-relax-all as follows:

nios2-bsp hal $1 qsysgrtos.sopcinfo --cpu-name GeMRTOS_Multiprocessor_0_gemrtos_proc_1 --cmd "set_setting hal.enable_reduced_device_drivers true" --cmd "set_setting hal.stderr GeMRTOS_Multiprocessor_0_jtag_uart_1" --cmd "set_setting hal.stdin GeMRTOS_Multiprocessor_0_jtag_uart_0" --cmd "set_setting hal.stdout GeMRTOS_Multiprocessor_0_jtag_uart_0" --cmd "add_section_mapping rstaux GeMRTOS_Multiprocessor_0_rstaux_memory" --cmd "delete_memory_region GeMRTOS_Multiprocessor_0_onchip_memory2_2" --cmd "add_memory_region onchipdata GeMRTOS_Multiprocessor_0_onchip_memory2_2 0 512" --cmd "add_memory_region onchipcode GeMRTOS_Multiprocessor_0_onchip_memory2_2 512 15872" --cmd "add_section_mapping onchipdata onchipdata" --cmd "add_section_mapping onchipmem onchipcode" --cmd "set_setting hal.make.bsp_cflags_user_flags -Wa,-relax-all"

And for the application:

nios2-app-generate-makefile.exe --bsp-dir ./${SOFTWARE_DIR_NAME}/${BSP_NAME} --app-dir ./${SOFTWARE_DIR_NAME}/${APP_NAME} --elf-name ${APP_NAME}.elf --set APP_CFLAGS_USER_FLAGS "-Wa,-relax-all" --inc-rdir ./${SOFTWARE_DIR_NAME}/${APP_NAME} --src-rdir ./${SOFTWARE_DIR_NAME}/${APP_NAME}

Key Takeaways #

  • The 256MB compile boundary is a Nios II call instruction hardware limitation — it is not a software or toolchain bug.
  • The fix is adding -Wa,-relax-all to BSP and application user flags, which switches the compiler to the callr instruction with no address boundary limit.
  • GeMRTOS’s gemrtos_build.sh script already includes -Wa,-relax-all in both the BSP and application build commands shown above.
  • There is a minor performance trade-off: callr uses more assembly instructions than call, which may slightly increase code size and execution time.

Reference: Intel Support, Article 000079417.

Avalon MM, GeMRTOS, Nios 2, Nios V, RISC-V
Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Table of Contents
  • Issue Description
  • How to Fix It
  • Key Takeaways

Copyright © 2026 - contact us - Dorrego 287 - B8000FLE - Bahía Blanca - Argentina - +542914311867  GeMRTOS

Nios II, Nios V, Quartus Prime, ModelsSim are property of their respective companies.
GeMRTOS is property of R. Cayssials.
**All contact forms on this site are protected by reCAPTCHA. Google Privacy

GeMRTOS joins Intel Partner Alliance as Gold member.