Brand new to MicroPython and having issues

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
plunk
Posts: 6
Joined: Thu Oct 05, 2017 1:54 pm

Brand new to MicroPython and having issues

Post by plunk » Thu Oct 05, 2017 2:47 pm

Hello,

I have been working on getting MP set up on a STM32F429 Discovery board, and so far I've been able to successfully interact with the board through serial REPL. However, I'm running into a few odd issues when trying to write a main.py to flash that will run automatically from reset.

One issue is that the filesystem cannot be seen in the REPL. When using rshell or importing and using the os module in PUTTY, I can see a directory named /flash but nothing else, and the tools report that the contents of /flash are empty. If I try to make a new directory or add a file, rshell will throw an error while the os functions seemingly do nothing. However, if I go to the mounted folder in Windows file explorer, I can see any folders or files that I added previously via serial.

Exploring the folder in Windows, I can see that there is an empty boot.py file and nothing else (other than the test directories and files that I added before). I tried adding a main.py with simple code to turn on an led, which worked when ran in the REPL, but nothing happens when I reset the board. Any ideas as to what's causing this, and how I can get a main program running?

chrismas9
Posts: 43
Joined: Wed Jun 25, 2014 10:07 am

Re: Brand new to MicroPython and having issues

Post by chrismas9 » Thu Oct 05, 2017 9:52 pm

You may need to do a file system reset. On pyboard you hold down USR and press RESET. The Green and Yellow LEDs count in binary. When they are both on (3) release USR.

Some other boards don't have enough LEDs. Wait until the LED (bit 0) flashes for a second time then release USR. After about 5 seconds a new drive should mount in Windows with 4 files. You may see a red LED turn on during the erase / write operation.

On some ST boards USR is mapped to the central press of the joystick.

plunk
Posts: 6
Joined: Thu Oct 05, 2017 1:54 pm

Re: Brand new to MicroPython and having issues

Post by plunk » Fri Oct 06, 2017 2:57 pm

After two days of trying to troubleshoot, that fixed it! Thank you!

Post Reply