This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ERROR 3735928559 [Unknown error code] at C:\0svn\coyote\trunk\FW\components\libraries\pwr_mgmt\nrf_pwr_mgmt.c:125

Hello: 

nrf_pwr_mngt_run() doesn't always work on my custom board.  About 1 time in 3, in code (I'm running in debug mode and using RTT) spits out

ERROR 3735928559 [Unknown error code] at C:\0svn\coyote\trunk\FW\components\libraries\pwr_mgmt\nrf_pwr_mgmt.c:125

in response to:

nrf_pwr_mgmt_run();

The line referenced (125) is:an ASSERT

__STATIC_INLINE void pwr_mgmt_fpu_sleep_prepare(void)
{
uint32_t original_fpscr;

CRITICAL_REGION_ENTER();
original_fpscr = __get_FPSCR();
/*
* Clear FPU exceptions.
* Without this step, the FPU interrupt is marked as pending,
* preventing system from sleeping. Exceptions cleared:
* - IOC - Invalid Operation cumulative exception bit.
* - DZC - Division by Zero cumulative exception bit.
* - OFC - Overflow cumulative exception bit.
* - UFC - Underflow cumulative exception bit.
* - IXC - Inexact cumulative exception bit.
* - IDC - Input Denormal cumulative exception bit.
*/
__set_FPSCR(original_fpscr & ~0x9Fu);
__DMB();
NVIC_ClearPendingIRQ(FPU_IRQn);
CRITICAL_REGION_EXIT();

/*
* The last chance to indicate an error in FPU to the user
* as the FPSCR is now cleared
*
* This assert is related to previous FPU operations
* and not power management.
*
* Critical FPU exceptions signaled:
* - IOC - Invalid Operation cumulative exception bit.
* - DZC - Division by Zero cumulative exception bit.
* - OFC - Overflow cumulative exception bit.
*/
ASSERT((original_fpscr & 0x7) == 0);
}

Does anyone have an idea what is happening here?  

Parents Reply Children
  • Hi Matthew, from the assertion in the code I can see that it checks for any of the following FP exceptions (because they most likely are the result of a problem in your code that should be fixed):

    • Invalid operation
    • Division by zero
    • Overflow

    I would recommend that you revisit all the portions of your code that uses floating-point arithmetic and check for stuff like 0 operands before performing a division, and then clearing the exception bit whenever it happens.
    If the result of such computations is used in the rest of the code, that might lead to other problems down the road (which is why I think this ASSERT was there in the first place.

    Here's a snippet from the Arm v7m architecture reference manual explaining in more detail:

    Good luck debugging!

Related