Forums

Monitor function in rowley

Started by Martijn Broens December 30, 2008
Hi All,

On the web i noticed the monitor function written by JC Wren for the free
RTOS port. I'd like to use something simmilair in my project.

I tried prortig it to Rowley environment but now I get stuck. i.e. there are
some redirects to stdin and stdout wich I don't understand, I thing I see
what he's doeing. But cant see how to port that to Rowley environment.

See code snip below. What's fileno ???

Also the "open ("/dev/usb", O_RDWR);" what doe sit doe?? I guess it opens
(like fopen("MyFile.txt","rw"); but whats with the /dev/usb

Did anyone already create a monitor function like this under Rowley?? Any
hits

void Monitor_Task(void *p) {

static U8 buffer [256];

static portCHAR *argv [34];

int argc;

int fd = fileno (stdin);

fclose (stderr);

stderr = stdout;

#if defined CFG_CONSOLE_USB

fd = open ("/dev/usb", O_RDWR);

#elif defined CFG_CONSOLE_UART0

fd = open ("/dev/uart0", O_RDWR);

#elif defined CFG_CONSOLE_UART1

fd = open ("/dev/uart1", O_RDWR);

#else

#warning "No Console output defined"

#endif

#if defined CFG_CONSOLE_USB || defined CFG_CONSOLE_UART1

monitorReassignFD (stdin, fd);

monitorReassignFD (stdout, fd);

#endif

monitorVersion (0, NULL);

while(1) {

.

.

}

Thanks in advance

martijn


An Engineer's Guide to the LPC2100 Series

Martinj,

> On the web i noticed the monitor function written by JC Wren for the free
> RTOS port. I'd like to use something simmilair in my project.
>
> I tried prortig it to Rowley environment but now I get stuck. i.e. there
are
> some redirects to stdin and stdout wich I don't understand, I thing I see
> what he's doeing. But cant see how to port that to Rowley environment.
>
> See code snip below. What's fileno ???
>
> Also the "open ("/dev/usb", O_RDWR);" what doe sit doe?? I guess it opens
> (like fopen("MyFile.txt","rw"); but whats with the /dev/usb

...I think the question I'd pose is "What do you want to achieve?"

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
Hi Paul,

I'd like to use the uart0 for monitoring. Using this monitor I'de like to be
able to start, stop tasks. Activate functions in my project.

So for example. I'd like to be able to set LED's while my project is
running. Soemthing like SET LED1 on, beep(periodic, 1HZ) something like
that. That wasy I have fukll control over the hardware even when the prject
is running . could be handy and riskfull at the same time. But he you have
to know what can and can't be set during operation.

thanks martijn

_____

From: l... [mailto:l...] On Behalf Of
Paul Curtis
Sent: dinsdag 30 december 2008 14:00
To: l...
Subject: RE: [lpc2000] Monitor function in rowley

Martinj,

> On the web i noticed the monitor function written by JC Wren for the free
> RTOS port. I'd like to use something simmilair in my project.
>
> I tried prortig it to Rowley environment but now I get stuck. i.e. there
are
> some redirects to stdin and stdout wich I don't understand, I thing I see
> what he's doeing. But cant see how to port that to Rowley environment.
>
> See code snip below. What's fileno ???
>
> Also the "open ("/dev/usb", O_RDWR);" what doe sit doe?? I guess it opens
> (like fopen("MyFile.txt","rw"); but whats with the /dev/usb

...I think the question I'd pose is "What do you want to achieve?"

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.
co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors


> I'd like to use the uart0 for monitoring.

So direct standard in and standard out through UART0 so you can use a
terminal program as a command line interface? I think this is what JC does.
Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.

Hi,



Thats how I understood it. Now I only need to find out how to do this under
Rowley. Thanks for the hint



thanks martijn



_____

From: l... [mailto:l...] On Behalf Of
FreeRTOS.org Info
Sent: dinsdag 30 december 2008 14:18
To: l...
Subject: RE: [lpc2000] Monitor function in rowley



> I'd like to use the uart0 for monitoring.

So direct standard in and standard out through UART0 so you can use a
terminal program as a command line interface? I think this is what JC does.

Regards,
Richard.

+ http://www.FreeRTOS .org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.SafeRTOS .com
Certified by T as meeting the requirements for safety related systems.




Martijn,

> That's how I understood it. Now I only need to find out how to do this
under
> Rowley. Thanks for the hint

...which LPC? I forget...

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

Hi Paul,

LPC2468. but whould that matter? I would think the diff only lies in the
uart or usb routines?

thanks martijn

_____

From: l... [mailto:l...] On Behalf Of
Paul Curtis
Sent: dinsdag 30 december 2008 14:33
To: l...
Subject: RE: [lpc2000] Monitor function in rowley

Martijn,

> That's how I understood it. Now I only need to find out how to do this
under
> Rowley. Thanks for the hint

...which LPC? I forget...

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.
co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors


Hi Martijn,

> LPC2468. but whould that matter? I would think the diff only lies in the
> uart or usb routines?

It matters because the LPC2300s are not the same as the 2100s. VIC
addresses are different, for instance, and so is PCONP. And the PINSEL and
clocking is different. So no, it's not just a difference in the UART or
USB...

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors