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

Ulink can't debug procedure and functions

So I write a code to test an SRAM. Basically it just writes variables to some addresses and reads it back for validation. However, when I step through functions/procedures in debug mode, I landed in HardFault_Handler. I am sure the program is there and working since the program functions as expected. The code look like this

void sram_test()
{
        //write to address
        ...
        //read it back
        //print error if not valid
}

int main(void)
{
        int i;
        for (i=0; i<31; i++){
                *((unsigned char*) ADDR+i) = (unsigned char) i;
        }

        sram_test(); // the procedure
        while(1);//end test
}

FYI, these are things that I've tried:
1. I can step the lines before procedure call normally
2. step into the procedure sram_test return to Hardfault_handler
3. When I copy all the sram_test() code into the main, replacing the procedure, I can again step it normally
4. If I run it from RAM using .ini file, I can step it normally even though there is procedure or function calling.

Any kind of help will be appreciated. Thank you!

Parents Reply Children