ATmega128 printf() not working in SimulIDE 1.1.0-SR2
Quote from joa on October 13, 2026, 2:11 pmHello,
I found an issue with
printf()when simulating the ATmega128 in SimulIDE.Environment:
SimulIDE: 1.1.0-SR2
OS: Windows 11
Compiler: AVR-GCC 5.4.0 (AVR 8-bit GNU Toolchain 3.6.2, Microchip Studio 7)
MCU: ATmega128, 16 MHz
UART0: 9600 baud
Problem:
Direct UART output and
puts()work correctly, butprintf()produces no output. The same functionality works correctly with the ATmega328P in SimulIDE.I also tested the
sprintf()example from this earlier report:https://simulide.com/p/forum/topic/avr-atmega128-sprintf-sscanf-not-working/
The following statement still does not work in SimulIDE 1.1.0-SR2:
sprintf(buffer, "\r\nTest %d", 10);These issues may be related.
Attached files:
I've attached
print_ex.zip, which contains two test examples:
ATmega128 (issue reproduced):
printf_ex.candprintf_ex.sim1ATmega328P (working reference):
printf_ex_atmega328p.candprintf_ex_atmega328p.sim1The two C source files are identical. The ZIP also includes compiled HEX/ELF files for both MCUs.
Could you please investigate this issue?
Thank you!
Hello,
I found an issue with printf() when simulating the ATmega128 in SimulIDE.
Environment:
-
SimulIDE: 1.1.0-SR2
-
OS: Windows 11
-
Compiler: AVR-GCC 5.4.0 (AVR 8-bit GNU Toolchain 3.6.2, Microchip Studio 7)
-
MCU: ATmega128, 16 MHz
-
UART0: 9600 baud
Problem:
Direct UART output and puts() work correctly, but printf() produces no output. The same functionality works correctly with the ATmega328P in SimulIDE.
I also tested the sprintf() example from this earlier report:
https://simulide.com/p/forum/topic/avr-atmega128-sprintf-sscanf-not-working/
The following statement still does not work in SimulIDE 1.1.0-SR2:
sprintf(buffer, "\r\nTest %d", 10);
These issues may be related.
Attached files:
I've attached print_ex.zip, which contains two test examples:
-
ATmega128 (issue reproduced):
printf_ex.candprintf_ex.sim1 -
ATmega328P (working reference):
printf_ex_atmega328p.candprintf_ex_atmega328p.sim1
The two C source files are identical. The ZIP also includes compiled HEX/ELF files for both MCUs.
Could you please investigate this issue?
Thank you!
Uploaded files:Quote from arcachofo on October 15, 2026, 10:15 amHi. thanks for reporting (again).
Finally I could find the problem.
As a workaround you can fix it like this:
Edit simulide/resources/data/AVR/mega128.mcu and set prog="65535" at line 3.
Hi. thanks for reporting (again).
Finally I could find the problem.
As a workaround you can fix it like this:
Edit simulide/resources/data/AVR/mega128.mcu and set prog="65535" at line 3.
Quote from joa on October 16, 2026, 2:33 amHi arcachofo,
Thank you very much for investigating this issue and finding the cause!I changed `prog` to `65535` in `mega128.mcu` as you suggested, and confirmed that `printf()` now works correctly.
I also tested the examples from the earlier `sprintf()`/`sscanf()` report, and confirmed that those issues are resolved as well.
I really appreciate your time and effort in tracking down the problem.
Thanks again for your great work on SimulIDE!
Hi arcachofo,
Thank you very much for investigating this issue and finding the cause!
I changed `prog` to `65535` in `mega128.mcu` as you suggested, and confirmed that `printf()` now works correctly.
I also tested the examples from the earlier `sprintf()`/`sscanf()` report, and confirmed that those issues are resolved as well.
I really appreciate your time and effort in tracking down the problem.
Thanks again for your great work on SimulIDE!
