Issues running legacy code on H8S/2357



My company has acquired some legacy code for a product based on the H8S/2357. Unfortunatley, there is little documentation to the code. I have managed to get the code to compile and link , but by commenting some code which I don't quite understand. When I load the code into the processor, the code runs displays its introductory message on the LCD and then seems to contninuously restart the code. I wondered if this was an issue with some interrupt of the watchdog. Also, the code I commented out takes a copy of the interrupt vector table and copies it to a RAM area. I'm not quite sure why the original coder did this operation as I have no one to ask. I have very little experiene of this operating environment and would really appreciate so advice. Many thanks for your time

  • Commenting code that generates compiler errors is fine to get the code compiled, but bad to let it run.
    Do you use the correct compiler version to build the code? Over time some compiler options changed and new options have been added or removed. If you use the wrong version it may be the code cannot be compiled.
    A crash after some time is not necessarily related to watchdog. It may also be a stack problem, jump to an invalid address, ... .
    Code in RAM looks to me like a flash re-programming routine.
    You only mentioned compiler errors, what about compiler warnings, informational messages?
  • In reply to FrankL:

    Hi, Thanks for your response. I think I should have expanded more on the commenting out of the code. All the code does is copy the interrupt vector table starting from locn 0x170 to locn 0x200000. I commented this out to prevent the linker failing. Also, I wasn't sure if this code was necessary. Any compiler warnings and errors were solved during the process of getting a clean compilation and linkable code. This app provides a user menu that allows another application to be loaded into external flash memory but will run in its own right. We have a legacy hardware system that has all the original code loaded, but we are trying to get to a point where we can compile and update the original code. The code will have been compiled by an earlier version of work bench. I will take onboard your comments.