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

Postby 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: 133
Joined: Mon Jun 15, 2015 8:03 am

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Postby 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

Postby 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: 185
Joined: Wed Apr 08, 2015 5:19 am

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Postby 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: 2260
Joined: Mon Jan 06, 2014 6:08 pm
Location: Shuswap, BC, Canada
Contact:

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Postby 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: 2260
Joined: Mon Jan 06, 2014 6:08 pm
Location: Shuswap, BC, Canada
Contact:

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

Postby 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 41 times


Return to “Other Boards”

Who is online

Users browsing this forum: devnull and 1 guest