Tool/software:
Will the following code write to m_logBuffer as desired when the buffer is at address 0x0004'9C40 or will it also write to someplace else (like 0x0000'9C40)?
My system is crashing when I write to this buffer, but not immediately. The debugger shows that the correct content is being written to the buffer but I'm suspicious since the system doesn't crash if I comment out the vsnprintf call.
Here's a collapsed version of the code -- I'm not showing the va_list and va_start macros of my Printf() function.
#pragma DATA_SECTION("ExtPgm3")
char m_logBuffer[1024] = { 0 };
char *put_ptr = m_logBuffer;
int bytesAvail = sizeof(m_logBuffer) - (put_ptr - m_logBuffer);
int bytesPrinted = vsnprintf(put_ptr, bytesAvail, fmt, args);
put_ptr += (bytesPrinted > bytesAvail) ? bytesAvail : bytesPrinted;
MEMORY CONFIGURATION name origin length used unused attr fill (bytes) (bytes) (bytes) (bytes) ---------------------- -------- --------- -------- -------- ---- -------- MMR 00000000 000000c0 00000000 000000c0 RWIX VECT 00000200 00000100 00000100 00000000 RWIX DARAM 00000400 0000cc00 0000caee 00000112 RWIX DMABuffers 0000d000 00003000 00002acc 00000534 RWIX ExtPgm 00010000 00040000 0002d490 00012b70 RWIX ExtPgm1 00050000 00010000 0000bdce 00004232 RWIX ExtPgm2 00060000 00020000 00020000 00000000 RWIX ExtPgm3 00080000 00020000 00014088 0000bf78 RWIX NCISFrameBuf 000a0000 00020000 00000000 00020000 RWIX