We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I am running a bareboard code on i.MX6Quad board (It has Cortex A9 processor). The code is written in C and invokes function A in a while loop. Function A invokes Function B with 3 arguments.
After some cycles (around 100-200 cycles) of while loop, an exception occurs. When I investigate further I find this: the first argument received by subroutine B is 0. The second and third arguments are correct.
I checked the processor state when exception came. The stack region from where function A loads r0 has correct value when exception came. But r0 value at function B entry was not correct.
Also, this exception is observed only if MMU is ON. If MMU is OFF, the code works fine.
You defined:
static char * buffer [1024]; // this is an array of pointers to char
Vsprintk (fmt, args, buffer); // my question is what this function does?
VsPrintk processes fmt and args to convert everything that is supposed to be printed into string format. That string is stored in buffer.
This buffer is later sent to console to be printed.
Also, it doesn't seem it matters what VsPrintk does. The first argument (fmt) is 0 at the very first line of this function definition.
Define additional static variable to count how many cycles of while loop is executed before exception will be generated. This either can or can't help to capture location in memory.