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

Exception Handler and Assembler Variables

Hi
I am trying to catch exceptions that are causing my micro to crash (LPC2138).
In the Startup.s assembly module, I have tags for:
do_undefined_instruction:
do_prefetch_abort:
do_data_abort:

I am trying to set a variable that I can access later in main.c so I can check which exception caused the crash (and cannot use JTAG).
I have tried the following (using GNU)

[In Startup.s]
.global source

[during reset]

do_reset:
......
.equ myVar,5

However, I just get rubbish. I am thinking this is because Ram etc. is initialised in the later part of startup.s

(?). However, I will need to set the variable before this happens.
Any assistance would be greatly appriciated.

0