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.

PMU bug in HalCoGen 04.04.00

Other Parts Discussed in Thread: HALCOGEN

Function _pmuSetCountEvent_  does not work correct any more under HalCogen 04.04.00.   In the autogenerated code in file sys_mpu.asm there is a missing first line "lsr r0,r0,#1", which was present in earlier versions of HalCoGen. When adding the missing line the function works as expected. What was the reason to remove it?

  • Frank,

    I will check with the Halcogen team and will be back to you.
    Thanks for the catch.
  • Hi Frank,

    I will investigate this and check with PMU developer. 

    Meanwhile, i came through an other post on similar topic, please have a look 

    https://e2e.ti.com/support/microcontrollers/hercules/f/312/p/413878/1469487

  • Hi Frank,

    I think the parameter you matters.. Some API needs Counter MASK, some need the actual counter number... See for example below.

    _pmuStopCounters_(pmuCOUNTER0)

    _pmuGetEventCount_(0). --> you cannot pass pmuCOUNTER0 to this API

    Please refer the API documentation or the respective Header file in case the function is implemented in assemble. which is case for PMU

    /** @fn void _pmuStopCounters_(uint32 counters)
    * @brief Stops selected counters
    * @param[in] counters - Counter mask
    */
    void _pmuStopCounters_(uint32 counters);

    /** @fn uint32 _pmuGetEventCount_(uint32 counter)
    * @brief Returns current event counter value
    * @param[in] counter - Counter select 0..2
    *
    * @return event counter count.
    */
    uint32 _pmuGetEventCount_(uint32 counter);