Heya,
A while back I brought an STM32F407 Cortex M4 Discovery board
I can't find any decent tutorials that are up to date and work.
Does anyone have any good links to tutorials? Just somthing like a simple blink would be a good starter. I don't have too much experiance with microcontrollers other then arduino.
Thanks!
EDIT:
I have already tried CooCox's IDE but I can't seem to figure out config properly. I really need some kind of starting tutorial to get to understand these things.
I've been using the CooCox IDE with this Discovery board, and I agree, it's not as easy for a beginner. But there are a few resources out there that will help. One thing that may not be obvious is that CoIDE alone is not enough. You also need the ARM compiler and the ST-LINK utility from STM to program and debug the board. This is reasonably well explained
here and also in this
. Both are slightly outdated and for a different Discovery board, but should help get you started.
On my own blog I have a few post about some of the peripherals, including some things that are not obvious to users of smaller micros (e.g. having to explicitly turn on clocks for peripherals including the GPIO's - the video talk about this too).
A big fan of CoIDE too.
The set-up is super easy and tons of context-sensitive examples to get you going in no time.
Thanks for the help everyone. It's a bit of a pain as I'm going off out of home for a week. But you will hear from me later if its working or not
A big fan of CoIDE too.
The set-up is super easy and tons of context-sensitive examples to get you going in no time.
Completely agree! I've used CoIDE for the past year and I find it really easy to use once you get it setup. If I recall correctly, the method I used is:
- Install STLink drivers (download from ST website)
- Download and install latest version of CoIDE, either through CoCenter or as a standlone download
- Create a new project with your selected microcontroller (STM32F407 in this case!)
- Include required peripheral files on the repository list
- Plug in STM32F407 discovery board
- Compile and test program!
Probably isn't the greatest bit of help but keep trying and it will definitely pay off, the ST micros are brill.
Edit: I've got a few STM32F0 tutorials on my blog if you also have an STM32F0 discovery board -
www.hsel.co.uk
Simpler than that:
1) download the gcc compiler from the launchpad and install it;
2) download coide and install it;
3) configure coide to use the installed gcc compiler: coide will prompt you;
4) create a new project for your chip, link in the components;
5) compile, download and you have a working project,
Cannot be simpler than that.
Okay. Something isn't working.
#include "stm32f4xx.h"
int main(void)
{
RCC -> AHB1ENR |= (1 << 3);
GPIOD -> MODER |= (1 << 26);
GPIOD -> ODR |= (1 << 13);
while(1)
{
}
}
I can't seem to get the LED on PD13 to turn on.
Could anyone figure out whats wrong?
These are the errors I'm getting.
cannot see your error message.
the code is largely right. i would clear bit 27 and explictly set other port registers, just in case they have some weird values.
make sure the port/pin for the led is right, the led polarity is right.
make sure your project is set up right.
when i get some time i will try on my f4 discovery.
Okay. Something isn't working.
#include "stm32f4xx.h"
int main(void)
{
RCC -> AHB1ENR |= (1 << 3);
GPIOD -> MODER |= (1 << 26);
GPIOD -> ODR |= (1 << 13);
while(1)
{
}
}
I can't seem to get the LED on PD13 to turn on.
Could anyone figure out whats wrong?
These are the errors I'm getting.
I think thats to do with administrative privileges/firewall when running CoIDE. tasklist.exe generally contains each task required to get the program from code to microcontroller (compile, link, download etc.), if its failing to run, it's likely that your computer is stopping it. Try temporarily disabling your firewall to see if that helps OR try running CoIDE as administrator. I might not be getting this problem because I have CoIDE installed directly to my C:\ instead of in program files (Don't ask me why!).
The fact that gdbserver also fails to launch (for debugging) really shows that it could be something on your computer blocking the program from running.
Can't seem to get debug working at all. I have all the correct files including tasklist.exe.
I can live with that not working, the bigger problem is that I can't seem to get any reaction out of my microcontroller.
I can upload that program but the LED doesn't come on, nor does the pin change its voltage from 0.00v.
Try running tasklist and gdbserver from a dos command prompt. If they don't start then hopefully you'll get some error messages that will help eg. wrong permissions etc.
...I can upload that program but ...
This might be a stupid question, but how do you know this if nothing happens?
Also, in CoIDE, when you upload a file to the board via the "Debug" button, it is actually (for me at least) paused by the debugger, and you have to push the "play" button to make it run.
...I can upload that program but ...
This might be a stupid question, but how do you know this if nothing happens?
Also, in CoIDE, when you upload a file to the board via the "Debug" button, it is actually (for me at least) paused by the debugger, and you have to push the "play" button to make it run.
Well, It said that it had flashed and the data LED was flashing.
Try running tasklist and gdbserver from a dos command prompt. If they don't start then hopefully you'll get some error messages that will help eg. wrong permissions etc.
Will give that a try
I can confirm for you that on the F4 discovery board, your code runs and debugs as expected.
I can confirm for you that on the F4 discovery board, your code runs and debugs as expected.
Well, that makes me worry a little really. Thanks for checking though
When setting up, was there anything you changed at all?
I can't seem to find gdbserver.exe on my computer, even in the GNU Tools ARM Embedded folder.
When setting up, was there anything you changed at all?
I can't seem to find gdbserver.exe on my computer, even in the GNU Tools ARM Embedded folder.
It should be present in your .../CoIDE/bin folder
Found it
Still can't get stuff running though. I'm gonna buy another board incase mine is faulty somehow.
Found it
Still can't get stuff running though. I'm gonna buy another board incase mine is faulty somehow.
Before you do that! Download the ST STLink utility, plug it in and see if it connects to the board. If it does, you should be able to see what microcontroller you have and a few specs about it (SRAM and Flash) memory. If this succeeds, your board should be working successfully.
Yeh, It does seem to connect and all just fine... but the fact I can't program it etc is causing me some worry and no small amount of fustration...
Yeh, It does seem to connect and all just fine... but the fact I can't program it etc is causing me some worry and no small amount of fustration...
Are you using windows 7 or windows 8? I sometimes have a few problems with the STLink under windows 8. If you're using windows 7, you could try installing CoIDE to your C:\ drive. Windows 8 has problems with creating and modifying files in the program files folder at times.
I've been using windows 7. As of now CoIDE is installed in the C drive but still does not seem to want to debug... not sure what else to try.
EDIT:
Don't know why I wrote 'Windows 8' I'm actually using windows 7.
When setting up, was there anything you changed at all?
...
I'm pretty sure the only things I manually changed was
setting the "toolchain path" (i.e. compiler etc), and
selecting the correct hardware adapter for debug (ST-Link/V2).
I seem to have done all that and it all checks out... I still get these errors: