Hello!
I'm new to mbed and facing a strange problem I've never seen before. The code is only working when executed step by step in the debugger. It is not running, or not running correctly, when running freely. I'm working on an STM32F4 discovery board, which is essentially an STM32F407VG CPU.
First of all, this is the simple demo program:
#include "mbed.h"
DigitalOut myled(LED5);
DigitalIn userButton(USER_BUTTON);
int main() {
while(1) {
myled = userButton;
}
}
If this code is running freely, it is not detecting any button change. The LED reflects only the initial state of the button on reset. If I step through the program with GDB, only with step over, not diving into any function, it works correctly.
The Makefile is available as a gist: https://gist.github.com/anonymous/3460918dcb039c31f2fe
Has anyone seen this behavior before and can help out here?
Btw.: The hardware is working fine. The blinky demo program of the GNU ARM Eclipse-plugin is working correctly.
The hello world blinking LED from the handbook (or was it the cookbook?) didn't work either. I could not convince gdb to look into the hal source files, which is required for debugging into the timer stuff, like wait_ms. But this is more a gdb question and not really related to mbed.
I don't know if this is really a Hello World! question, but as I didn't manage to get past the Hello World! level in mbed, I post it here.
Hello!
I'm new to mbed and facing a strange problem I've never seen before. The code is only working when executed step by step in the debugger. It is not running, or not running correctly, when running freely. I'm working on an STM32F4 discovery board, which is essentially an STM32F407VG CPU.
First of all, this is the simple demo program:
If this code is running freely, it is not detecting any button change. The LED reflects only the initial state of the button on reset. If I step through the program with GDB, only with step over, not diving into any function, it works correctly.
The Makefile is available as a gist: https://gist.github.com/anonymous/3460918dcb039c31f2fe
Has anyone seen this behavior before and can help out here?
Btw.: The hardware is working fine. The blinky demo program of the GNU ARM Eclipse-plugin is working correctly.
The hello world blinking LED from the handbook (or was it the cookbook?) didn't work either. I could not convince gdb to look into the hal source files, which is required for debugging into the timer stuff, like wait_ms. But this is more a gdb question and not really related to mbed.
I don't know if this is really a Hello World! question, but as I didn't manage to get past the Hello World! level in mbed, I post it here.