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

Getting Started Serial Interface on Phytec mm167 lost after power cycling.

I implemented the example on p.157 of the Getting Started manual on the Phytec mm167 board, along with corrections mentioned in the knowledge base.

The example works well in debug mode, and I can flash it into the mm167 with the Keil flash tools. It restarts properly on reset, but is blown away when the power is recycled.

Phytec advises excluding the memory space 0x0000AC to 0x0000B0 hex, but that causes the following compile warning:

"WARNING L4: MEMORY SPACE OVERLAP
FROM: 0000ACH.0
TO: 0000B0H.0"

I assume this area has the serial port interrupt vectors to allow the debugger and flash tools work.

Any advice on how I can embed the Keil Serial example so that it executes on power up of the module would be appreciated.

Thanks,
Randy Alley

  • Sorry, the Phytec recommended reserved areas are:
    08H-0BH, 0ACH-0AFH

  • To reserve the vectors used by the monitor program in uv2 goto
    Project->Options for Target. Then under the L166 Misc tab enter 08H-0BH, ACH-AFH in the Reserve box.

    This will reserve both the serial port interrupt and the NMI interrupt vectors.

    Hope this helps,
    Walt

  • Yes, I did that, and hence the memory overlap errors with the Keil example. Either with or without the reserved area, the example won't run after reapplying power.

    Thanks for the comment.
    Randy

  • If you look at your linker listing file (projectname.M66) does it show that you are locating something in that address range? By reserving that space, you are telling the linker not to put anything there. You will only get a memory overlap if you are explicityly telling the linker to put something there. Is it possible that you have defined ISRs using the interrupt directive for the serial port or NMI?

    -Walt

  • Not everything's clear.

    The example works well in debug mode

    Were you using simulator or monitor? If monitor, then in which mode (BSL/SSC0/Simulated Serial) ?

    I can flash it into the mm167 with the Keil flash tools. It restarts properly on reset, but is blown away when the power is recycled.

    Does it mean that it only works if you reset the hardware immediately after programming the flash? Is it possible that program code is preserved in RAM (was loaded there by the debugger prior to flash programming) and is executed off RAM after reset?

    Of course, the application and the monitor cannot use serial interface at the same time.
    My guess is that something is wrong with target settings when the program is run off flash. In most cases memory layout is different in debug mode and in normal mode.

    - Mike

  • The Keil Example uses the serial interrupts, ie:

    void serial_TX_irq (void) interrupt S0TINT = 42;
    void serial_RX_irq (void) interrupt S0RINT = 43;

    These seem to be in the areas recommended by Phytec for exclusion. If I exclude those areas, I get a compiler warning, but can debug. I am using the Keil Monitor-166 Driver.

    The .M66 file reports that the Interrupt Vector Table is in that reserved location, which generates the Memory Overlap error.

    I should say that I have trouble reliably flashing the code in the the mm167, sometimes it works, and other times it doesn't. But I have never got the code to survive cycling the power, compiled with or without the excluded areas.

    Thanks,
    Randy

  • I am having the same problem when using phytec KC167 dev. board. When I include the serial interrupts, the compiler flags the message "Memory space overlap from 0xAC - 0xB0".

    Any thoughts ?

    Thanks

  • If you are not using the monitor you should not reserve space 0xAC-0xAF. This allows the serial interrupt routines to be linked without memory overlap error.

    If you are using the debugger in the UART mode you should reserve space 0xAC-0xAF and you should not link in your serial interrupt routines. You cannot use the SSC port in you application when using the debugger in this mode.

    Another option for debugging is to use a couple I/O pins to simulate the SSC port. This tread may help. http://www.keil.com/forum/docs/thread1393.asp

    -Walt