micropython PCB malfunction

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
nick
Posts: 1
Joined: Wed May 06, 2015 5:49 pm

micropython PCB malfunction

Post by nick » Wed May 06, 2015 6:35 pm

Hello,

As a student i got the opportunity to make the micropython PCB. Currently i got my board working but only with programs made in C. When i try to download the micropython core situated in the stmhal directory of the git it doesn't respond. It doesn't even get recognised as a device in mac of windows (in vmware). Building the files is no problem, download the dfu file through DfuSe is aslo successful.

the symptoms are similar to this post: http://forum.micropython.org/viewtopic. ... oard#p2592
however, the cause is not the same as my VBUS signal is connected to PA9.

i'm sensing there might be something wrong with my schematic although it is almost the same as the original
I must say that not all the components are placed on the board yet. only the controller, necessary capacitors, usb connector and pull up/down resistors, 1 led (D4) and the reset button.
PYBOARD_EDIT_V1-1.jpg
PYBOARD_EDIT_V1-1.jpg (114.18 KiB) Viewed 3191 times

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

Re: micropython PCB malfunction

Post by dhylands » Wed May 06, 2015 8:03 pm

I'd recommend that you change this #if 0 to #if 1
https://github.com/micropython/micropyt ... #L382-L392

and move the entire #if block after the call to uart_init0() a few lines down, so that your code looks like:

Code: Select all

    readline_init0();
    pin_init0();
    extint_init0();
    timer_init0();
    uart_init0();

    // Change #if 0 to #if 1 if you want REPL on UART_6 (or another uart)
    // as well as on USB VCP
#if 1
    {
        mp_obj_t args[2] = {
            MP_OBJ_NEW_SMALL_INT(PYB_UART_6),
            MP_OBJ_NEW_SMALL_INT(115200),
        };
        MP_STATE_PORT(pyb_stdio_uart) = pyb_uart_type.make_new((mp_obj_t)&pyb_uart_type, MP_ARRAY_SIZE(args), 0, args);
    }
#else
    MP_STATE_PORT(pyb_stdio_uart) = NULL;
#endif
    printf("Added after UART repl is setup\n");

#if MICROPY_HW_ENABLE_CAN
    can_init0();
#endif
and see if you get anything showing up on the UART. You can put printf calls in the code after the uart_repl is setup and you should see them on the UART.

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

Re: micropython PCB malfunction

Post by Damien » Wed May 06, 2015 11:26 pm

You can also use the led_debug function to see which parts of the code are actually being executed. If it's getting to the REPL loop but not responding on the USB then something is wrong with your USB hardware.

Post Reply