Home/Support/Support Forum/Error When Compiling/Programming Micropython

Error When Compiling/Programming Micropython

0 votes
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
asked May 15 in MicroPython by iscott New to the Community (2 points)

Please log in or register to answer this question.

1 Answer

+1 vote
 
Best answer
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%7CFile%2520system%2520commands%7C_____14
answered May 16 by DigiFan23 Seasoned Professional (158 points)
selected May 16 by iscott
That solved the problem, thanks!
You are welcome
Or from MicroPython, "os.format()" (after "import os").
...