2023-05-01 06:15 PM
Using Keil V5, C program for stm32g0. Have tried to add include paths in Project.Options for target. C tab. include paths, for instance:
C:/Users/ashto/STM32Cube/Repository/STM32Cube_FW_G0_V1.6.1/Drivers/CMSIS/Include;..\..\STM32Cube\Repository\STM32Cube_FW_G0_V1.6.1\Drivers\STM32G0xx_HAL_Driver\Inc
but GPIOInitStruct is undefined, interrupt request names, USART and Timer register names. Many errors. I must be making some simple, fundamental mistake.
Solved! Go to Solution.
2023-05-15 01:50 PM
Here is another way to tackle the problem, if you don't mind a more automated process:
Create your project in Cube MX, and then in Project Manager, choose MDK-ARM as the Toolchain/IDE.
My attempt at this resulted in a zero error(s) and warning(s) message for the build.
Perhaps it's my error, but header files were not listed in the Project view.
2023-05-15 02:04 PM
Here is another way, if you don't mind a more automated approach.
Create your project with CUBE MX, then in the Project Manager window select MDK-ARM as the Toolchain/IDE, filling in the rest of the window as appropriate. My attempt resulted in a build with no errors or warnings. Perhaps it was my error, but header files were in the project directory, but not listed in the uVision project window.
2023-05-20 04:57 PM
I had heard about this before. All other methods failed to link correctly, but this one worked. So thank you for reminding me of this idea. I now can't download on ST-Link for some reason, so I will have to enter another question to the ST audience of experts.
2023-05-21 07:03 AM
A standard ST-Link V2 pod downloaded to flash OK for an STM32L562 application. Make sure your pod firmware is the latest.
Edit: This was in SWD mode.
However, uVision Debug would not run to main. It hung on the first startup code line and would not step. It would not run to main until the second click on Run, then it stepped OK and ran OK. But a power cycle still hung on startup. At this point, I don't know if this is an STLink or Keil uVision problem, or some KEIL/ST integration problem.