LPCOpen bug report

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPCOpen bug report

Jump to solution
868 Views
MindBender
Contributor II

There's a bug in LPCOpen, switching all peripherals on when trying to switch off one:

lpc_chip_40xx/src/clock_17xx_40xx.c, line 111:

/* Disables power and clocking for a peripheral */
void Chip_Clock_DisablePeriphClock(CHIP_SYSCTL_CLOCK_T clk) {
    uint32_t bs = (uint32_t) clk;

#if defined(CHIP_LPC40XX)
    if (bs >= 32) {
        LPC_SYSCTL->PCONP1 &= ~(1 << (bs - 32));
    }
    else {
        LPC_SYSCTL->PCONP |= ~(1 << bs);
    }
#else
    LPC_SYSCTL->PCONP |= ~(1 << bs);
#endif
}

Index: lpc_chip_40xx/src/clock_17xx_40xx.c
===================================================================
--- lpc_chip_40xx/src/clock_17xx_40xx.c    (revision 440)
+++ lpc_chip_40xx/src/clock_17xx_40xx.c    (working copy)
@@ -117,7 +117,7 @@
         LPC_SYSCTL->PCONP1 &= ~(1 << (bs - 32));
     }
     else {
-        LPC_SYSCTL->PCONP |= ~(1 << bs);
+        LPC_SYSCTL->PCONP &= ~(1 << bs);
     }
 #else
     LPC_SYSCTL->PCONP |= ~(1 << bs);

0 Kudos
1 Solution
665 Views
MindBender
Contributor II

The patch above was incomplete and inadvertently posted by my wonky browser. The version attached to this post is complete. It patches two instances in two files in LPCOpen v2.10.

View solution in original post

0 Kudos
2 Replies
666 Views
MindBender
Contributor II

The patch above was incomplete and inadvertently posted by my wonky browser. The version attached to this post is complete. It patches two instances in two files in LPCOpen v2.10.

0 Kudos
665 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Robert Delien,

Thanks for your sharing, and I will transfer the report to the AE for checking.

Thanks again.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos