Error When Compiling/Programming Micropython

When I try to write the following micropython code to flash to run at start-up, I get the error below. Then what appears to be a reset.
Applying the same code via paste mode gets the expected results: the LED flashes.

>>>
flash compile mode; Ctrl-C to cancel, Ctrl-D to finish
1^^^ from machine import Pin
2^^^ import time
3^^^ dio5 = Pin(“D5”, Pin.OUT, value=0)
4^^^ while True:
5^^^ time.sleep(1)
6^^^ dio5.toggle() # Flash the LED on DIO5 (D5)
Erasing /flash/main.mpy…
Compiling 148 bytes of code…

OSError: [Errno 7019] ENODEV

MicroPython v1.10-1179-g94f4f29 on 2019-04-03; XBee3 DigiMesh 2.4 with EFR32MG
Type “help()” for more information.

It looks to me like the compilation is failing, but I can’t find much info on this error aside from it meaning “No such device”.
Any help would appreciated, thanks.

Ian

You need to format your file system. In command mode issue a: atfs format confirm.
https://www.digi.com/resources/documentation/digidocs/90001525/default.htm#reference/r_cmd_fs_format.htm%3FTocPath%3DAT%2520commands|File%2520system%2520commands|_____14

1 Like

That solved the problem, thanks!

You are welcome

Or from MicroPython, “os.format()” (after “import os”).