Xilinx SDK 2016.1 freeRTOS823_xlinx OS platform
My code seemed to work fine until I introduced some freeRTOS elements. The general functionality of my code as follows:
In the Interrupt subroutine, I assign a value to a variable focusPosition that is read from the IP register of the Zynq Soc:
// separate file u32 focusPosition=0; static void ISR(void *CallbackRef) { focusPosition = XRb_focus_Get_position_o(CallbackRef); }
Then I printf the value to the console in the main function:
// separate file extern u32 focusPosition; main{ ... while(1){ sleep(1); xil_printf("%d\n",focusPosition); } }
The code prints the correct value, however, when I try to implement some additional lines in the code, like xTaskCreate() xEventGroupCreate(), something messes up all the memory and the printed value stays constant, which is not correct.
How can simple addition of the code that has nothing to do with the variable have any influence on that variable? As far as I understand, the xTaskCreate() and xEventGroupCreate() are created on the heap. I tired pocking around to see if Xil_DCacheDisable() would help, but no. Any ideas? Is my focusPosition variable properly defined/declared?