Other Parts Discussed in Thread: CC1314R10, SYSCONFIG
Tool/software:
When running my code under nortos, everything looks normal.
When I try to port that code to freertos I get an exception in sprintf(). Since I am using GCC and assume the same libraries for this function
are used in both cases, this seems weird to me. When I step through the code the freertos version steps OK until I hit the sprintf() statement.
void xprint_int(int a) {
// int len;
char outbuf[16];
sprintf(outbuf,"%d",a);
xprint(outbuf);
}
xprint is just a wrapper for UART_write, and works for pure text in this program.
When the statement is hit the debugger seems to loose contact with the board, and becomes unresponsive.
It is NOT possible to step ito the sprintf statement.
If I "view disassembly" at the sprintf statement I get that, and can step machine instructions. Stepping further I get to siprintf(), sprintf():
stepping further I get to _svfiprintf_r(), _svfprintf_r():
_svfiprintf_r(), _svfprintf_r():
0000c330: E92D4FF0 push.w {r4, r5, r6, r7, r8, r9, r10, r11, r14}
0000c334: 4698 mov r8, r3
0000c336: 898B ldrh r3, [r1, #0xc]
0000c338: B09D sub r13, #0x74 // this is the instructions that causes faultISR.
I cannot imagine that subtracting a register should cause a faultISR
There is no source code, so one has to understand compiler strategy AND arm assembler to figure this out.
What is happening here???
The sprintf tries to sprintf("%d",a) where ais an integer
Gullik