I2C buses dead after firmware upgrade

The official PYBD running MicroPython, and its accessories.
Target audience: Users with a PYBD
Post Reply
pete
Posts: 2
Joined: Mon Jul 22, 2019 3:57 pm

I2C buses dead after firmware upgrade

Post by pete » Tue Aug 13, 2019 9:44 am

Hi,

it seems I managed to brick (somewhat) a Pyboard D by upgrading the firmware to the latest version from [https://micropython.org/download].

Set the device to DFU mode, downloaded the latest (matching) firmware, ran dfu-util - all went very smoothly:

Code: Select all

macallan:~ pete$ dfu-util --alt 0 -D ~/Downloads/PYBD-SF2-20190813-v1.11-194-g3d02ebb4e.dfu 
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Match vendor ID from file: 0483
Match product ID from file: df11
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash  "
file contains 1 DFU images
parsing DFU image 1
image for alternate setting 0, (2 elements, total size = 900800)
parsing element 1, address = 0x08008000, size = 410176
Download	[=========================] 100%       410176 bytes
Download done.
parsing element 2, address = 0x90000000, size = 490608
Download	[=========================] 100%       490608 bytes
Download done.
done parsing DfuSe file
However now the PyBoard no longer sees any devices on the I2C bus (there are four TILE-LED36 on a WBUS-DIP68 connected, and a known good PyBoard D is able to see and control them):

Code: Select all

>>> i2c=machine.I2C("X")
>>> i2c.scan()
[]
I get the same result on bus Y when I connect a LED36 to my DIP28, so this seems more like a general I2C issue than with any particular hardware device.

Unfortunately I didn't upload the old firmware first, so I can't go back right now ... what can I do to debug/resolve this?

Best regards,

Peter.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: I2C buses dead after firmware upgrade

Post by jimmo » Tue Aug 13, 2019 12:10 pm

I think there was a change since the original firmware to not enable the external bus supply by default. You can control this with the 'EN_3V3' pin:

Code: Select all

>>> i2c = machine.I2C('Y')
>>> i2c.scan()
[]
>>> machine.Pin.board.EN_3V3.value(1)
>>> i2c.scan()
[60]

pete
Posts: 2
Joined: Mon Jul 22, 2019 3:57 pm

Re: I2C buses dead after firmware upgrade

Post by pete » Tue Aug 13, 2019 12:19 pm

Bingo! That did it.

Thanks a lot!

nherriot
Posts: 24
Joined: Wed Oct 19, 2016 1:02 pm

Re: I2C buses dead after firmware upgrade

Post by nherriot » Mon Sep 23, 2019 2:34 pm

jimmo wrote:
Tue Aug 13, 2019 12:10 pm
I think there was a change since the original firmware to not enable the external bus supply by default. You can control this with the 'EN_3V3' pin:

Code: Select all

>>> i2c = machine.I2C('Y')
>>> i2c.scan()
[]
>>> machine.Pin.board.EN_3V3.value(1)
>>> i2c.scan()
[60]
Does anyone know why this has been done! This threw me for a few days, i ended up checking sensors, cables, different boards, problems with compiles etc etc etc..... I'm quite annoyed about this???
Furthermore - any new people trying to get something working on I2C will not have a clue - the basic tutorials on sensors, WiKi pages, examples and so on all need to have warnings and point people to a resource on how to enable I2C on the boards. !!!! :-/ ....

If you have to search a forum to get I2C working on a microcontroller, then you failed to make it simple no?
That's my 10p worth....

Kind regards, Nicholas.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: I2C buses dead after firmware upgrade

Post by Roberthh » Mon Sep 23, 2019 6:15 pm

The intention is to save power in power down mode, if required. So you can have external sensors supplied by the 3.3V output, and switch them off when going to low power standby. In my opinion this is a good feature, although I stumble over that too. The actual firmware enabled 3.3v when booting.

Post Reply