Re: [libopenstm32-devel] gpio_toggle and examples question
Status: Inactive
Brought to you by:
uh1763
From: Uwe H. <uw...@he...> - 2011-01-30 22:13:23
|
Hi, On Fri, Jan 28, 2011 at 03:10:35AM -0600, Marko Kraljevic wrote: > Hi, I just got a little STM32 discovery board, came across a post from > Uwe somewhere mentioning libopenstm32 and the script to build the > toolchain. I got it up and running and have been playing around a little > bit. 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 modified examples/button.c to work with the discovery board (should I > be submitting examples modified for this target, anyway? Could be handy, > as the board is 10 bucks.. nice way to get into ARM, I thought). Sure, having a few examples for the STM32 discovery board would be nice. > Anyway, I started to play with a few of the library routines, and > gpio_toggle doesn't exactly work with multiple GPIOs. If you have some Yep, known limitation. > 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. > 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. > (the MCU on this board only goes to 24MHz, so I've just > added a in_hse_8MHz_out_24MHz function temporarily). > Is there a delay function in the works? Nobody I know of is working on it, but it's definately something we need! (timer-based, exact delay instead of the current "loop" quick hack) > What areas of the lib need help? Various, an incomplete and outdated (and way too unspecific) status page is at: http://sourceforge.net/apps/mediawiki/libopenstm32/index.php?title=Status Having specific, working examples for each subsystem would be great, for example. One or two header files may be missing, too. Proof-reading the headers for typos is also a good thing to do, it's easy to miss some typos when you add new #define lists. Other than that, currently some work is going into timers, CAN (I think), USB, and I'll personally probably make an FSMC example sooner or later, as I want to design a hardware with some STM32 that can read/write NAND flash. Uwe. -- http://hermann-uwe.de | http://sigrok.org http://randomprojects.org | http://unmaintained-free-software.org |