Page 5 of 6

Re: Porting to STM32F429, where to increase code size?

Posted: Sat Dec 19, 2015 10:15 am
by transfer168
This is great post with STM32 USB. Thanks for you all guys.

Re: Porting to STM32F429, where to increase code size?

Posted: Wed Dec 30, 2015 8:34 am
by EasyRider
I am new to MicroPython.

Have been reading a lot over the past few days, very impressed and excited about being able to program ucontroller in high level language like Python. Great effort and achievement by Damien and the team. Thank you all and keep up the great work.

While I am waiting for my pyboards to arrive, I would like to start exploring MicroPython on STM32F429 discovery boards that I have.
Unfortunately, at this stage I am not up speed to set up all the development tools to compile the necessary 429discovery source files.

I would greatly appreciate if one of you Gurus could supply a recent working hex file firmware that can be uploaded with ST-LINK.

Best Regards
John

Re: Porting to STM32F429, where to increase code size?

Posted: Wed Dec 30, 2015 4:49 pm
by pythoncoder
There is firmware here http://micropython.org/download/ at the bottom of the page but it's a dfu file. I've no experience with the Discovery boards but there must be a way in which they can be flashed with the dfu-programmer as per the Pyboard. With the latter you get it into firmware update mode and issue (assuming a file firmware.dfu)
sudo dfu-util -a 0 -D firmware.dfu

Re: Porting to STM32F429, where to increase code size?

Posted: Wed Dec 30, 2015 5:30 pm
by dhylands
The 429 discovery board has to be flashed using stlink. The OTG-FS USB lines that the DFU uses are not exposed, just the USB HS lines, which the DFU doesn't use.

The stm32f4disc firmware from the download page is for the 407 Discovery board, not the 429 Discovery board.

I built some STM32F429DISC targets and put the files here:
https://www.dropbox.com/sh/cq1c07qv5buy ... kIYpa?dl=0

If you flash firmware.bin, it will wipe the filesystem. I flash it using this command (under linux):

Code: Select all

st-flash --reset write firmware.bin 0x08000000
If you want to preserve the filesystem, then you'll want to do 2 separate flashes:

Code: Select all

st-flash write firmware0.bin 0x08000000
st-flash --reset write firmware1.bin 0x08020000

Re: Porting to STM32F429, where to increase code size?

Posted: Wed Dec 30, 2015 11:33 pm
by EasyRider
Thanks Dave,

Have flashed the bin file using ST-LINK utility on Win 7.
Looks like it programmed OK as have activity on LEDS PG13 and PG14, also responding to USER and RST buttons.

However, after flashing still don't have access to any USB, on CN6 USB-HS port (PB14, PB15) or USB-FS with custom USB cable connected (PA11, PA12) as per one earlier post.
From the breakout board, VCC must be connected to both the 5V and PA9 pins, D- must be connected to PA11, D+ must be connected to PA12, and GND to GND. Normally, ID would be connected to PA10 as it is the OTG1 ID pin, but it is not needed in this case.
Can you please clarify which USB port should work, also REPL, should REPL work on any of the UART ports by default, in the bin firmware you linked previously.

Regards
John

Re: Porting to STM32F429, where to increase code size?

Posted: Thu Dec 31, 2015 12:03 am
by dhylands
Unfortunately, the flashing LEDs indicate a Hard Fault. I just flashed that image on my '429 and that's what I see. I'll see if I can figure out what's wrong.

Re: Porting to STM32F429, where to increase code size?

Posted: Thu Dec 31, 2015 12:30 am
by dhylands
I went back in time a bit and git hash add6f4556ed743e150db3a52f2dcab221ff731f1 seems to work on the '429

So I updated the bin files in my dropbox link I sent earlier, and those should work.

Once you've flashed the image, the REPL should be available on CN6.

By default the board is powered if you connect the stlink USB port. If you want to disconnect that and power via CN6, then you'll need a jumper from PB13 to 5V (jumpering PA9 is only valid for the 407 Discovery board).

Re: Porting to STM32F429, where to increase code size?

Posted: Thu Dec 31, 2015 12:35 am
by dhylands
Oh yeah - In order to flash with the firmware in the hard-fault condition, I found that I had to press and hold the RESET button, start the st-flash command and then release the RESET button.

Otherwise, I'll get an error like:

Code: Select all

2015-12-30T16:33:57 INFO src/stlink-common.c: Loading device parameters....
2015-12-30T16:33:57 WARN src/stlink-common.c: unknown chip id! 0xa05f0000

Re: Porting to STM32F429, where to increase code size?

Posted: Thu Dec 31, 2015 3:22 am
by EasyRider
Thanks Dave

Great, All good now.

Time to have some fun.

Best Regards
John

Re: Porting to STM32F429, where to increase code size?

Posted: Thu Dec 31, 2015 8:58 am
by lbattraw
Just a quick note, looks like there has been even more progress on badi's STM32F429 fork:
https://github.com/tobbad/micropython

Under the simple_lcdctrl_support branch there is working code to initialize the LCD, paint pixels, and print text-- great job badi!! Once you flash the image the LCD is initialized and prints some text to the screen. If you copy the stmhal/lcdctrl/main.py over to the flash filesystem (And reboot) it will paint some lines drawn using the lcd.pixel function until it's interrupted with a ctrl-C. Very exciting work, my congratulations and thanks to everyone who's been helping out with this port, it's really looking great!

As a side note, having a LCD on a future PyBoard would be a great addition and go a long way towards creating a standalone system with a minimum of hassle for those that are interested in that type of application, or just want an easy way to interact with a user.

-Larry