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

Bootloader with 2 Flash ROMS

I have a circuit setup with an Infineon SAB80c517a uC and 2 AT29c256 ATMEL Flash ROMS. The system is setup for ISP where one of the ROMS (starting at 0000H) contains bootloader code which always starts on a reset or power cycle and is mapped as CODE space whereas the other ROM(starting at 8000H) serves as a von-neumann memory space to which the new code is written to. Once the bootloader finishes the download and does the checksum the trouble I encounter is that whenever I jump to the new code using an LJMP 0x8000 call or a ((void (code *)(void)) 0x8000) (); call the uC will not start executing from the 2nd ROM and just hangs. For the program in the 2nd ROM I have set all the linker parameters in keil to start code from 8000H and I also set the interrupt vector offset. I also modified the STARTUP.A51 --> CSEG 8000H. The other question that I have is that in Bootloader mode the internal XRAM of the uC is disabled whereas when I need to execute the code on the 2nd ROM I need to have XRAM enabled. This can only occur with a H/W reset. How can I achieve this with just a LJMP call? I appreciate any help regarding this. Thank you.
PS - Boot functions are not reentrant because they will not be called from the new program.

0