To run programs proceed like for F0 examples. Since STM32F407 processor on F4 Discovery board has 128kB of RAM in RAM area and 64kB of CCM RAM the correct command to set stack pointer is: set $sp=0x20020000 if you want stack in normal RAM and set $sp=0x10010000 if you want stack in CCM RAM.