2011-09-12 03:06 PM
Hi!
I've just purchased my board and I'd like to create my own applications. Is there any example code or similar to get me started? I checked the demo code which is very complex and also found a peripherial library with template project but that is not for Discovery. How can I start with this board? Any idea would be great, Regards, Greg732011-09-14 06:58 AM
Depends on what aspects you want to experiment with. The Keil and IAR evaluations have examples for the STM32 in general, and some of that is fairly portable.
You could take the STM32L-Discovery project (or the STM32L152-EVAL one), and either prune the stuff you don't want out, or strategically add code you want to test or play with into the current code, replace main(), or comment out sections you don't want. Morphing the demo code into something you want will allow you to get comfortable with the process. http://www.st.com/internet/evalboard/product/250990.jsp http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/SW_DEMO/stm32l-discovery_swdemo.zip2011-09-14 01:37 PM
clive1,
thank you for the input. I already have the demo code but found it unnecessarily complex after using other competitors libraries. I prefer my code to be understandable - this demo code is very far from that: layers above layers, structures in structures. I'm not quite new to programming but sincerely I never seen such complexity...just toggling an IO pin requires zillions of code lines...just a whole new level for me. It also doesn't cover such important fields like UART, SPI or timers. Am I really expected to find out how ST had laid down the peripherial library structure without ANY examples or documents? It is very disappointing to have a board with no software support at all. Is ST really thinks that releasing an introductory ARM dev board with no examples with no library is okay? I think I'm just abandon this board till ST releases a proper software support as my time is dearer than wasting it with reverse engineering the one and only demo code. Thanks anyway, Greg732011-09-14 03:40 PM
The STM32 is a very versatile chip - so that naturally means that there's a lot of things that need to be configured.
The alternative to having structures to hold settings would be to have functions with huge parameter lists, or huge numbers of functions each doing very little. I agree that the Peripheral Library documentation is poor. There used to be a PDF manual, but ST switched to a CHM helpfile long ago (a bad move, IMO). There are plenty of examples included in the Peripheral Library, although the coding standards leave a lot to be desired.''I think I'm just abandon this board till ST releases a proper software support as my time is dearer than wasting it with reverse engineering the one and only demo code''
Well, the purpose of an Evaluation boad is to evaluate the product. At least it was cheap!
2011-09-14 04:12 PM
2011-09-15 06:22 AM
''all the others ... provided libraries and examples along their boards.''
ST do provide libraries and examples.''I simply can't afford to spend weeks on toggling pins'' There will always be a learning curve for doing anything the first time - but it won't continue to take as long every time!''it is not gonna work without software support. It just rejects people in the long run. The board is cheap, your time is not''
Indeed - see rant here: ''ST would need short, simple examples of the peripherials'' The library does include a set of short, simple examples for each peripheral.''No need for huge, 'every possible board is included''' Yes, that does rather tend to obscure things.
2011-09-15 02:51 PM
''ST do provide libraries and examples.''
For STM32L-Discovery? Am I overlooking something?''The library does include a set of short, simple examples for each peripheral.'' I've got the STM32L1xxx peripherial library and template project. The template project is for STM32L152-EVAL board. Porting the template to Discovery doesn't look like an easy job. Not impossible though. I hope ST will eventually support its Discovery board.
2011-09-15 04:11 PM
There is only one Library - it is entirely independent of the external target hardware.
You're probably right - the examples aren't targetted specifically at the Discovery board. But the only difference is really which pins are used - surely?2011-09-16 12:42 AM
2011-09-16 01:15 AM
''Got 240 compilation errors''
That usually means that there's one (or a few) ''main'' errors, and all the rest are a direct result. So fix the one (or few) ''main'' errors, and all the consequent errors will also be fixed...