Re: [libopenstm32-devel] gpio_toggle and examples question
Status: Inactive
Brought to you by:
uh1763
From: Краљевић М. <kra...@gm...> - 2011-01-30 22:43:16
|
On Sun, Jan 30, 2011 at 4:13 PM, Uwe Hermann <uw...@he...> wrote: > Nice! I also have one of those around now. How do you program them > though? AFAIK it needs SWD and last time I check OpenOCD support for SWD > was not ready yet. Do you use some tool which relies on the internal > bootloader? > I've been programming through the builtin serial bootloader, there is a little gpl'd C program for this here: http://code.google.com/p/stm32flash/ You need a RS-232 <> 3.3V TTL level shifter hooked to USART1, so either a MAX3232, or one of the FTDI deals. I usually just buy Nokia CA-42 cables and cut the end off, they are something like $3 for chinese knockoffs and use a PL2303 or ARK3116 (at least the ones I've come across). There's a driver in linux for both of those ICs for quite some time. Just plug it in and go. No debug, of course. > Sure, having a few examples for the STM32 discovery board would be nice. > I'll try and modify some of the examples to the discovery and submit them some time in the near future. >> void gpio_toggle(u32 gpioport, u16 gpios) >> { >> GPIO_ODR(gpioport) = GPIO_IDR(gpioport) ^ gpios; >> } > > This one is probably the best option. > > >> I suppose it's the same deal either way, just not sure what is >> preferred. I've made a little wig-wag blinker to demo it, if there is >> any want for it. > > Sure. > Sounds good, I'm not sure the method of submitting it - Just send a diff to the list? > >> What else... >> Regarding the clock setup bits, eg. >> rcc_clock_setup_in_hse_8mhz_out_72mhz() - Is there any thought of moving >> this to a more universal function? say like: >> rcc_clock_setup_hse(in_mhz, out_mhz) - or so? Do you think this is >> worthwhile? > > Hm, good question. Not sure if it's worth the trouble, but it wouldn't > hurt either, I guess. > I guess we would have to make it #warn if out isn't a multiple of in, but shouldn't be hard to implement otherwise i don't think... I might play with it and see how it goes. > Various, an incomplete and outdated (and way too unspecific) status page > is at: > > http://sourceforge.net/apps/mediawiki/libopenstm32/index.php?title=Status > Alright. Well I'll try and get some of the examples adapted to discovery for now, as time allows, and go from there. |