AnsweredAssumed Answered

LPC1112 - hardfault on PDRUNCFG register write

Question asked by Daniel Kowalski on Feb 3, 2017
Latest reply on Feb 9, 2017 by Daniel Kowalski

Hello,

 

I encountered strange problem with LPC1112 MCU when creating new design.

 

MCU mysteriously hard-faulted before reaching main, so I started debugging startup code (this works perfectly fine) and found problematic line in CMSIS source (system_LPC11xx.c):

 

LPC_SYSCON->PDRUNCFG &= ~(1 << 5); /* Power-up System Osc */

 

After reading through manual I found that some reserved bits need to be set to 1 in PDRUNCFG during write,

I tried setting register value to reset value (with required reserved bits), before even calling SystemInit.

Result is still the same - I get HardFault even with simple write to register:

 

LPC_SYSCON->PDRUNCFG = 0b1110110111110000;

 

The only thing happening before that is filling bss with zeros and copying data section to RAM.

 

what might be wrong with this? (I cannot configure system clock)

MCU is LPC1112FHI33/202.5

 

Daniel

Outcomes