Hi,
Your RCHW looks correct.
If you are able to boot first time and get out of BAF to your startup then its ok.
Do you disable SWT_1 or do you service it?
Because I can see from your startup that SWT_1 disable is conditioned as follow:
#if defined(DISABLE_SWT1)
It looks like enabled and not serviced SWT_1 is causing your resets.
Peter
I had a quick look in your code.
The created ELF file has the following:
Contents of section .rchw:
f9c000 005a0008 .Z..
Contents of section .cpu1_reset_vector:
f9c014 00fa0000 ....
Contents of section .startup:
fa0000 709fe405 7088c000 70780520 54640010 p...p...px. Td..
I compared to code I have and it looks ok I think?
James