yarim wrote on Friday, June 19, 2009:
Hi,
Im using LPC2138, FreeRTOS and Keil combination.
1) I can use the “vSerialPutString” successfuly to print text only mesages on UART0. But it doesn’t support parameter (e.g. %d, %x, %s ).
–> tried to assemble the full masage with "sscanf" (in Keil lib) and then call the "vSerialPutString". Faced some difficulties.
–> than decided to use the Keil’s “printf”. so retraged the “putchar” and “getchar” functions in “retarget.c” to “xSerialPutChar” and “xSerialGetChar”. This time text is printed successfuly but parameters such as %d, %c failed and system hangs on first print of string.
–> than I gave up insisting to use functions "xSerialPutChar" and "xSerialGetChar" funtions because it is communation with UART_ISR with the help of Queues etc after I spend much time investigating the issue, although I found a solution which is not so neat. If a delay accorind to baudrate is added in the "xSerialPutChar" it is working fine.
–> than I retarget the “putchar” and “getchar” functions in “retarget.c” to
Keil’s own implementation of them. So putchar waits TX buff to be empty and sends the new char. This time it is working nice, can print pramaters embedded within text. But calling “printf” from multiple tasks fails, so I protected printf with binay semaphore.
Anybode faced such issues, any comments ?
2) What system resources FreeRTOS uses? Can anyone please list it ?
Becase I want to use timer and notices that systemtick is using timer0 module (in "port.c"). on API it is suggested to use now I am considering to use "vTaskDelayUntil" and "vTaskDelay" system function of FreeRTOS. for exact timing "vTaskDelayUntil" is recommended I think ?
I could not managed to implement my own tick rates on timer1 ISR, I though I am sure about initialization steps and ISR implementations. Any idea ?
any comment on using "printf" in ISR considering the binary semaphore guarding and xportYIELD/ xportYIELDfromISR usage ?
thank.
all the best
Mehmet