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

direct the code to main{} in address 0x0000

Hi
i use SW reset command in my code.
after reset, PC is set to address 0x0000.
unfortunately at this address i can't find nor main{} neither JMP to main.
which are the tools i can use (startup.a51 or others) in order to direct the program on address 0x0000 to main{}?

Parents
  • i use SW reset command in my code.

    That's a very common idea, and just as commonly a really bad one.

    If you need a reset, do yourself a favour and perform the real one, not some cheap knock-off. Jumping to start-of-code is not a reset; it often doesn't even come usefully close.

    The state of just about everything will be different from what it is when the hardware comes up out of an actual, proper HW reset. You'll likely spend more on finding and cleaning up all those differences than you would on just getting a proper reset to be executed. Traditionally one just lets the watchdog starve on purpose. If you don't have a watchdog, maybe you let this be the lesson that teaches why that's a bad idea.

Reply
  • i use SW reset command in my code.

    That's a very common idea, and just as commonly a really bad one.

    If you need a reset, do yourself a favour and perform the real one, not some cheap knock-off. Jumping to start-of-code is not a reset; it often doesn't even come usefully close.

    The state of just about everything will be different from what it is when the hardware comes up out of an actual, proper HW reset. You'll likely spend more on finding and cleaning up all those differences than you would on just getting a proper reset to be executed. Traditionally one just lets the watchdog starve on purpose. If you don't have a watchdog, maybe you let this be the lesson that teaches why that's a bad idea.

Children