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.

AM6548: ICSSG PRU Task Manager

Part Number: AM6548

Hello,

we are trying to preemptively interrupt one PRU from another ICSSG module by using the new task manager.

We set up an interrupt (e.g. host 2 or host 12), which can be received as event 128 or 136 on the task manager.

This received interrupt is shown in the GLOBAL_STATUS register of the task manager in the receiving PRU module just fine.

The GLOBAL_CFG register has the subtasks enabled and the mode set to 2 (general purpose).

But the PC (program counter) of the PRU does not change. The Global_STATUS shows that Task 1 or Task 2 was activated, but the program counter does not reflect this.

I tried all 4 task managers on the ICSSG module (PRU0/RTU0/PRU1/RTU1 to be sure that the addresses were not wrong in the manual), none had any other effect.

Neither XIN 252 or XCHG 253 (should actually be done by hardware) has any effect either.

The TS_ENABLE (Task Swapping) bit in the control register of the PRU is 0. As it is read only, task swapping cannot be activated with this register.

I found no working example code for the task manager. Can you help?

Best regards,

Sebastian

  • Sebastian,

    I'm checking on documentation/example for this and will come back to you shortly.

    Best regards,

    Dave

  • Hi Dave,

    have you found any information on using the PRU task manager?

    Best regards,

    Sebastian

  • Sebastien,

    Yes, I was able to get some guidance for you. Are you enabling task switching in the PRU core? It is the TSEN 1  instruction  (TSEN 0 to disable).  You can use these macros below:

    ;enable

    m_pru_tm_enable .macro

       .word 0x32800000

       ;tsen 1

       .endm

    ; disable

    m_pru_tm_disable .macro

        .word 0x32000000

        ;tsen 0

       .endm

  • Sebastian,

    Let me know if you were able to get additional information for this query.

    Best regards,

    Dave

  • Thank you, Dave!

    With these macros the task manager is working now!

    Some more tips for other forum users using the task manager

    • the task routine addresses have to be divided by 4, before putting it into the task manager registers
    • the second slice (PRU1) shows the task manager of the first slice (PRU0) in the register view in Code Composer Studio (bug in CCS); as the same interrupts are used by both, be careful, which task manager you are using
    • when chaining the interrupt controllers between ICSSGs, events are easier to handle, if the receiving ICSSG has the interrupts set as pulse type
    • The task manager handles the local interrupts as pulse interrupts, so clear any pending interrupts at the beginning, when activating the task manager (or disable and enable them, if the task manager should react to them)
    • The task manager needs a xin 252 command for yielding execution. As the tasks can run at any time, the xin 252 command should not use up a register, which could otherwise be used by the program; xin with length 0 compiles, but actually is length 128 with strange side effects. A better work-around seems to be reading into "&r31.b3, 1", which does not create an event as bit 5 is not set; the alternative is to reserve a register just for yielding the tasks (it seems to be always filled with 0 by the xin)

    Best regards,

    Sebastian