Lab Notes 9/29/2012

I'm still playing with the STM32F0DISCOVERY board. I've written some code that uses timers TIM2 and TIM3 to produce PWM outputs suitable for driving radio-controlled servos. The timers can produce the required waveform with no intervention from the CPU. So once the timer is correctly configured and the servos are put in the desired position no further attention from the software is necessary.

I found that doing float or uint32_t arithmetic seems to haul in large parts of the newlib library, which bloats my code quite a bit. Just initializing the servos takes 11K of code space! I need to look into that further and see what can be done to tame this code bloat.

I was going to write a tutorial on using OpenOCD to debug code on the chip. Dr. Al-Hertani has such a tutorial here, although my results weren't as positive as his. I find that I have to use the telnet session to OpenOCD and manually issue a 'reset halt' command before each debug session. I don't know why.

I added the Subclipse package to my installation of Eclipse to put my code under source control. I feel much better about experimenting with my code now.

Since my code is under source control, I may rebuild the VM that I'm using to host my build environment and see if I can fix the issues with OpenOCD.

I turned on the compiler warnings "implicit conversion warnings" in my projects. These code issues have bitten me before so having the warnings on is nice. Unfortunately, many lines in the Standard Peripheral Library cause these warnings to be triggered. I edited some of the library files with the appropriate #pragma to suppress these warnings. For example:

[cce]#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
╥╥╥╥╥╥*(__IO uint16_t*) tmp = Data >> 16;
#pragma GCC diagnostic pop[/cce]

I've been at the computer enough today. I think I'll see if I can find some college football on the television.

Leave a Reply

Your email address will not be published.


*