cancel
Showing results for 
Search instead for 
Did you mean: 

Storing and retrieving an STM32CubeIDE project in GitHub

CKugl.1
Senior II

I have a project (https://github.com/carlk3/Digital-Automotive-Generator-Voltage-Regulator) that I've been developing in STM32CubeIDE on (Ubuntu) Linux. Now I want to move it to STM32CubeIDE on Windows. I'm using GitHub for source code management (SCM), and also, eventually, to share the project. I've tried a few different ways to clone the project from GitHub to Windows, but I haven't been able to come up with a buildable project in STM32CubeIDE. Most recently, I installed and set up EGit (Git integration for Eclipse), and was able to use it to Import the project, but it won't build. I get 3185 errors, 73 warnings. Here is a sample:

../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h:240:20: error: expected declaration specifiers or '...' before 'osThreadId_t'
  240 | #define osThreadId osThreadId_t
      |                    ^~~~~~~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h:510:24: note: in expansion of macro 'osThreadId'
  510 | int32_t osSignalClear (osThreadId thread_id, int32_t signals);
      |                        ^~~~~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c:1791:109: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1791 | osStatus_t osMessageQueueGet (osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout) {
      |                                                                                                             ^
../Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h:742:60: warning: type defaults to 'int' in declaration of 'uint32_t' [-Wimplicit-int]
  742 | void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
      |                                                            ^~~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h:510:46: error: unknown type name 'int32_t'
  510 | int32_t osSignalClear (osThreadId thread_id, int32_t signals);
      |                                              ^~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h:510:46: error: unknown type name 'int32_t'
  510 | int32_t osSignalClear (osThreadId thread_id, int32_t signals);
      |                                              ^~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/include/queue.h:1385:79: error: unknown type name 'BaseType_t'
 1385 | BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue, void * const pvBuffer, BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
      |                                                                               ^~~~~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h:742:69: error: expected ';', ',' or ')' before 'ulBitsToSet'
  742 | void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
      |                                                                     ^~~~~~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h:743:62: warning: type defaults to 'int' in declaration of 'uint32_t' [-Wimplicit-int]
  743 | void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
      |                                                              ^~~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h:516:11: error: expected declaration specifiers before 'osEvent'
  516 | os_InRegs osEvent osSignalWait (int32_t signals, uint32_t millisec);
      |           ^~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h:516:11: error: expected declaration specifiers before 'osEvent'
  516 | os_InRegs osEvent osSignalWait (int32_t signals, uint32_t millisec);
      |           ^~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c:1832:63: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1832 | uint32_t osMessageQueueGetCapacity (osMessageQueueId_t mq_id) {
      |                                                               ^
../Middlewares/Third_Party/FreeRTOS/Source/include/queue.h:1391:1: error: unknown type name 'BaseType_t'
 1391 | BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
      | ^~~~~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h:743:71: error: expected ';', ',' or ')' before 'ulBitsToClear'
  743 | void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
      |                                                                       ^~~~~~~~~~~~~
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h:247:19: error: expected declaration specifiers before 'osTimerId_t'
  247 | #define osTimerId osTimerId_t
      |                   ^~~~~~~~~~~

What am I missing?

1 ACCEPTED SOLUTION

Accepted Solutions
CKugl.1
Senior II

Thanks, Simon.

I found the problem, which was that I used the "Generate peripheral initialization as a pair of .c/.h files per peripheral", so a file named "freertos.c" was generated. In order to export various queue, timer, mutex, and event handles from that file I had created a file name "freertos.h". On Windows, which isn't so picky about case sensitivity, this conflicts with "Middlewares\Third_Party\FreeRTOS\Source\include\FreeRTOS.h".

View solution in original post

3 REPLIES 3
SimonF
Senior

Hi,

I came across your ticket by chance.

If you have not solve your problem: this can simply be a problem between linux and windows about "LF" and "CRLF" newline.

Maybe you can use a linux to windows file converter. Or maybe there is something done inside Git to make it works correctly.

Regards,

Simon

CKugl.1
Senior II

Thanks, Simon.

I found the problem, which was that I used the "Generate peripheral initialization as a pair of .c/.h files per peripheral", so a file named "freertos.c" was generated. In order to export various queue, timer, mutex, and event handles from that file I had created a file name "freertos.h". On Windows, which isn't so picky about case sensitivity, this conflicts with "Middlewares\Third_Party\FreeRTOS\Source\include\FreeRTOS.h".

Glad to hear you found the solution and thanks for sharing.

You should mark your reply as the Answer ;)