analogWrite function with Chromebook

Hello,
I am a new user and having issues. Thank you in advance for taking the time to try and trouble shoot my problem.

I can use analogWrite function in the Arduino Editor with an Arduino UNO R4 WifI to control the brightness of an LED and/or the speed of a motor with my MacBook Air. When I upload the same sketch on the same circuit using a Chromebook, nothing happens. For example, the program below will turn on an LED if I run it from my MacBook but not from a student Chromebook.

void setup() {
 pinMode(5,OUTPUT);   
}

void loop() {
analogWrite(5,255);
delay 1000;
}

If I use digitalWrite, it works both from the MacBook and the Chromebook.

void setup() {
 pinMode(5,OUTPUT);   
}

void loop() {
digitalWrite(5,HIGH);
delay 1000;
}

This is a concern for me because I am a teacher and all of my students have Chrome books and I want to control the speed of motors with the analogWrite function.

Please help!!!

1 Like

I googled that and found this

The currently supported boards include: Arduino UNO R4 Minima . Arduino UNO R4 WiFi . Arduino UNO (R3 and older revisions)

Those are the only supported boards for Chromebook. Not sure if that is the problem or not.

Thank you; however, I am using Arduino UNO R4 WiFi which is reported as supported.

I don't have a Chromebook so I can't help any more. Hopefully someone else will.

Thank you for trying!

Your sketch does not compile.

I'm not familiar with ChromeBooks, MacBooks, WebEditor, Cloud or Uno R4.

There should not be a difference between code generated on a MacBook and code generated on a Chromebook assuming both use the same "things". Do your students use the web editor or do they also use the IDE (not sure if that is possible)? If they use the web editor, have you tried to use that with your MacBook as well?

The students and I are both using the web editor. If I write the program above and upload it onto the Arduino UNO R4 Wifi from my laptop (MacBook Air) the LED will turn on. If I open my web editor account on a Chromebook (does not matter if my personal chromebook or from the school) and upload the exact same code onto the exact same Arduino board with the exact same circuit, the code will upload; however, the LED will not turn on. If I plug an Arduino R3 into the Chromebook and into the circuit and upload the exact same code from the web editor through the chromebook, the LED turns on. If I change the function to digitalWrite instead of analogWrite it works from the chrombook. The problem seems to be with the Chromebook, web based editor, Arduino R4 Wifi board and analogWrite.

Thank you for your time and trying to help!!!

This is the compile message I get after it has uploaded from the Chromebook:
/usr/local/bin/arduino-cli compile --fqbn arduino:renesas_uno:unor4wifi --build-cache-path /tmp --output-dir /tmp/1837145617/build --build-path /tmp/arduino-build-F523A7651843D082D8E0429C45C948B8 /tmp/1837145617/trying_to_get_analogwrite_function
[info] Sketch uses 54548 bytes (20%) of program storage space. Maximum is 262144 bytes.
[info] Global variables use 6748 bytes (20%) of dynamic memory, leaving 26020 bytes for local variables. Maximum is 32768 bytes.
compiling file 'trying_to_get_analogwrite_function.bin'
Starting CDC reset
Opening port
Port closed
SamBaFlasher#openSerial
SamBaFlasher#checkVersion
Arduino Bootloader (SAM-BA extended) 2.0 [Arduino:IKXYZ]

SamBaFlasher#identifyChip
nRF52840-QIAA

SamBaFlasher#setBinaryMode
SamBaFlasher#erase
SamBaFlasher#reset
SamBaFlasher#closeSerial
Upload completed

Is that using the normal IDE or the web editor?

If that is using the normal IDE, I suggest that you try it using the web editor on the Mac and see what happens. That might eliminate one of the possible causes of the problem.

I suggest that you use the below sketch which is blink using analogWrite() on pin 5.

void setup()
{
 pinMode(5,OUTPUT);   
}

void loop()
{
  analogWrite(5,255);
  delay(1000);
  analogWrite(5,0);
  delay(1000);
}

I've just verified that the code can be uploaded and behaves as expected for an Uno R3 (I don't have an Uno R4 WiFi) using the web editor.

It is with the web editor on both the Mac and the Chromebook. I have done the blink; however it does not work with the Chromebook with the R4. It does work with the R3. I have also confirmed.

Thank you!!

I was also able to reproduce this even without an external LED. I tried it with the internal LED.

IDE on Mac with UNO r3 - Works
IDE on Mac with UNO r4 - Works
Cloud Editor on Mac with UNO r3 - Works
Cloud Editor on Mac with UNO r4 - Works
Cloud Editor on Chromebook with UNO r3 - Works
Cloud Editor on Chromebook with UNO r4 - Fails silently, it compiles and runs but the LED will not light up.

void setup() {
 pinMode(LED_BUILTIN, OUTPUT);   
}

void loop() {
analogWrite(LED_BUILTIN, 255);
delay (1000);
}
1 Like

Thanks for the summary. If you enable verbose output during compilation, the first few lines will state which version of the board package is used. Below for a Uno R4 WiFi.

/usr/local/bin/arduino-cli compile --fqbn arduino:renesas_uno:unor4wifi --build-cache-path /tmp --output-dir /tmp/3990428642/build --build-path /tmp/arduino-build-4D87153FE626EC9009B72F34848726AD -v /tmp/3990428642/new_sketch_1727795775777
FQBN: arduino:renesas_uno:unor4wifi
Using board 'unor4wifi' from platform in folder: /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1
Using core 'arduino' from platform in folder: /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1
...
...

Sketch uses 54644 bytes (20%) of program storage space. Maximum is 262144 bytes.
Global variables use 6748 bytes (20%) of dynamic memory, leaving 26020 bytes for local variables. Maximum is 32768 bytes.

Doing the same thing in the normal IDE (2.3.3) on a Windows system

FQBN: arduino:renesas_uno:unor4wifi
Using board 'unor4wifi' from platform in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.2.1
Using core 'arduino' from platform in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.2.1
...
...
Sketch uses 54668 bytes (20%) of program storage space. Maximum is 262144 bytes.
Global variables use 6748 bytes (20%) of dynamic memory, leaving 26020 bytes for local variables. Maximum is 32768 bytes.

Looking at the program storage, there is a difference which is, at minimum, odd.

What I suggest is that you enable verbose output during compilation in the web editor on both your Mac and on the Chromebook and compile your sketch and next compare the sizes at the end.

In case you don't know how to enable verbose output, go to settings in the web editor and scroll down to console verbosity.

For the normal IDE, it will be under file/preferences

You can remove the tick for the upload.

For the testing, you only need to compile, no need for upload.

PS
I used a slightly modified version of my earlier sketch so the numbers will more than likely differ from what you get.

2 Likes

Not odd since the binaries contain a build environment specific string:

cores/arduino/main.cpp:

#ifdef BACKTRACE_SUPPORT
   // "install" stacktrace print over Hardfault handler
   *(irq_vector_table + 3) = (uint32_t)Stacktrace_Handler;
   cm_backtrace_init(stringify(PROJECT_NAME), "RA", __DATE__ "\0");
#endif

platform.txt:

recipe.cpp.o.pattern=... "-DPROJECT_NAME="{build.path}/{build.project_name}""
3 Likes

I am going to look more closely at this later today. Also, the support team gave me a few ideas to try. I will post if the problem gets solved. I just wanted to thank everyone for your support.

Also, I realize that I did not put the 1000ms delay in parenthesis in my original post. That is why my code did not compile. I apologize. My mistake.

1 Like

I tried this from my Cloud Editor on Windows:

/usr/local/bin/arduino-cli compile --fqbn arduino:renesas_uno:unor4wifi --build-cache-path /tmp --output-dir /tmp/3395577460/build --build-path /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81 -v /tmp/3395577460/Internal_LED
FQBN: arduino:renesas_uno:unor4wifi
Using board 'unor4wifi' from platform in folder: /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1
Using core 'arduino' from platform in folder: /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1

Detecting libraries used...
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -w -x c++ -E -CC -DARDUINO=10607 "-DPROJECT_NAME=\"/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/tinyusb -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated-avr-comp -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -iprefix/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1 @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/includes.txt /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/sketch/Internal_LED.ino.cpp -o /dev/null
Generating function prototypes...
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -w -x c++ -E -CC -DARDUINO=10607 "-DPROJECT_NAME=\"/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/tinyusb -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated-avr-comp -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -iprefix/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1 @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/includes.txt /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/sketch/Internal_LED.ino.cpp -o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/preproc/sketch_merged.cpp
/home/builder/.arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/preproc/sketch_merged.cpp
Compiling sketch...
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 "-DPROJECT_NAME=\"/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/tinyusb -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated-avr-comp -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -iprefix/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1 @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/includes.txt /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/sketch/Internal_LED.ino.cpp -o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/sketch/Internal_LED.ino.cpp.o
Compiling libraries...
Compiling core...
Using previously compiled file: /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/pin_data.c.o
Using previously compiled file: /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/common_data.c.o
Using previously compiled file: /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/main.c.o
Using previously compiled file: /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/variant.cpp.o
Using precompiled core: /tmp/core/arduino_renesas_uno_unor4wifi_12026ccdea0152b994ad25341de018d5/core.a
Linking everything together...
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -Wl,--gc-sections --specs=nosys.specs -w -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.elf -L/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81 -L/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -T/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/fsp.ld /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/sketch/Internal_LED.ino.cpp.o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/common_data.c.o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/main.c.o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/pin_data.c.o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/variant.cpp.o -Wl,--whole-archive -Wl,--start-group /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/libs/libfsp.a /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/../core/arduino_renesas_uno_unor4wifi_12026ccdea0152b994ad25341de018d5/core.a -Wl,--no-whole-archive --specs=nano.specs -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -Wl,-Map,/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.map
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-objcopy -O binary -j .text -j .data /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.elf /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.bin
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-objcopy -O ihex -j .text -j .data /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.elf /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.hex

/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-size -A /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.elf
Sketch uses 54556 bytes (20%) of program storage space. Maximum is 262144 bytes.
Global variables use 6748 bytes (20%) of dynamic memory, leaving 26020 bytes for local variables. Maximum is 32768 bytes.

Used platform       Version Path                                                                
arduino:renesas_uno 1.2.1   /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1


Restarting in bootloader mode
Flashing with command:C:/Users/fcorr/.arduino-create/arduino/bossac/1.9.1-arduino5/bossac.exe -d --port=COM7 -U -e -w C:/Users/fcorr/AppData/Local/Temp/arduino-create-agent2745673664/Internal_LED.bin -R
Set binary mode
version()=Arduino Bootloader (SAM-BA extended) 2.0 [Arduino:IKXYZ]
Connected at 921600 baud
identifyChip()=nRF52840-QIAA
write(addr=0,size=0x34)
writeWord(addr=0x30,value=0x400)
writeWord(addr=0x20,value=0)
Erase flash
chipErase(addr=0)

Done in 0.001 seconds
Write 54564 bytes to flash (14 pages)

[                              ] 0% (0/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0, size=0x1000)

[==                            ] 7% (1/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0x1000, size=0x1000)

[====                          ] 14% (2/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0x2000, size=0x1000)

[======                        ] 21% (3/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0x3000, size=0x1000)

[========                      ] 28% (4/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0x4000, size=0x1000)

[==========                    ] 35% (5/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0x5000, size=0x1000)

[============                  ] 42% (6/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0x6000, size=0x1000)

[===============               ] 50% (7/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0x7000, size=0x1000)

[=================             ] 57% (8/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0x8000, size=0x1000)

[===================           ] 64% (9/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0x9000, size=0x1000)

[=====================         ] 71% (10/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0xa000, size=0x1000)

[=======================       ] 78% (11/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0xb000, size=0x1000)

[=========================     ] 85% (12/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0xc000, size=0x1000)

[===========================   ] 92% (13/14 pages)write(addr=0x34,size=0x1000)
writeBuffer(scr_addr=0x34, dst_addr=0xd000, size=0x1000)

[==============================] 100% (14/14 pages)
Done in 3.458 seconds
reset()
Ok

and from my Cloud Editor on Chromebook

/usr/local/bin/arduino-cli compile --fqbn arduino:renesas_uno:unor4wifi --build-cache-path /tmp --output-dir /tmp/1959412622/build --build-path /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81 -v /tmp/1959412622/Internal_LED
FQBN: arduino:renesas_uno:unor4wifi
Using board 'unor4wifi' from platform in folder: /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1
Using core 'arduino' from platform in folder: /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1

Detecting libraries used...
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -w -x c++ -E -CC -DARDUINO=10607 "-DPROJECT_NAME=\"/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/tinyusb -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated-avr-comp -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -iprefix/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1 @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/includes.txt /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/sketch/Internal_LED.ino.cpp -o /dev/null
Generating function prototypes...
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -w -x c++ -E -CC -DARDUINO=10607 "-DPROJECT_NAME=\"/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/tinyusb -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated-avr-comp -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -iprefix/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1 @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/includes.txt /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/sketch/Internal_LED.ino.cpp -o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/preproc/sketch_merged.cpp
/home/builder/.arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/preproc/sketch_merged.cpp
Compiling sketch...
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 "-DPROJECT_NAME=\"/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/tinyusb -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated-avr-comp -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -iprefix/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1 @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/includes.txt /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/sketch/Internal_LED.ino.cpp -o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/sketch/Internal_LED.ino.cpp.o
Compiling libraries...
Compiling core...
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-gcc -c -w -Os -g3 -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu11 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/tinyusb -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated-avr-comp -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -iprefix/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1 @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/includes.txt -o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/pin_data.c.o /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/tmp_gen_c_files/pin_data.c
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-gcc -c -w -Os -g3 -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu11 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/tinyusb -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated-avr-comp -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -iprefix/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1 @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/includes.txt -o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/main.c.o /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/tmp_gen_c_files/main.c
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-gcc -c -w -Os -g3 -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu11 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/tinyusb -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated-avr-comp -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -iprefix/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1 @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/includes.txt -o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/common_data.c.o /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/tmp_gen_c_files/common_data.c
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 "-DPROJECT_NAME=\"/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/tinyusb -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino/api/deprecated-avr-comp -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -iprefix/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1 @/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/includes.txt /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/variant.cpp -o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/variant.cpp.o
Using precompiled core: /tmp/core/arduino_renesas_uno_unor4wifi_12026ccdea0152b994ad25341de018d5/core.a
Linking everything together...
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -Wl,--gc-sections --specs=nosys.specs -w -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.elf -L/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81 -L/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4 -T/home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/fsp.ld /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/sketch/Internal_LED.ino.cpp.o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/common_data.c.o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/main.c.o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/tmp_gen_c_files/pin_data.c.o /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/core/variant.cpp.o -Wl,--whole-archive -Wl,--start-group /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1/variants/UNOWIFIR4/libs/libfsp.a /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/../core/arduino_renesas_uno_unor4wifi_12026ccdea0152b994ad25341de018d5/core.a -Wl,--no-whole-archive --specs=nano.specs -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -Wl,-Map,/tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.map
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-objcopy -O binary -j .text -j .data /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.elf /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.bin
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-objcopy -O ihex -j .text -j .data /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.elf /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.hex

/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-size -A /tmp/arduino-build-6BD52C35BA5E23DCDD7950A99AB58F81/Internal_LED.ino.elf
Sketch uses 54556 bytes (20%) of program storage space. Maximum is 262144 bytes.
Global variables use 6748 bytes (20%) of dynamic memory, leaving 26020 bytes for local variables. Maximum is 32768 bytes.

Used platform       Version Path                                                                
arduino:renesas_uno 1.2.1   /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.1

compiling file 'Internal_LED.bin'
Starting CDC reset
Opening port
Port closed
SamBaFlasher#openSerial
SamBaFlasher#checkVersion
Arduino Bootloader (SAM-BA extended) 2.0 [Arduino:IKXYZ]

SamBaFlasher#identifyChip
nRF52840-QIAA

SamBaFlasher#setBinaryMode
SamBaFlasher#erase
SamBaFlasher#reset
SamBaFlasher#closeSerial
Upload completed

I didn't see anything obvious to me wrong.

Same here, and I had the same result from comparing the output from uploading the sketch from Cloud Editor on a Windows machine (which results in expected runtime behavior) to the output from uploading the sketch from Cloud Editor on a ChromeOS machine (which results in the faulty runtime behavior reported here). I had the hypothesis that maybe a different version of the "Arduino UNO R4 Boards" (machine identifier arduino:renesas_uno) platform (which contains the Arduino pin mapping, implementation of analogWrite, and compilation command patterns) was being used by the two instances of Cloud Editor, but we can see that it is the expected 1.2.1 on both.

I do note that a different upload tool is in use in each (which is not surprising due to the unique limitations on the ChromeOS machine). On non ChromeOS machines, the standard bossac uploader tool is used. On ChromeOS machines, some sort of apparently proprietary "SamBaFlasher" tool is used instead. So maybe the tool is somehow corrupting the binary or flashing it to the wrong area of memory?

The sketch is not running at all, rather than it being that the analogWrite function is having no effect. This can be seen by adding code to blink the built-in LED as well:

byte analogPin = 5;
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(analogPin, OUTPUT);
}

void loop() {
  analogWrite(analogPin, 255);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  analogWrite(analogPin, 0);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

But the problem is not universal to all sketches, as the simple Blink sketch works just fine.