STM32 RS232 settings

Hello, I finally got my STM32-P103 running but I want to make a code that detects whethere there is some data coming in from the RS232 port or not, so the idea is to make the LED flash any time there is a message coming in. But I dont have a clue how to do it… :S

At the moment Im just trying to re-write the main.c file from the example file that makes the LED flash.

I am running it on linux 10.04 and I am using openocd, gnu tools (GDB) and arm-usb-ocd if its relevalt.

Any help with the code i need would be awesome! thanks!

Try looking here for some examples.

http://www.siwawi.arubi.uni-kl.de/avr_p … tm32_blink

Search also the STM site, they have a strong forum.

You WILL need to read the STM32 spec and other documents at the STM site.

STM32 is pretty complex compared to say ARM7.

I recall that help with STM32 (and library) was notoriously poor 1 or 2 years ago, so much so, that I took Martins examples merely as a starting point, combined with several Raissanance RIDE7 examples and other bits I put together a build using codesourcery and programmers notepad2.

In general config scripts enable and configure rs232, then you have to create it, hook it up and start it running. Some of this is in startup configs, and the rest in your main.

Good luck.

Hey, thank you very much for your reply! I checked the web pages that you suggested and I got really interesting codes. However, I am still modifying the main.c file that came with the example, and adding the files that I downloaded, modifying them slightly.

But now I don’t know how to modify the makefile (if it that what i need to change) to flash all these files into the board…at me moment it seems that only the main.c is being download, thus…nothing is working.

Sorry if this is dead easy or stupid but I am really new at this.

Thanks again for your help!

Easiest to do for a new person, is just use the STMFlash tool to load the chip.

It should be on the STM website somewhere.

You want to upload the resulting .hex or .bin file (you have peek at the linker script to tell).

I would suggest you join the STM website forum for the best help too.

You realize, you have a big mountain here to climb, STM32 is not the easiest. I came at it from pic, avr and arm7s and still struggled.