Archive

Author Archive

STM32 Peripheral Notes

January 18th, 2010 No comments

Got some sensors hooked up to my header board.
The code is ugly and needs work, but gets data from stuff.

UART1@115200 = ft232 USB adapter (todo change to internal usb) – for debugging
UART2@9600 = SFE 16×2 SerLCD (For Display)
I2C1@100KHz = TMP102 (temperature) and HMC6352 (compass)

TMP102:

Compatible with LM75
TIe ADD0 to GND for default address 0x90
I just grabbed the LM75 stuff from ST’s STM32103B EVAL Demo kit (tsensor.h/c) and ripped out the LCD stuff – TODO work on formatting, return types, etc

HMC6352:

Get Heading: Send 0x41 (‘A’) and read in two bytes of data / 10 for decimal degrees

I think I like I2C, this was all entirely too easy πŸ™‚

TODO: Improvements so maybe I can post some code, and should do a driver for the ADXL345 accelerometer.

New Gyro, Cam, LCD on the way to figure out as well.

Categories: ARM Tags:

STM32 Buildchain

January 10th, 2010 No comments

So I’m quite frustrated with trying to roll my own arm-elf- toolchain. Building it was easy enough, but getting the options right is proving to be challenging. I managed to work through all the hard/soft FPU stuff with newlib, and got things to compile, but still some linker warnings/errors that result in the app crashing on the hardware. One day I’ll learn to debug and look into this more.

In the meantime, even though the download link for it is quite well hidden, I have discovered that I am quite happy with Codesourcery’s G++ Lite edition. It includes the GNU ARM buildchain, along with some of their proprietary tools (so no, I can’t mirror it πŸ™ ) as an unsupported command line only free version with a license that looks very reasonable to me, so I’m pretty comfortable working with it. Thanks to those responsible for make the Lite version exist, now if only we could get an arm buildchain in the repos…

To save you the trouble of accidentally downloading their full suite trial edition like I did (feel free to purchase it if you want an IDE and other tools), here is a link to the downloads:
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite
You will want to select the EABI (first) link (unless you need a different target OS, which for an STM you probably don’t)
The first links for the Installer are the easiest to use, everything is packaged in a Java installer to extract and setup your path, make links, etc)

I’ve been using Randomskk’s STM32 Skeleton project Randomskk’s GitHub, he has a rather nice blinking LED example in there (I had to change the LED pin for my board and fixup the Makefile to have tabs, but that was all painless).

Now to see if I can get FreeRTOS to build under arm-none-eabi – what fun, doesn’t look like it will be trivial based on the errors I’m getting so far, but I can’t imagine it should be too bad.

Categories: ARM Tags:

Bizarreness

January 10th, 2010 No comments

So we all know that GSM phones can induce various sounds in unshielded amplified speakers, but ever have one take over control of your machine?

I recently got a new Blackberry 8320 and switched it from T-Mobile to AT&T (work phone). Whats fun is that when I set it down to the right of my keyboard (by the mouse and my Polycom) my cursor starts doing strange and interesting things when its radio is active – cursor movement, right clicks/half-clicks, etc – just weirdness. Now if this were an RF mouse or something, sure, but this is a wired, USB, optical mouse, which makes it seem odd. Any theories? Anyone know if optical mice have an ADC anywhere in the input chain?

Categories: TKJ Electronics Tags:

STM32 OpenOCD Config

January 10th, 2010 No comments

Below is the openocd config I am currently using with my STM32 (Olimex STM32 header board from SFE) to program through the JTAG header on the board. Randomskk had better scripts, but they didn’t want to behave for me. Its rather minimal, but it does the job. TODO: integrate changes back into the skeleton project.

Tested on FC10/FC11 with openocd 0.3.1

GIves some weird warning know – run with sudo openocd -f thisfile.cfg 2>&1 | grep -v khz for readable output (filters the repetitious warning)

telnet_port 4444
gdb_port 3333

interface parport
parport_port 0
parport_cable wiggler

jtag_khz 1000
jtag_speed 0

source [find board/olimex_stm32_h103.cfg]

init
reset halt
stm32x mass_erase 0
#flash write_image main.elf 0 elf
#verify_image jtag/flash.elf 0 elf
flash write_bank 0 main.bin 0
verify_image main.bin 0 bin
reset run
shutdown
Categories: ARM Tags: