---
title: "Quartus Warning 113015: mem_init.hex Width Mismatch BSP Fix"
description: "When building a GeMRTOS Nios V/II project, Quartus may emit **Warning (113015)** during compilation if memory initialization files generated by the `mem_init_generate` make target have a record length that does not match the memory data port width. The fix requires…"
url: "https://rcayssials.hopto.org/gemrtosdocs/warning-113015-width-of-data-items-in-mem_init-hex-is-greater-than-the-memory-width/"
updated: "2026-06-01"
category: General
tags:
  - Avalon MM
  - GeMRTOS
  - Nios 2
  - Nios V
  - "RISC-V"
---

# Quartus Warning 113015: mem_init.hex Width Mismatch BSP Fix

When building a GeMRTOS Nios V/II project, Quartus may emit **Warning (113015)** during compilation if memory initialization files generated by the `mem_init_generate` make target have a record length that does not match the memory data port width. The fix requires a one-line change to the BSP's `mem_init.mk` file.

## Issue Description

This warning appears when using memory initialization files generated by the `mem_init_generate` make target in the makefile produced by the Nios® II Embedded Design Suite (EDS). The `.hex` files are generated with a default record length that may differ from the actual memory data port width, triggering the warning.

## How to Fix It

Modify the **mem_init.mk** file inside the BSP directory to add a `--record` switch to the `$(ELF2HEX)` command:

1. Open `<BSP directory>/mem_init.mk` in a text editor.
2. Find the line containing the `$(ELF2HEX)` command.
3. Add the following switch to that command:
   `--record=${mem_hex_width}/8`

Example of the modified `$(ELF2HEX)` line:

`XXXXXX = $(ELF2HEX) --record=4 $< $(mem_start_address) $(mem_end_address) --width=$(mem_hex_width) $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@`

## Key Takeaways

- **Warning 113015** is harmless in most cases but indicates the generated `.hex` record length does not match the memory port width — this can cause unexpected initialisation behaviour.
- The fix is a single addition to `mem_init.mk`: add **`--record=${mem_hex_width}/8`** to the `$(ELF2HEX)` command line.
- The value `4` in the example (`--record=4`) corresponds to a 32-bit (4-byte) memory width — adjust the formula for other port widths.
- This fix must be reapplied if the BSP is regenerated, as `mem_init.mk` is overwritten during BSP regeneration.

**Source:** Intel Support, [Article 000081351](https://www.intel.com/content/www/us/en/support/programmable/articles/000081351.html).
