This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

getting started

i'm new to ARM Cortex M4, i have a STM32F4 discovery board.
i've downloaded a sample program for it
and whenever i compile, it shows the following error

MyTest.axf: Error: L6218E: Undefined symbol assert_param (referred from stm32f4xx_gpio.o).

Target not created

can you please help me?

====================PROGRAM header=====================
#include "stm32f4xx.h"

#include "stm32f4xx_gpio.h"

#include "stm32f4xx_rcc.h"

const uint16_t LEDS = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;

const uint16_t LED[4] = {GPIO_Pin_12, GPIO_Pin_13, GPIO_Pin_14, GPIO_Pin_15};

void init();

void loop();

void delay();

====================PROGRAM============================

#include "main.h"

int main() { init();

do { loop(); } while (1);
}

void init() { GPIO_InitTypeDef gpio; RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);

GPIO_StructInit(&gpio); gpio.GPIO_Mode = GPIO_Mode_OUT; gpio.GPIO_Pin = LEDS; GPIO_Init(GPIOD, &gpio);

GPIO_SetBits(GPIOD, LEDS);
}

void loop() { static uint32_t counter = 0;

++counter;

GPIO_ResetBits(GPIOD, LEDS); GPIO_SetBits(GPIOD, LED[counter % 4]);

delay(250);
}

void delay(uint32_t ms) { ms *= 3360; while(ms--) { __NOP(); }
}