Converting to C++
Option 1 & 2 allow the use of main.cpp but only if I also make the following change to the linker
C/C++Build>settings>MCU G++ Linker>General>
from:-
${workspace_loc:/${ProjName}/LinkerScript.ld} change
to:-
C:\Users\Richard\Documents\ARM_st\Test_1\SW4STM32\Test_1 Configuration\STM32F401RETx_FLASH.ld
But I can’t generate a class without an error.
I also now get an invalid argument for WritePin(GPIOD,GPIO_PIN_2,1); in the code below.
/* USER CODE BEGIN WHILE */
HAL_GPIO_WritePin(GPIOD,GPIO_PIN_2,1);
while (1)
{
/* USER CODE END WHILE */
HAL_GPIO_TogglePin(GPIOD,GPIO_PIN_2);
HAL_GPIO_TogglePin(GPIOC,GPIO_PIN_12);
HAL_Delay(400);
/* USER CODE BEGIN 3 */
Experimenting I can run main as a cpp file in c mode but as soon as I do it wont resolve the WritePin command above. The class also builds but not if add the #include “stm32f4xx_hal.h”.
I cant see any difference in the build settings - I think I am one small alteration away from succcess but frustration means Atmel is calling!!!! Convert to C++ should mean exactly that.