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);
Solved! Go to Solution.
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.
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!
-----------------------------------------------------------------------------------------------------------------------