This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS570LC4357: use gioSetBit from freeRTOS task fails setting rtpPORT

Part Number: TMS570LC4357

Tool/software: Code Composer Studio

Hello together,

I want to use RTP_DATA[13] as digital out. For that I configured it with following code:

// Set high
rtpREG->PC3 = rtpREG->PC3 | (1 << 13);
// Set output direction
rtpREG->PC1 = rtpREG->PC1 | (1 << 13);
// Disable open drain
rtpREG->PC6 = rtpREG->PC6 & ~(1 << 13);
// set gio , functional diabled
rtpREG->PC0 = rtpREG->PC0 & ~(1 << 13);

// Set low
gioSetBit(rtpPORT, 13, 0);

Setting the IO high or low works fine from main function, but called from a freertos task it ends in

With other Ports like hetPORT1 / 2 there is also no problem when called out of a task.

  • Hi Martin,

    Please create the task in Supervisor mode. This is required to write to the rtpPORT.

    To create a task in Supervisor mode, uxPriority is set to equal the priority at which the task is to be created and to have its most significant bit set. The macro portPRIVILEGE_BIT is provided for this purpose.

    For example, to create a User mode task at priority three, set uxPriority to equal 2.

    To create a Supervisor mode task at priority three, set uxPriority to equal ( 2 | portPRIVILEGE_BIT ). 

    xTaskCreate(vTask1,"Task1",configMINIMAL_STACK_SIZE, NULL, 2 | portPRIVILEGE_BIT, NULL);

    Regards,

    Akshay