MCUDev Black STM32F407VET6 + STM32F407ZET6 dev boards

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.
kid06
Posts: 14
Joined: Fri Mar 03, 2017 4:21 pm

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Post by kid06 » Mon Mar 06, 2017 2:13 pm

Indeed one more mistake.

You need to put

Code: Select all

#define MICROPY_HW_RTC_USE_LSE      (1)
***AFTER*** pll definitions or you'll get wrong cpu freq. e.g.:

Code: Select all

#define STM32F407COREV

#define MICROPY_HW_BOARD_NAME       "Black STM32F407CORE (8MHz HSE)"
#define MICROPY_HW_MCU_NAME         "STM32F407"

#define MICROPY_HW_HAS_SWITCH       (1)
#define MICROPY_HW_HAS_FLASH        (1)
#define MICROPY_HW_HAS_SDCARD       (1)   /* XXX */
#define MICROPY_HW_HAS_MMA7660      (0)
#define MICROPY_HW_HAS_LIS3DSH      (0)
#define MICROPY_HW_HAS_LCD          (0)
#define MICROPY_HW_ENABLE_RNG       (1)
#define MICROPY_HW_ENABLE_RTC       (1)
#define MICROPY_HW_ENABLE_TIMER     (1)
#define MICROPY_HW_ENABLE_SERVO     (1)
#define MICROPY_HW_ENABLE_DAC       (1)
#define MICROPY_HW_ENABLE_CAN       (1)

// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
#define MICROPY_HW_RTC_USE_LSE      (1)

// UART config
#define MICROPY_HW_UART1_TX     (pin_A9)   // PA9,PB6
[.....]
Now I continue some checks...

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Post by mcauser » Mon Mar 06, 2017 2:21 pm

That's how all of the other mpconfigboard.h's do it. RTC is defined after HW_CLK
eg. https://github.com/mcauser/micropython/ ... figboard.h

kid06
Posts: 14
Joined: Fri Mar 03, 2017 4:21 pm

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Post by kid06 » Mon Mar 06, 2017 2:49 pm

Thank you mcauser.

I'm a MicroPython newbie, and I've just started looking at source code.

I've done some more tests.
Servo:

Code: Select all

>>> sr=pyb.Servo(1)
>>> sr.angle(-90)
>>> sr.angle(90)
>>> sr.angle(-90)
>>> sr.angle(90)
>>> sr.angle()
85
>>> sr.angle(-90)
>>> sr.angle()
-79
>>> sr.angle(-90)
>>> sr.angle(0)
>>> sr.angle()
0
>>>
correct, apart from calibration.

cpufreq & RTC:

Code: Select all

>>> pyb.freq()
(168000000, 168000000, 42000000, 84000000)
>>> rtc=pyb.RTC()
>>> rtc.datetime()                                                              
(2017, 3, 6, 1, 15, 36, 4, 206)                                                 
>>> 
Cpu freq are identical to your fork.

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Post by SpotlightKid » Fri Mar 10, 2017 4:19 pm

Got my Black STM32F407VET6 board today and it was very easy to get it up and running. Thanks for your good work, guys!

A very minor hick-up I encountered: to get the board enumerated as a DFU device in Linux, it wasn't enough to set the jumper between BOOT0 and 3V3 and press reset, I had to actually disconnect and reconnect the USB cable for the device to show up and to be able to do the the "make deploy". This just as a heads up to anybody getting started with this board too.

Connecting with rhell then worked at first attempt and the RTC was initialised correctly from the start and rtc.datetime() gave the correct output.

I think I'm going to order one of the small blue VCC-GND boards too...

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

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Post by dhylands » Fri Mar 10, 2017 6:56 pm

I have a suspicion about the DFU problem. On my VCC_GND_F407 board it will enter DFU mode but not leave it. Looking at the schematic I see a 1.5k pull down resistor on the D+ line. This overrides the MCU's ability to add/remove a pulldown to simulate a cable unplug/replug, so I have it on my TODO list to remove that resistor and see if that makes things behave better.

The 407 doesn't need the external pulldown resistor, and the pyboard doesn't have one either.

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

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Post by dhylands » Sat Mar 18, 2017 11:25 pm

If you remove R8 (highlighted in the picture) then you can switch between DFU mode and REPL mode without needing to unplug the USB cable.
Attachments
VCC-GND_F407-R8-600.jpg
VCC-GND_F407-R8-600.jpg (231.2 KiB) Viewed 14695 times

pragmantic
Posts: 5
Joined: Tue Jun 20, 2017 6:31 am

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Post by pragmantic » Tue Jun 20, 2017 6:42 am

Hi guys!
So nubeeeee here... is there a place I could download a .bin for the VET6 board? I spent hours trying to compile this and no luck; get a "wrong board " message when I try to make.... Running on windows, even set up an old laptop with Ubuntu to try to do this... nada!

tnx!

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Post by mcauser » Tue Jun 20, 2017 7:08 am

I have compiled the latest v1.9.1-29 firmware for the BLACK_F407VE board and attached to the release:
https://github.com/mcauser/BLACK_F407VE ... tag/v1.0.0

Logged output here:
https://gist.github.com/mcauser/8d0e75d ... 0a29aa01bf

Also compiled v1.9.1 for my other STM32 boards:
https://github.com/mcauser/BLACK_F407ZE ... tag/v1.0.0
https://github.com/mcauser/VCC_GND_F407 ... tag/v1.0.0

pragmantic
Posts: 5
Joined: Tue Jun 20, 2017 6:31 am

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Post by pragmantic » Tue Jun 20, 2017 5:09 pm

Thanx!!! I will try it today!

pragmantic
Posts: 5
Joined: Tue Jun 20, 2017 6:31 am

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Post by pragmantic » Tue Jun 20, 2017 6:58 pm

IT'S ALIVE!!!! THANX!!!

Post Reply