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.

AWRL6432: Hard fault with power test example

Part Number: AWRL6432

Tool/software:

Hi,

My customer tried to modify the power test to use Power_idleFunc to enter deep sleep mode like motion demo, but fail to continuously wake up from deep sleep mode.

#define SLEEP_TIME_TICKS (1000)

I tried similar modification and found the device has waken up from deep sleep mode, but then enters hard fault after 2nd time wake up. Pls find snapshot below.

Pls find my modification code at https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/1023/power_5F00_modes_5F00_xwrL64xx_2D00_evm_5F00_m4fss0_2D00_0_5F00_freertos_5F00_ti_2D00_arm_2D00_clang.7z.

Would you pls help to check what is missed?

I tried to add a while loop before Power_disablePolicy() (just wake up from deep sleep mode) and connect CCS to change the value of loop from 1 to 0, then the code can enter deep sleep mode for multi times.

I also tried to only fix the sel=1 (add line 121) and comment 119 line in the default power test code (no other changes), but also saw hard fault. 

Is there any timing relationship between Power_enablePolicy()/xSemaphoreTake(gPowerSem, SLEEP_TIME_TICKS)/Power_idleFunc?

Why calling xSemaphoreTake(gPowerSem, SLEEP_TIME_TICKS) can enter deepsleep mode? How it call vPortSuppressTicksAndSleep?

Why in motion and presence detection demo it sets a long delay in xSemaphoreTake(gPowerSem, portMAX_DELAY) and use Power_idleFunc to enter deep sleep mode but not use xSemaphoreTake(gPowerSem, SLEEP_TIME_TICKS) directly?

Thanks,

Chris

  • Hi,

    The problem is solved by changing UART from interrupt mode to polling mode. I checked motion and presence detection demo and found it also uses uart pollint mode. Would you pls kindly advise why UART interrupt mode will cause Hard fault?

    Would you pls still help me on below questions?

    Why calling xSemaphoreTake(gPowerSem, SLEEP_TIME_TICKS) can enter deepsleep mode? How it call vPortSuppressTicksAndSleep?

    Why in motion and presence detection demo it sets a long delay in xSemaphoreTake(gPowerSem, portMAX_DELAY) and use Power_idleFunc to enter deep sleep mode but not use xSemaphoreTake(gPowerSem, SLEEP_TIME_TICKS) directly? Reuse gPowerSem to unblock the power task process?

    Thanks,

    Chris

  • Hey Chris,

    Thanks for reaching out regarding this issue. I will need some more time to look over what may be causing this issue, but I have one suggestion and a couple of quick notes.

    For my suggestion, have they tried flashing and running this modified example in release mode?

    Is there any timing relationship between Power_enablePolicy()/xSemaphoreTake(gPowerSem, SLEEP_TIME_TICKS)/Power_idleFunc?

    Power_enablePolicy should be called before either xSemaphoreTake or Power_idleFunc since these will only call the power policy function if the policy has been enabled beforehand. Otherwise, there is no other known timing constraint.

    Why calling xSemaphoreTake(gPowerSem, SLEEP_TIME_TICKS) can enter deepsleep mode? How it call vPortSuppressTicksAndSleep?

    By calling xSemaphoreTake, this puts the power task effectively into standby until the gPowerSem semaphore is given back or until blocking time, SLEEP_TIME_TICKS, expires. With no other tasks to process, the task scheduler defaults to waiting for the semaphore blocking time to elapse during which the scheduler suspends itself and calls vPortSuppressTicksAndSleep.

    Why in motion and presence detection demo it sets a long delay in xSemaphoreTake(gPowerSem, portMAX_DELAY) and use Power_idleFunc to enter deep sleep mode but not use xSemaphoreTake(gPowerSem, SLEEP_TIME_TICKS) directly?

    As stated above, the power example can use xSemaphoreTake to enter an idle state since there are no other tasks to process. In the case of MPD, there are multiple other tasks that are being switched between that prevent suspension, and the gPowerSem semaphore is actually used for properly timing the pass off between the UART task and power task.

    Regards,

    Kristien