first of all I apologize for apologize for all misspelling I'll do in this post, I am not a native english speaker.
So, for my bachelor thesis I should port FreeRTOS to the XS2 architecture. This kind of went very smooth, because there already exists a
port here: http://www.xcore.com/viewtopic.php?t=5246, source code can be found here: https://github.com/BiancoZandbergen/XMOS_FreeRTOS
So, now I am facing a problem when using "printf" after starting the scheduler. I know, RTOS and printf is not how it is intended to be used,
but it is quite ok/comfortable for debugging I guess. So, to provide some more techical details I tried to debug it with XGDB and ended up here:
tile[0]@0- -SI Ai.----00042c20 (vfprintf + 68) : bl 0xdd8 @27027
tile[0]@0- -SI Ai.----000447d4 (__swsetup + 0) : entsp 0x8 S[0x48c44] @27032
tile[0]@0-*-SI Ai.----000447d8 (__swsetup + 4) : std r5(0x48db4), r4(0x47460), sp[0x1] S[0x48c2c] @27037
tile[0]@0 *000447d8 : TRAP ET: 5, SPC: 000447d8, SSR: 2, ED: 00048c2c (LOAD_STORE)
What maps to (ABI Definition of STD):
► Show Spoiler
================================= MORE INFORMATION =================================
I tested something a minute ago, I compiled the code with -O3 (and -O1, -O2, -Os) and then the program failed at the vTaskDelay (FreeRTOS) function,
also right after extending the stack and calling the instruction "STW". I guess there is something messed up with my stack, but
has anyone an idea what to do or what it could be?
Note that in the given port of FreeRTOS the function "pxPortInitialiseStack" (called when a task is created, initializes the stack for that task with values that
will be restored when the scheduler of FreeRTOS is (context) switching to that function. The stack (to be more pecise, the registers r0 - r11) gets initialized
with the values 1 to 11.
I don't know if this is the problem or not, I changed the values the registers are initialized with but nothing changed.
To be honest, I have no idea what to do next...
Have a nice evening,
T.
PS: if this is the wrong subforum to post in - feel free to move it somewhere else.