Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Serial.write(0x00) fails to compile

Open
#94 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
arduino, cpp
Domain
embedded-iot

Research direction

Reproduce the Due compile failure with the attached Serial.write example, then read cores/arduino/UARTClass.h and cores/arduino/Print.h where the competing write overloads are shown. Confirm that the literal 0x00 compiles while preserving the existing variable case, and verify the result with the Arduino Due build.

Written by the indexing model from the issue text.

Description

just stumbled across a weird behavior. If I send a 0x00 via Serial.write(), compiler fails with the below error. Values other than 0x00 are fine, and also sending a variable with value 0x00 (see attached demo)

Notes:

  • This occurs for all Serials (0-3) on Arduino Due. Mega and Uno are ok
  • I am running Linux x64 with IDE 1.8.10 and SAM package 1.6.12
  • a fresh re-install of the SAM package via IDE did not help

Here the compiler output:

Serial.write.zip

Arduino: 1.8.10 (Linux), Board: "Arduino Due (Programming Port)"

/opt/arduino-1.8.10/arduino-builder -dump-prefs -logger=machine -hardware /opt/arduino-1.8.10/hardware -hardware /home/georg/.arduino15/packages -tools /opt/arduino-1.8.10/tools-builder -tools /opt/arduino-1.8.10/hardware/tools/avr -tools /home/georg/.arduino15/packages -built-in-libraries /opt/arduino-1.8.10/libraries -libraries /home/georg/Dokumente/Arduino/libraries -fqbn=arduino:sam:arduino_due_x_dbg -vid-pid=0X2341_0X003D -ide-version=10810 -build-path /tmp/arduino_build_862278 -warnings=none -build-cache /tmp/arduino_cache_314170 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.bossac.path=/home/georg/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=/home/georg/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/georg/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=/home/georg/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1 -verbose /home/georg/Schreibtisch/Serial.write/Serial.write.ino
/opt/arduino-1.8.10/arduino-builder -compile -logger=machine -hardware /opt/arduino-1.8.10/hardware -hardware /home/georg/.arduino15/packages -tools /opt/arduino-1.8.10/tools-builder -tools /opt/arduino-1.8.10/hardware/tools/avr -tools /home/georg/.arduino15/packages -built-in-libraries /opt/arduino-1.8.10/libraries -libraries /home/georg/Dokumente/Arduino/libraries -fqbn=arduino:sam:arduino_due_x_dbg -vid-pid=0X2341_0X003D -ide-version=10810 -build-path /tmp/arduino_build_862278 -warnings=none -build-cache /tmp/arduino_cache_314170 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.bossac.path=/home/georg/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=/home/georg/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/georg/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=/home/georg/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1 -verbose /home/georg/Schreibtisch/Serial.write/Serial.write.ino
Using board 'arduino_due_x_dbg' from platform in folder: /home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12
Using core 'arduino' from platform in folder: /home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12
Detecting libraries used...
/home/georg/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10810 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER="Arduino LLC"" "-DUSB_PRODUCT="Arduino Due"" -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/system/libsam -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/CMSIS/Include/ -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/ -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/variants/arduino_due_x /tmp/arduino_build_862278/sketch/Serial.write.ino.cpp -o /dev/null
Generating function prototypes...
/home/georg/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10810 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER="Arduino LLC"" "-DUSB_PRODUCT="Arduino Due"" -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/system/libsam -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/CMSIS/Include/ -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/ -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/variants/arduino_due_x /tmp/arduino_build_862278/sketch/Serial.write.ino.cpp -o /tmp/arduino_build_862278/preproc/ctags_target_for_gcc_minus_e.cpp
/opt/arduino-1.8.10/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_862278/preproc/ctags_target_for_gcc_minus_e.cpp
Sketch wird kompiliert...
/home/georg/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10810 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER="Arduino LLC"" "-DUSB_PRODUCT="Arduino Due"" -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/system/libsam -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/CMSIS/Include/ -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/ -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino -I/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/variants/arduino_due_x /tmp/arduino_build_862278/sketch/Serial.write.ino.cpp -o /tmp/arduino_build_862278/sketch/Serial.write.ino.cpp.o
/home/georg/Schreibtisch/Serial.write/Serial.write.ino: In function 'void loop()':
Serial.write:8:20: error: call of overloaded 'write(int)' is ambiguous
Serial.write(0x00); // fails
^
/home/georg/Schreibtisch/Serial.write/Serial.write.ino:8:20: note: candidates are:
In file included from /home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/variants/arduino_due_x/variant.h:38:0,
from /home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/Arduino.h:201,
from /tmp/arduino_build_862278/sketch/Serial.write.ino.cpp:1:
/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/UARTClass.h:55:12: note: virtual size_t UARTClass::write(uint8_t)
size_t write(const uint8_t c);
^
In file included from /home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/Stream.h:26:0,
from /home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/HardwareSerial.h:24,
from /home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/Arduino.h:195,
from /tmp/arduino_build_862278/sketch/Serial.write.ino.cpp:1:
/home/georg/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/Print.h:49:12: note: size_t Print::write(const char*)
size_t write(const char *str) {
^
exit status 1
call of overloaded 'write(int)' is ambiguous

Dominant language
HTML
Stars
91
Forks
112
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from arduino/ArduinoCore-sam

All issues in arduino/ArduinoCore-sam

Similar issues

More Embedded & IoT issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.