Getting a hard fault

Hi all,

I'm new to embedded programing with Nordic I'm using the evaluation of Fanstel EV-BC805M.
I was trying to program the basic program for blinky led, however by the time I ran the program I got a HardFault
before I got to the first line of  main function.
I assume this cause due to some initialization the code do before it runs my code. 

One of collogues that use another MCU says that I might have use SoftDevice. I read the expiation of soft device but couldn't understand what it should solve my issue.
Please someone can explain what is the use of SoftDevice and why it cause to HardFault I add the code of my blinky led.

Thanks in advance.

int main(void)
{
nrf_gpio_cfg_output(led); // configure the pin as output pin

while(1)
{
nrf_gpio_pin_set(led); //setting logic 1 on pin 17
nrf_delay_ms(500);
nrf_gpio_pin_clear(led);
nrf_delay_ms(500);
}

}

Related