Forum Discussion
PeterTs
New Contributor
5 years agoI can confirm preloader successfully launches the application and I can now step through the application under JTAG.
It turns out a breakpoint has to be placed at the internal RAM address in the preloader one or two assembly language instructions before it calls the application, otherwise JTAG debugging won't step through correctly. The breakpoint should be placed at the start or shortly after the start of the jump_to_image_no_args function (the address is in u-boot-spl.map).
There are still two issues that cause the application to fail:
- In startup.s an exception is invoked when the MMU is enabled. This occurs whether the app is running under JTAG or without. Does anyone know why this should be the case? On checking the translation table I see the virtual addresses match the actual addresses. Does the MMU need to be enabled or is this optional?
- Once in my main() function I'm calling a series of functions to initialise the various modules I'm using, including setting up interrupts (for both UARTS, I2C, private timer, etc). Shortly after I call alt_int_cpu_enable() and alt_int_global_enable() the PC jumps to address 0x00000000 (the reset exception vector). Why does this occur? I thought all interrupts were handled by the Global Interrupt Controller using addresses programmed into the distributer registers.