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

Crash after adding Code

Crash after adding Code
I have an project with following Flash Code areas:

0x0000 - 0x4000: Downloader
0x4000 - 0xC000: Firmware
0xC000 - 0xFFFF: Parameters

In the Firmware area is about 1 kbyte free memory space. The Code runs in Flash.

The firmware works fine, reprogramming the Parameter area in Flash also on the target system works fine. If a add some code, the firmware crashs after following program part for reprogramming the flash (Parameters):

1. Copy Flash Programming routine from Flash into RAM
2. Switch memory model from Harvard memory to Von-Neumann memory.
(64k Flash, 32k RAM)
3. Run Flash Routine in RAM.

The Program does not return after running Flash Routines. There is no difference to delete the contents (emty funktion). The Jump out of the function fails. If I don't reprogram the Parameter Area, the firmware seems to work fine. I can not see any mal behave.
I had the same problem, if I divide the main() Funktion in more smaller functions. But I never found the cause.

I have controlled the stack on target system and there is enough space.

Has anybody an idea, what happens?

Thanks

Parents
  • Thank's Keil Support Team,
    I am working with your simulator and the trace function. But I think, the Simulator don't know about the changing memory model. I copy the Flash programming routines form the Flash into the RAM at 8000H. Then I change the memory model from:
    code: 0000H...FFFFH (Flash)
    xdata: 0000H...7FFFH (RAM)

    to
    code: 0000H...7FFFH (Flash) and 8000H...FFFFH (RAM)
    xdata: 0000H...7FFFH (Flash) and 8000H...FFFFH (RAM)


    After changing the memory model, the code runs from the RAM. But the Simulator don't know about the changed memory and continue at code 8000h form Flash and not from RAM!

    Is there a way to teach the simulator about the changing memory model?

    Thank you for our help

    Armin

Reply
  • Thank's Keil Support Team,
    I am working with your simulator and the trace function. But I think, the Simulator don't know about the changing memory model. I copy the Flash programming routines form the Flash into the RAM at 8000H. Then I change the memory model from:
    code: 0000H...FFFFH (Flash)
    xdata: 0000H...7FFFH (RAM)

    to
    code: 0000H...7FFFH (Flash) and 8000H...FFFFH (RAM)
    xdata: 0000H...7FFFH (Flash) and 8000H...FFFFH (RAM)


    After changing the memory model, the code runs from the RAM. But the Simulator don't know about the changed memory and continue at code 8000h form Flash and not from RAM!

    Is there a way to teach the simulator about the changing memory model?

    Thank you for our help

    Armin

Children