FreeRTOS V10.4 Undefined structs

Post Reply
Author
Message
isra123
Posts: 5
Joined: 29 Dec 2021 08:00

FreeRTOS V10.4 Undefined structs

#1 Post by isra123 » 30 Dec 2021 05:23

Hello
I've tried running FreeRTOS v9 on my dspic33ep512MU810 using the source files from this library [/https://libstock.mikroe.com/projects/vi ... c-examples] I then preceded to upgrade it to v10 following the example of this page[https://magnolia-tech.jp/post-2994/]. I used the port.c files from v9's folder and replaced everything with the v10's source files downloaded from the official FreeRTOS page[https://www.freertos.org/a00104.html]. when running a simple blinking example I get "130 312 Internal error 'Undefined struct' main.c" and it seems to repeat for some other functions too not just main. Case sensitivity is on in my MikroC. I also tried to start a new project, run a simple blinking code without FreeRTOS files, once I was sure it's working I added FreeRTOS files and got the same error. I cannot attach files but here is my main.c code, can someone suggest a solution?

[// Includes

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>

#include "FreeRTOSConfig.h"
#include "FreeRTOS.h"
#include "projdefs.h"
#include "list.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
#include "croutine.h"

//#define NULL 0
// Public Function Definitions
void InitMain()
{
/*Configure Oscillator to operate the device at 70Mhz
Fosc= Fin*M/(N1*N2), Fcy=Fosc/2
Fosc= 8M*70/(2*2)=140Mhz for 8M input clock */
/* N1 = PLLPRE + 2
N2 = 2 x (PLLPOST + 1)
M = PLLDIV + 2 */

PLLFBD = 68; /* M=70 The PLL Feedback Divisor (PLLFBD) register , the last bit of it is PLLDIV*/

CLKDIVbits.PLLPOST = 0; /* N2=2 PLL clock dividors */
CLKDIVbits.PLLPRE = 0; /* N1=2 used to scale down the input
clock (FIN) to meet the PFD input frequency range of 0.8 MHz to 8 MHz */

OSCTUN = 0; /* The FRC Oscillator Tuning (OSCTUN) register is used to tune the internal FRC oscillator
frequency in software */

}
// Task 1 - Blinks PORTB LEDs.
void task1(void *pvParameters)
{
// Initialize AN pins as digital.
ANSELB = 0;

// Set PORTB pins as digital output.
TRISB = 0;

LATB = 0xFFFF;

// Blink PORTB LEDs with some delay.
while (1)
{
vTaskDelay(pdMS_TO_TICKS(250));
LATB = ~PORTB;
}
}

// Task 2 - Blinks PORTD LEDs.
void task2(void *pvParameters)
{
// Initialize AN pins as digital.
ANSELD = 0;

// Set PORTD pins as digital output.
TRISD = 0;

LATD = 0xFFFF;

// Blink PORTD LEDs with some delay.
while (1)
{
vTaskDelay(pdMS_TO_TICKS(500));
LATD = ~PORTD;
}
}


// Task 3 - Blinks PORTF LEDs.
void task3(void *pvParameters)
{
// Set PORTF pins as digital output.
TRISF = 0;

LATF = 0xFFFF;

// Blink PORTF LEDs with some delay.
while (1)
{
vTaskDelay(pdMS_TO_TICKS(100));
LATF = ~PORTF;
}
}

// Main function, which creates the tasks and starts the scheduler.
void main()
{ //ERROR: undefinded struct here
InitMain();

xTaskCreate(
(TaskFunction_t)task1,"Task 1",configMINIMAL_STACK_SIZE,NULL,1,NULL );

// Create task 2.
xTaskCreate(
(TaskFunction_t)task2,"Task 2", configMINIMAL_STACK_SIZE,NULL,1,NULL );

// Create task 3.
xTaskCreate(
(TaskFunction_t)task3,"Task 3",configMINIMAL_STACK_SIZE,NULL,1,NULL);

// Start the RTOS scheduler.
vTaskStartScheduler();

// Will never reach here.
while (1);
} //ERROR: undefinded struct here]

Thank you

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: FreeRTOS V10.4 Undefined structs

#2 Post by filip » 17 Jan 2022 10:24

Hi,

Have you tried to run this in FreeRTOS v9 ?

Regards,
Filip.

Post Reply

Return to “dsPIC Compilers General”