Page 1 of 1

Pin confuguration STM32F429

Posted: Thu Dec 11, 2014 2:37 pm
by Pikachu
Hello,

i want to change the pin configuration of micropython. Micropython is running on the STM32F429i board and i want to see some led blinking.
I made some new folder in /micro-python/stmhal/boards and named it STM32F429. I put in this folder the same files as in the STM32f4DISC folder.

in the mpconfigboard.h file i changed:

Code: Select all

...
#define MICROPY HW_LED3                          (pin_G13) // red
#define MICROPY HW_LED4                          (pin_G14) //blue
in the stm32f4xx_hal_conf.h i changed:

Code: Select all

#define STM32F429xx
in the pins.csv file i changed:
LED_RED |PG13
LED_BLUE |PG14

Makefile:
BOARD ?= STM32F429

and i put some python code in the main.py file (main.c):

Code: Select all

"# main.py -- put your code here!\r\n"
"#blubb\n"
"import pyb\n"
"def blink():\n"
"	pyb.LED(3).on()\n"
"	pyb.LED(4).on()\n"
"	pyb.delay(300)\n"
"	pyb.LED(3).off()\n"
"	pyb.LED(4).off()\n"
"	pyb.delay(300)\n"
"\n"
"for i in range(20):\n"
"	blink()\n"
"\n"
...
if(reset_mode ==1 || res  == FR_NO_FILESYSTEM){
...
However i cant see any led blinking :(
What am i doing wrong?

thanks for your help

Re: Pin confuguration STM32F429

Posted: Thu Dec 11, 2014 8:06 pm
by dhylands
I suspect that the clocks for PORTG will need to be enabled. See this code for Ports A-D

https://github.com/micropython/micropyt ... #L191-L194

I'd probably do something like:

Code: Select all

#if defined(__GPIOG_CLK_ENABLE)
__GPIOG_CLK_ENABLE()
#endif
The actual define for the G port is in amongst a bunch of other ports as well:
https://github.com/micropython/micropyt ... _ex.h#L333

Re: Pin confuguration STM32F429

Posted: Fri Apr 17, 2015 10:59 am
by jaroslav
Does it mean, that on http://www.st.com/web/catalog/tools/FM1 ... 2/PF259090 micropython works? I read that there is a problem with usb connection from linux. (https://github.com/micropython/micropyt ... -STM32F429)

The prototyping board seems powerful and relatively cheap. With micropython it could be suitable for my students at highschool. What do you think? I'm a little experienced with micropython on pyboard and teensy.

Thanks!

Jaroslav

Re: Pin confuguration STM32F429

Posted: Tue Apr 21, 2015 6:07 am
by Tetraeder
Hello,
At the time you can flash micropython on the STM32F429i with the build-enviroment of the "STM32F4DISCO". Problem is that the USB_OTG connector "CN6" is currently not working, so you have no access to micropython over USB. But you can set in the main.c a UART-instance for the REPL prompt. Further you have to edit pins.csv to get access to all pins.....And there are not tested all functions, for example PWM is working at the moment.

summed it is still much to do.

Its a great board, specifically because of the touch display. Would be great if the REPL prompt running on the display and you can interact with micropython with a connected keyboard on the USB_OTG connector.


But i think the pyboard would be the best choice for your students...