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.

TMS570LS3137 / HALCoGen 4.00 PMU Initialization

Other Parts Discussed in Thread: HALCOGEN

Hello,

The function _pmuInit_ in the file sys_pmu.asm contains the following:

        ; clear flags
        mov   r0,  #0
        sub   r1,  r1,  #1
        mcr   p15, #0, r0, c9, c12, #3 

Why is r1 decremented?  It is not used in the function, nor is it saved/restored. Can I remove the line containing the sub?

Thanks, Charlie Johnston

  • Charles,

    This is a good catch. In fact the code is incorrect and should be:

            ; clear flags
            mov   r0,  #0
            sub   r0,  r0,  #1
            mcr   p15, #0, r0, c9, c12, #3 
    

    Here is an extract from the Cortex R4 TRM:

    The flags are cleared by writing 1.

    I will inform our Halcogen team to fix this problem.