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: 11
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: 152
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: 11
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!

donikuy
Posts: 14
Joined: Fri Feb 09, 2018 10:43 am

Re: Brand new to MicroPython and having issues

Post by donikuy » Mon Feb 12, 2018 2:25 pm

Hi,

Sorry, would you be able to provide me with information to the changes you made to STM32F429 Discovery board to be able to communicate to REPL. I seem to flash to file onto the board using DFuSeDemo, but the board does not appear as a flash drive.
Thank you.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Brand new to MicroPython and having issues

Post by dhylands » Mon Feb 12, 2018 7:41 pm

The USB USER connector on the STM32F429 Discovery board is connected to the high-speed USB and not the full speed USB. DFU is only available on the full speed USB. See this page for details on programming etc: https://github.com/micropython/micropyt ... -STM32F429

Post Reply