STM32 using Simulink and TrueSTUDIO
Hello there,
I'm trying to set up a STM32F4 Discoveryboard with Simulink.
My Toolchain contains CobeMX, Simulink, Embedded Coder
and TrueSTUDIO. I just wanted to Control an LED using a Signal Generator block:
test.c
/* Model step function */
void test_step(void)
{
test_B.PulseGenerator = ((test_DW.clockTickCounter < 1000) &&
(test_DW.clockTickCounter >= 0));
if (test_DW.clockTickCounter >= 2999) {
test_DW.clockTickCounter = 0;
} else {
test_DW.clockTickCounter++;
}
/* S-Function Block: <Root>/STM32_Config */
/* S-Function Block: <Root>/GPIO_Write */if (test_B.PulseGenerator == 0)
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_RESET);
else
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_SET);
//
}
/* Model initialize function */
void test_initialize(void)
{
/* Registration code */
/* initialize error status */
rtmSetErrorStatus(test_M, (NULL));
/* block I/O */
(void) memset(((void *) &test_B), 0,
sizeof(B_test));
/* states (dwork) */
(void) memset((void *)&test_DW, 0,
sizeof(DW_test));
test_DW.clockTickCounter = 0;
}
Unfortunatly when I compile the Code i get following erros:
.......startup\startup_stm32f407xx.o -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -T../STM32F407VG_FLASH.ld -specs=nosys.specs -static -Wl,-Map=test3.map -Wl,--gc-sections -Wl,--defsym=malloc_getpagesize_P=0x80 -Wl,--start-group -lc -lm -Wl,--end-group -specs=nano.specs
Src\main.o: In function `main':
C:\Users\Desktop\stm32board_test\test3\Debug/..\Src/main.c:149: undefined reference to `test_initialize'
C:\Users\Desktop\stm32board_test\test3\Debug/..\Src/main.c:166: undefined reference to `test_step'
Src\main.o: In function `SysTick_Config':
C:\Users\Desktop\stm32board_test\test3\Drivers\CMSIS\Include/core_cm4.h:2031: undefined reference to `test_M'
collect2.exe: error: ld returned 1 exit Status
I don't know C that well so i hope you can help me :)
Thanks
