Saturday, September 29, 2012

STM32F4 Discovery Hello World (with blinking lights!)

What better way to start off a new blog than with a hello world!? Last week a lovely little STM32F4 discovery board arrived at my door from digikey and this weekend I finally got around to hacking on it. First step was to set up a toolchain (I'm on Linux and using the summon arm toolchain as of now), this was pretty simple to do. Then I downloaded the development libraries from ST, which can be found here, along with tons of other great info about the microcontroller included on the Discovery board.

The next step was to set up a nice, simple, and adaptable template project that I could use as a basis for future developments. Parts of this were adapted from a template I set up for the STM32F1 that I had used previously, along with start-up and linking code from ST's examples. In the future I may personalize more of it, but for now it suits me just fine. The code in there now blinks the four LED's in order, clockwise from green to orange, then red and blue. It's a very simple example, but it's not hard to adapt this little code to do a whole lot more! All the code for this project can be found here.

After creating the code and compiling it, I used a jtag adapter to program the chip itself. The Discovery board comes with an ST-Link programming adapter, but the Linux support with that is somewhat minimal from what I've seen, and I already had my jtag adapter and environment set up how I liked it.

I may write a tutorial soon describing the process of setting up something like this, as well as one on how to use the template "properly". I will also be posting here regularly with updates on various projects made with this microcontroller, including some LCD interfacing soon hopefully!

Here is a little video of the demo running(sorry for the shaky camera, just using my cell phone right now):


And some nice higher resolution photos of the board itself:







This shows my JTAG debugger(yellow PCB) as well

Anyway, that's all for now~ Enjoy!

1 comment:

  1. dongtam
    mu private
    tim phong tro
    http://nhatroso.com/
    nhac san cuc manh
    tổng đài tư vấn luật
    http://dichvu.tuvanphapluattructuyen.com/
    văn phòng luật
    tổng đài tư vấn pháp luật
    thành lập công ty
    http://we-cooking.com/
    chém gió
    trung tâm ngoại ngữra một lãnh ý:

    - Bất luận thực lực của ngươi thế nào loại khíc tức này cũng đáng để ta khâm phục, nếu n hư ngươi thắng, ta dĩ nhiên sẽ đích thân tới gặp Nhạc Thiên để tạ tội.

    Vừa nói xong lão cũng tung người bay lên trên không trung.

    Nhìn thấy Nhạc Thành và Long Đồ đều đã ở trên không trung, tất cả mọi người đều mỏi mắt trông chờ, Nhạc gia và Toan Nghê Tộc đều có suy nghĩ khác nhau.

    Nhạc Thành nhìn thấy Long Đồ ở trên bầu trời nét mặt vẫn lộ vẻ lãnh khốc, khéo miệng nở ra một nụ cười nhạt, thủ ấn của hắn biến đổi, từ mi tâm lóe lên một ánh sáng, Âm Dương Kiếm đã hiện ra trgo tay của hắn.

    Nhạc Thành đối với Long Đồ phía trước không có bao nhiêu áp lực, chặn đánh giết không phải là

    ReplyDelete