Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎08-21-2019

Assembly instruction causing application to reboot (UltraScale+ A53)

Hi everyone, 

I have a very strange problem that I cannot seem to figure out. In my code, I have a function called

int debug_printf(const char* format, ...) 
      va_list args;
      va_start (args, format);
// Code to print to shared IO resource ... return status; }

However, when the debug_printf function is called from main.c, the code within it is not executed, and instead, I get sent to a BSP file "asm_vectors.S", to the "_vector_table" label.

The statement I land at is

	b	_boot

This statement takes me to another BSP file, "boot.S" where the _boot label is defined. This instruction causes the processor to reboot, and re-enter my main function.

I stepped through my application in instruction stepping mode, and when I got to the debug_printf call, I saw that after executing the following instruction is when my program to jump to that "b _boot" instruction. These instructions below take place before the body of the function is entered. 

00000000100088ac: stp x29, x30, [sp, #-272]!
00000000100088b0: mov x29, sp
00000000100088b4: str x0, [x29, #24]
00000000100088b8: str x1, [x29, #216]
00000000100088bc: str x2, [x29, #224]
00000000100088c0: str x3, [x29, #232]
00000000100088c4: str x4, [x29, #240]
00000000100088c8: str x5, [x29, #248]
00000000100088cc: str x6, [x29, #256]
00000000100088d0: str x7, [x29, #264]
00000000100088d4: str q0, [x29, #80] // Stepping over this instruction causes the interrupt
00000000100088d8: str q1, [x29, #96]
00000000100088dc: str q2, [x29, #112]
00000000100088e0: str q3, [x29, #128]
00000000100088e4: str q4, [x29, #144]
00000000100088e8: str q5, [x29, #160]
00000000100088ec: str q6, [x29, #176]
00000000100088f0: str q7, [x29, #192]


Other information:

I am running FreeRTOS 10.0.0, however all I've used FreeRTOS to do is set up a STDIO semaphore for the debug_printf function. FreeRTOS is compiled as a static library and not part of the BSP. I mentioned this because FreeRTOS has its own interrupt vector table, but I don't understand why this function call would cause an interrupt in the first place.

I am using the ARMv8 tool chain, and SDK version 2018.3.

I tried renaming the function, that didn't work. I also tried removing the body and making it empty, that also didn't work. I also tried "xil_printf", which has the same signature as my function, and it did work, as in it printed the data out without problems.



Any ideas, or is there more information I can provide?

0 Kudos
1 Reply
Registered: ‎04-13-2015


q# are FPU registers so if your app crashes trying to acess FPU regs it's likely due to the FPU not enable.

0 Kudos