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-02 07:48 PM
My GPIO_InitStruct errors disappeared (except for GPIO_SPEED_LOW once I entered the command
GPIO_InitTypeDef GPIO_InitStruct;
I am beginning to understand what may be causing all these errors... the whole STM32 ecosystem is built around Cube, where the pins, functions, clocks are all defined in a graphical interface. I am converting code from Microchip to STM32 without using the graphical interface and so some code seems to be missed (like the above statement, which is probably buried inside some obscure routine when using Cube). Most people don't convert by hand, as I am doing, so Cube is successful for the majority. For me, I'll bet if I ran through the Cube process and then added the non-hardware-interface C code afterwards, I wouldn't get the errors that plague me.
2023-05-02 08:34 PM
Instead of GPIO_SPEED_LOW, I used 00 and the line compiles.
For STM32G0 ADC registers, must use ADC1->CR instead of ADC_>CR for some reason
2023-05-03 06:25 AM
Hi @DRobe.4 ,
You can send me the whole project in a private message.
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-05-03 09:24 AM
The Build errors are solely due to improper includes, I think. I will be grateful for any suggestions you have. Since it won't compile yet due to these errors, I can't correct programming errors like incorrect clocks. Once I get it running, I will add an SPI LCD, whereas the Microchip solution used several 4x20 character displays.
2023-05-03 09:38 AM
Well Cube/GUI do hide stuff all over the place making it harder to follow the plot..
Look in the MSP files for the code that actually does a lot of the work behind the scenes.
The HAL doesn't require any of that, you can have clear linear code enable clocks, pins and interfaces/peripherals without any of the CubeMX nonsense/obfuscation.
For missing definitions, check stm32xyz_hal_conf.h has this often controls the include files pulled in, or not.
2023-05-03 10:16 AM
Check the hal_gpio,h code. It might say GPIO_SPEED_FREQ_LOW, or some similar variation.
2023-05-04 08:07 AM
Did you get the file? The errors involve a low level driver (LL). I do not specifically use LL drivers, so am I safe to change the Cube driver to avoid the problem? I have no idea why an ADC LL driver is included.
2023-05-04 09:01 AM
Hello @DRobe.4 ,
The stm32g0xx_hal_adc.h driver have access to the low level macros #include "stm32g0xx_ll_adc.h" for that it is necessary to add the path for stm32g0xx_ll_adc.h driver.
Please let me know if the problem is solved.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-05-04 02:27 PM
2023-05-04 08:02 PM
I commented out sections of stm32g0xx_ll_adc.h involving adc thresholds... I know it is dangerous. The code then had one error... that might be due to missing code.
21 warnings generated.
compiling ERNode_G070.c...
linking...
.\Objects\ElectRoomNodeApr24_2023_G070.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST.
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 2 information, 0 warning and 1 error messages.
".\Objects\ElectRoomNodeApr24_2023_G070.axf" - 1 Error(s), 21 Warning(s).
I have never gotten this far before. Does error L6236E relate to changes that I made to the LL file or is it a brand new problem? Attached is the modified LL file and you can identify the lines I edited because they start with "//".