learning freertos using pic24 and microsticii 232 comm

gatolen wrote on Friday, January 20, 2017:

Thank you, Is configKERNEL_INTERRUPT_PRIORITY0x01 the same, I seem not to be able to find portKERNEL_INTERRUPT_PRIORITY.

gatolen wrote on Friday, January 20, 2017:

Is there a macro in the portmacro.h for this?

rtel wrote on Friday, January 20, 2017:

You have the file, open it up and have a look.

gatolen wrote on Monday, January 23, 2017:

Looked but not there. I assume it is used for the interrupts for my port. I was able to get example 16 working good using a 32bit timer and setting the IP to configKernalPriority +1. Iam still using vPrintString() until i grasp how to use the serial driver. Works okay for now. When i try to use the daemon task though the interrupt timing was good but the use of the vPrintString() comes up not right probably due to the use of the print functions. Now I am on example 18 using the daemon task again but now in my ISR for TMR3 Interrupt the xTimerPendFunctionCallFromISR() is used, errors seems to tell me to add the MPU_wrappers.h and .c files. They must be used for my Chip. I add them which makes most of the errors go away but I am left with the xPortRaisePrivilege(). I try to find the definition must be looking in the wrong area the portable.h does not have it. Your help is greatly appreciated. Len

gatolen wrote on Monday, January 23, 2017:

I found my mistake, I was unaware of the need to configTimerPend FunctionCallFromISR() in FreeRTOSConfig.h. Working fine. Does portYIELD()
use xHigherPriorityTaskWoken? Thanks

rtel wrote on Monday, January 23, 2017:

Does portYIELD()
use xHigherPriorityTaskWoken? Thanks

Not that I recall. The PIC24 port is older and I think you have to test
xHigherPriorityTaskWoken manually before calling portYIELD(). Refer to
the examples in the main FreeRTOS download.

gatolen wrote on Monday, January 23, 2017:

Going on to Example 19. Trying to use Queues with ISR put in the example and git alot of compiler warnings dealing with stdio.h files. They seem to deal with yvals.h . My stdio.h are lega-c includes from microchip. Havnt ever delt with these. Most be something dealing with the book example and my chip. Any suggestions would be greatful to understand this. Len

rtel wrote on Monday, January 23, 2017:

Are you use the C files from the examples for the Win32 code (from the
Mastering the FreeRTOS Real Time Kernel book, rather than the “Using the
…” book)?

I’m not sure why there would be any difference with how stdio was used
in example 16 compared to others. I just looked at the file and it
doesn’t seem to be used at all.

gatolen wrote on Monday, January 23, 2017:

I think it is used in the vPrintString() call where printf() is called.

rtel wrote on Monday, January 23, 2017:

Why is that different for that particular example though? I think the
print string function should be the same for all the examples. Or is
that example also printing out a number, in addition to the string?

gatolen wrote on Thursday, January 26, 2017:

My reply just got errased. I’ll start again. Found my problem and now able to get exampe 19 to compile. Would not run. I found that by commenting out the vStringPrinter task it would run. Looking into the while loop in the vStringPrinter the xQueuReceive task seems not to see the xStringQueue to have anything in it. I moved my attention to the ISR and put in a vPrintString(pcStrings[ulReceivedNumber] after theXQueueSendToBackFromISR() and ran it keeping the vStringPointer task commented out, gave me the strings printed as it should be. I must have something not quite right with my xQueueSendToBackFromISR() or theQueueReceive() did not receive from the ISR. Any thoughts? Thank you for your patience. Also I have been studying the serial.c and serial.h and would like to try and use them in a test example maybe just an echo program. Does any of the other ports have something simple for me to work with. Well again Thank you . Len

gatolen wrote on Thursday, January 26, 2017:

correction that’s the for loop in the vStringPrinter task which i beleive is where the program stalls.

gatolen wrote on Thursday, January 26, 2017:

After looking further my led is blinking the interrupt but my vStringPrinter stops all my messages.
Moving on to understanding the serial .h and .c files for example teh xSerialGetChar(xComportHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime) :: looking at the xComportHandle pxPort variable xComportHandle is typdef void xComPortHandle this means to me that the varable pxPort now is typedef something to type void . So when I go to call this function instead if the placeholder xComportHandle xPort I would define a variable like xPort MYUART1; then MYUART1 is of type xComPortHandle
which is a pointer to void my MYUART1 can be the return of lets say xSerialPortInitMinimal(). With all the casting and typedef it can be quite intense for my level right now is there any guidance to help move me forward. All in all enjoying my learning and looking forward to knowing this program better, Len

gatolen wrote on Saturday, January 28, 2017:

I guess I most have lost you somewhere. If you do not want to help me get by this just let me know, Len