This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

putchar uses LPC21xx address for ADUC7026

Hello to all.
I have this EVAL-ADUC7026 Board from Analog Devices. Now i have a problem with the "hello world" Example:
The ADUC7026 enters the Abort-Mode.
I debuged it: The printf-function seems to use a putchar-function. There is a wrong address in C:\keil\arm\lib\putchar.c
The Adress is 0xE0010014 (a LPC21xx address)
So the ADUC7026 is in abort-mode.
How can i work around.
SOS HELP SOS
Thanks in advice

Parents
  • /***********************************************************************/
    /* */
    /* SERIAL.C: Low Level Serial Routines */
    /* */
    /***********************************************************************/

    #include <aduc7024.H> /* ADuC7024 definitions */

    #define CR 0x0D

    int putchar(int ch) { /* Write character to Serial Port */

    if (ch == '\n') {
    while(!(0x020==(COMSTA0 & 0x020)))
    {}
    COMTX = CR; /* output CR */
    }
    while(!(0x020==(COMSTA0 & 0x020)))
    {}

    return (COMTX = ch);
    }


    int getchar (void) { /* Read character from Serial Port */

    while(!(0x01==(COMSTA0 & 0x01)))
    {}
    return (COMRX);
    }

    int write (int file, char * ptr, int len) {
    int i;

    for (i = 0; i < len; i++) putchar (*ptr++);
    return len;
    }

Reply
  • /***********************************************************************/
    /* */
    /* SERIAL.C: Low Level Serial Routines */
    /* */
    /***********************************************************************/

    #include <aduc7024.H> /* ADuC7024 definitions */

    #define CR 0x0D

    int putchar(int ch) { /* Write character to Serial Port */

    if (ch == '\n') {
    while(!(0x020==(COMSTA0 & 0x020)))
    {}
    COMTX = CR; /* output CR */
    }
    while(!(0x020==(COMSTA0 & 0x020)))
    {}

    return (COMTX = ch);
    }


    int getchar (void) { /* Read character from Serial Port */

    while(!(0x01==(COMSTA0 & 0x01)))
    {}
    return (COMRX);
    }

    int write (int file, char * ptr, int len) {
    int i;

    for (i = 0; i < len; i++) putchar (*ptr++);
    return len;
    }

Children