2020-04-23 01:43 PM
Hello everyone,
So I am currently following: https://www.youtube.com/watch?v=Iyc0vk4jG1E&list=PLnMKNibPkDnFeFV4eBfDQ9e5IrGL_dx1Q&index=14
I am using STM32CubeIDE with a Windows 10 machine.
I used the IDE to generate code for 1 queue, and 2 tasks.
I have been getting undefined reference errors for "osMessageGet" and "osMessagePut":
I have "#include "cmsis_os.h"" at the top of my "main.c", yet I am still continuing to get these errors.
Has anyone run into this problem before? I am confused as to why I am getting this error if I include the file properly, and the link to the header file is part of the path in my project configuration.
Thank you for your help!
-Augusto
2020-04-23 02:33 PM
The definitions are there, but the linker is saying it can't find those objects. It looks like cmsis_os.c is not being compiled.
2020-04-23 02:35 PM
Is there a way you know if I can check that?
2020-05-31 11:37 PM
I ran into this issue using CMSIS v2.
I think there are 2 solutions:
If you decide to use CMSIS v2, here is a way to make the sample code in the video work:
Sample Sender1:
void StartSender1(void *argument)
{
/* USER CODE BEGIN StartSender1 */
struct MsgPrio {
uint8_t message;
uint8_t priority;
} tx;
tx.message = 0x01;
tx.priority = 0;
/* Infinite loop */
for(;;)
{
printf("Task1\n");
osMessageQueuePut(Queue1Handle, &tx.message, tx.priority, 200);
printf("Task1 delay\n");
osDelay(1000);
}
/* USER CODE END StartSender1 */
}
Sample Receiver:
void StartReceiver(void *argument)
{
/* USER CODE BEGIN StartReceiver */
uint8_t buffer_get[1];
/* Infinite loop */
for(;;)
{
printf("Task2\n");
osMessageQueueGet(Queue01Handle, &buffer_get, NULL, 4000);
printf("Received: %d\n", (int)buffer_get[0]);
}
/* USER CODE END StartReceiver */
}
2020-08-10 09:46 AM
Thank you for this additional information
JC
2020-09-30 09:57 AM
Hello I'm having similar problems, I'm trying to create a new USB Host MSC project (USBdisk), I noticed that the sample library uses version 1 of RTOS.
Here is a website that talks a little more about these differences:
https://arm-software.github.io/CMSIS_5/RTOS2/html/os2MigrationFunctions.html
Hello @Ons KOOLI , how are you?
If possible, please update the projects with native examples for STM32CubeIDE and RTOS V2.
It would be very useful if STM updates these examples with STM32CubeIDE and RTOS V2.
It takes time for the new user to find the differences and also prevents new questions about the differences from being created. Thank you.