Content originally posted in LPCWare by okwh on Sat Apr 30 06:52:44 MST 2016
Maybe I encounted a special error ! Please Help!
I have two boards with same design, one soldering with a LPC54102 chip, their CPUcode ID0 are same 0x88854102, CPUCODE ID1 are 0x881FECE and 0x8C1FECE.
for same project with uvision 5.15 MDK IDE with newest LPCOpen : lpc5410x_lpcxpresso_54102_keil_iar_3.01.000_9
for CPU 0x881FECE all OK, but 0x8C1FECE can not run, dead before main(). (run from SystemInit at keil_startup_lpc5410x.s, and then to set clock to Chip_SetupIrcClocking(uint32_t iFreq) )
When I debug one line by one line, I find a stange things
Debug dead at the 106 code line of Chip_SetupIrcClocking(...) of sysinin_5410x.c file.
-------------------------------
/* Set main clock source to the system PLL. This will drive 24MHz
for the main clock and 24MHz for the system clock */
Chip_Clock_SetMainClockSource(SYSCON_MAINCLKSRC_PLLOUT);
-------------------------------------------------------
the function : Chip_Clock_SetMainClockSource located at 285 line of clock_5410x.c
as I debug it :
for the board with CPU 0x881FECE :
106: Chip_Clock_SetMainClockSource(SYSCON_MAINCLKSRC_PLLOUT);
107:
108: /* ASYSNC SYSCON needs to be on or all serial peripheral won't work.
109: Be careful if PLL is used or not, ASYNC_SYSCON source needs to be
110: selected carefully. */
0x00000D76 4606 MOV r6,r0
0x00000D78 0240 LSLS r0,r0,#9
0x00000D7A F04F4480 MOV r4,#0x40000000
0x00000D7E D519 BPL 0x00000DB4
0x00000D80 480E LDR r0,[pc,#56] ; @0x00000DBC
the above code run and OK, the CPU on this board is ID1 = 0x881FECE
but for the board with CPU ID1 = 0x8C1FECE :
288: LPC_SYSCON->AHBCLKDIV = div;
0x00000D72 F8C40100 STR r0,[r4,#0x100]
106: Chip_Clock_SetMainClockSource(SYSCON_MAINCLKSRC_PLLOUT);
107:
108: /* ASYSNC SYSCON needs to be on or all serial peripheral won't work.
109: Be careful if PLL is used or not, ASYNC_SYSCON source needs to be
110: selected carefully. */
0x00000D76 2006 MOVS r0,#0x06
0x00000D78 F7FFFE50 BL.W Chip_Clock_SetMainClockSource (0x00000A1C)
111: Chip_SYSCON_Enable_ASYNC_Syscon(true);
0x00000D7C 2001 MOVS r0,#0x01
0x00000D7E F7FFFF5A BL.W Chip_SYSCON_Enable_ASYNC_Syscon (0x00000C36)
This is same project.
You can see the code address is 0x00000D76, but compiled to different instructions (compare Disassembly ASM code !)
What is wrong ??
thw next compiled to BL.W like right, but run dead ! I feel the reason is PLL not work !
only use Irc as scource clock, no ext clock.
and another, WS 1, 'pllerror appear at command window after download program .
Please help me, What's wrong? that LPC54102 chip bad ????