Waveshare Port407Z

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
fomichevk
Posts: 4
Joined: Fri Jan 13, 2017 7:04 am

Waveshare Port407Z

Post by fomichevk » Mon Jan 16, 2017 12:47 pm

Hello! I'm trying to run MicroPython on subject board. I take config file from Olimex E407, edited ports with LEDs and buttons, build and upload to board. Everything run well, but I have some questions
Why ttyACM and Flash drive appears only if BOTH usb-ttl adapter and usb cable connected to board? If I use usb only for powering device and attach usb-ttl adapter, I still can't access filesystem and REPL console. Same situation for usb-only connection to PC.
I've attached mpconfigboard.h. Maybe i need to make some changes to config file to get board working properly?
Thanks in advance.
And sorry for my english, not my native.

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

Re: Waveshare Port407Z

Post by dhylands » Mon Jan 16, 2017 5:01 pm

I guess it might depend on how the board is wired.

If your configuration has MICROPY_HW_USB_VBUS_DETECT_PIN set to a pin and VBUS is not actually connected to that pin then that could cause problems.

Looking at the schematic, it seems that board uses PA9 for UART TX, and don't connect VBUS up, so you'll need to make sure that MICROPY_HW_USB_VBUS_DETECT_PIN is not defined.

fomichevk
Posts: 4
Joined: Fri Jan 13, 2017 7:04 am

Re: Waveshare Port407Z

Post by fomichevk » Mon Jan 16, 2017 6:01 pm

Thanks for answer! I forgot to attach config file, so here is: http://pastebin.com/r5Ln76Rv
MICROPY_HW_USB_VBUS_DETECT_PIN is set, you right. I try to change the configuration and see what happens.
is there somewhere a description of all the variables of the configuration file?

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

Re: Waveshare Port407Z

Post by dhylands » Tue Jan 17, 2017 1:41 am

I'm not aware of any documentation of the configuration options other than reading the source code.

fomichevk
Posts: 4
Joined: Fri Jan 13, 2017 7:04 am

Re: Waveshare Port407Z

Post by fomichevk » Tue Jan 17, 2017 5:17 am

JFYI, there is a jumper (USB.P3 on scheme), that connecting 5V to PA9.

Code: Select all

I've short it and everything became well.
Or, I can undefine MICROPY_HW_USB_VBUS_DETECT_PIN, open jumper and everithing is also good.
As I can understand, VBUS pin on USB jack is connected only to power source, not to CPU. USB.P3 jumper eliminates this "flaw".
I'm totally wrong - jumper is used only for USB host powering. Right way to get the USB working - undefine corresponding variable.

And one more question. As datasheet says, STM32F4 have internal ethernet MAC and can do ethernet via external PHY like DP83848. Is it supported by the project?

Thanks

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

Re: Waveshare Port407Z

Post by dhylands » Tue Jan 17, 2017 8:41 am

fomichevk wrote:And one more question. As datasheet says, STM32F4 have internal ethernet MAC and can do ethernet via external PHY like DP83848. Is it supported by the project?
There aren't currently any drivers written to support this.

fomichevk
Posts: 4
Joined: Fri Jan 13, 2017 7:04 am

Re: Waveshare Port407Z

Post by fomichevk » Tue Jan 17, 2017 9:26 am

And one more question:
For what purpose PA9 is used? And MICROPY_HW_USB_VBUS_DETECT_PIN?

I mean, board working properly in both cases: when i connect VBUS to PA9 and left variable set, and when PA9 left unconnected and variable is unset. Which way is right? How I can understand, micropython not using USB OTG, so PA9 must be down, I am right?
Thanks

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

Re: Waveshare Port407Z

Post by dhylands » Tue Jan 17, 2017 6:50 pm

If you look in the datasheet, PA9 can be used for a variety of purposes. It can be used for TIM1_CH2, I2C3_SMBA, USART1_TX, DCMI_D0 as a GPIO, or as OTG_FS_VBUS.

When you configure MICROPY_HW_USB_VBUS_DETECT_PIN you're basically saying you want to use PA9 for the OTG_FS_VBUS configuration.

The software then tells the FS USB that it should use VBUS detection. If the FS USB is configured this way, then it won't work unless a logic high is detected on PA9.

The reason plugging in your serial adapter made it work is because USART1_TX idles in a logic high state.

The "right" way is to configure it to match how the board is wired. In your case PA9 is NOT connected to VBUS, so you should have MICROPY_HW_USB_VBUS_DETECT_PIN undefined.

Post Reply