WBUS-DIP28 Usb FS port issue (SOLVED)

The official PYBD running MicroPython, and its accessories.
Target audience: Users with a PYBD
Post Reply
User avatar
pythoncoder
Posts: 3539
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

WBUS-DIP28 Usb FS port issue (SOLVED)

Post by pythoncoder » Thu Apr 04, 2019 5:02 am

Using the USB FS port the following crashes the board after a ctrl-D (firmware downloaded this morning)

Code: Select all

MicroPython v1.10-258-g83f3c29d3-dirty on 2019-04-03; PYBD_SF2W with STM32F722IEK
Type "help()" for more information.
>>> import network
>>> s = network.WLAN()
>>> s.active(True)
autoconnect: /dev/ttyACM0 action: remove # and so on, the board has crashed
Peter Hinch

chuckbook
Posts: 93
Joined: Fri Oct 30, 2015 11:55 pm

Re: WBUS-DIP28 Usb FS port issue

Post by chuckbook » Thu Apr 04, 2019 10:04 am

I'm assuming you are working with a DIP28 board. Note that the default current limit for the USB-FS connector is 100 mA.
PE1 (EN1) should read 1, PE6 (EN2) should read 0 for 500mA current limit.

Damien
Site Admin
Posts: 614
Joined: Mon Dec 09, 2013 5:02 pm

Re: WBUS-DIP28 Usb FS port issue

Post by Damien » Thu Apr 04, 2019 1:34 pm

It may be that you have an old bootloader which didn't enable 500mA by default, by pulling Pin(W23) high. To test this, do a fresh hard reset and check the state of pin W23. If it's low then it's 100mA max.

It's possible to update mboot from the pyboard REPL:
  1. download mboot from https://micropython.org/resources/firmw ... _mboot.dfu ; replace SFx with SF2, SF3 or SF6 depending on your board version
  2. download https://github.com/micropython/micropyt ... wupdate.py
  3. put both files on the PYBD's filesystem
  4. on the PYBD execute: import fwupdate; fwupdate.update_mboot('PYBD_SFx_W4F2_mboot.dfu')
BE CAREFUL TO USE THE CORRECT MBOOT FIRMWARE FOR SF2/SF3/SF6!

User avatar
pythoncoder
Posts: 3539
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: WBUS-DIP28 Usb FS port issue

Post by pythoncoder » Thu Apr 04, 2019 5:25 pm

Both my boards read low. Will update tomorrow and report back if the problem persists.

[EDIT]
This is now fixed. Thank you, Damien.
Peter Hinch

chuckbook
Posts: 93
Joined: Fri Oct 30, 2015 11:55 pm

Re: WBUS-DIP28 Usb FS port issue (SOLVED)

Post by chuckbook » Fri Apr 05, 2019 8:33 am

You may test 500mA limit without updating mboot by putting:

Code: Select all

EN1 = pyb.Pin('E1', mode=pyb.Pin.IN, pull=pyb.Pin.PULL_UP)
in boot.py

User avatar
pythoncoder
Posts: 3539
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Recommendation

Post by pythoncoder » Fri Apr 05, 2019 9:20 am

I strongly recommend that users do update mboot if necessary. I struggled all day with nondeterministic behaviour connected with the startup of code after reset or power cycle. All but one problem went away since I updated. The last could just be a bug in my code.
Peter Hinch

Post Reply