Вы находитесь на странице: 1из 11

LPCXpresso Flash/Debug Tutorial Hardware required

1) NXP LPC-Link board included with any LPCXPRESSO Board ( or !"Euro#) ro$ E$bedded %rti#t# #ee htt&'((www)e$beddedarti#t#)co$(&roduct#(l&c*&re##o +o #e&arate the LPC-L,N- #ide and the tar.et #ide (re/uired to u#e the debu..er 0+%1(S23) on an other board)4 #ee docu$ent' htt&'((www)e$beddedarti#t#)co$(#ite#(de ault( ile#(doc#(5ow+oCreate%nLPC-L,N-)&d +he #u..e#ted LPCX&re##o board# are LPC116174 LPC1!!8 and LPC189: which ;u#t need the u#e o de#olderin. braid to re$o<e the #older bu$&#4 or other board it i# re/uired to cut #o$e wire#) =or $y E*a$&le , u#e a LPCXPre##o LPC189: board) !) LPC7>** board in thi# tutorial , will u#e the 5ackR= board called 0ellyBean de#i.ned by ?ichael O##$ann (thank# or thi# a$a@in. board A-)) =or thi# tutorial 5ackR= 0ellyBean board i# u#ed and e*a$&le u#ed i# $iniblink ba#ed on 1it5ub htt&#'((.ithub)co$($o##$ann(libo&enc$>(tree($a#ter(e*a$&le#(l&c7>**(hackr -;ellybean($iniblink ?ain 1it5ub i# htt&#'((.ithub)co$($o##$ann(libo&enc$>

Nota' Pin1 i# Red Pin on the 1"-&in $ini 0+%1 cable) Nota , bou.ht the $ini 0+%1 cable at E$bedded %rti#t# here' htt&'((www)e$beddedarti#t#)co$(&roduct#(acc(accBidcB1")&h&

Software required
LPCX&re##o <7)!)> build !:! (#i@e !1>)7 ?B)' Re/uire# an account (Lo.in(Pa##word)) Windows version: htt&'((l&c*&re##o)code-red-tech)co$(LPCX&re##o(#y#te$( ile#(LPCX&re##oB7)!)>B!:!)e*e or t&'((l&c*&re##o)code-red-tech)co$(LPCX&re##oB7)!)>B!:!)e*e Linux version: htt&'((l&c*&re##o)code-red-tech)co$(LPCX&re##o(#y#te$( ile#(,n#tallerBLPCX&re##oB7)!)>B!CCBLinu**D9)tarB).@

Nota' +utorial i# done with 2indow# XP SP> and LPCX&re##o <7)!)> build !:! or window#)

Starting LPCXpresso IDE


Be ore #tartin. LPCX&re##o you #hould re.i#ter it (re.i#tration code #hall be acti<ated online with the card you will recei<e with your LPCXPRESSO Board)4 the re.i#tered <er#ion i# only li$ited to debu. code o $a* 1!D-B)

Create a project
Choo#e ?enu =ile-ENew-EPro;ect

Select C(CFF G LPCX&re##o C &ro;ect and click Next

Select NXP LPC7>"" -E C Pro;ect (Corte* ?7) and click Next

Choo#e &ro;ect Na$e in the e*a$&le hackr B;ellybean and click Next

,n +ar.et Selection choo#e LPC7>>" ( or 0ellyBean) and click Next

=or C?S,S 3SP or Library ;u#t choo#e None or both and click Next

0u#t chan.e C 3ialect to .nu:: or what you &re er and click Finish

% ba#ic &ro;ect i# now created) Hou can i$&ort e*i#tin. #ource &ro;ect u#in. link'

2ith $ou#e ri.ht click on &ro;ect4 choo#e New -E =older

,n =older na$e' Enter the ull &ath in the e*a$&le hackr -;ellybean +hen click on %d<anced and choo#e ILink to alternate location (Linked =older) %nd choo#e the ull &ath in the e*a$&le ='JSKNJlibo&enc$>B+itan?-3Je*a$&le#Jl&c7>**Jhackr ;ellybean +hen click on Finish)

Now you ha<e acce## to you e*ternal #ource ro$ LPCX&re##o ,3E)

Flashing ".bin" or ".elf" in SPIFI flash memory


2ith $ou#e click on &ro;ect hackr -;ellybean &re<iou#ly created and click on the IChi&(Co$&onentI ,con

Con i.ure =la#h with ollowin. &ara$eter#' 1) Choo#e =la#h dri<er ile (u#in. =la#h dri<er Brow#e) in 3e ault ,n#tallation &ath JLPCX&re##oB7)!)>B!:!Jl&c*&re##oJbinJ=la#hJLPC1DC"%B7>C"%BSP,=,)c * !) Select the ile to write in la#h in our e*a$&le ='JSKNJlibo&enc$>B+itan?-3Je*a$&le#Jl&c7>**Jhackr -;ellybeanJ$iniblinkJ$iniblink)bin >) Choo#e ba#e addre##' "*17"""""" Click O- to #tart)

Pro.re## #hall be di#&layed and all di#a&&ear when it i# ini#hed

Nota' =la#hin. with 0+%1 work ine too and i# a bit a#ter than de ault S23 $ode)

Debugger configuration
2ith $ou#e Ri.ht click on &ro;ect (or %lt Enter)4 choo#e Pro&ertie# Choo#e ?C6 #ettin.# and Edit to add =la#h $e$ory at location "*" with #i@e "*1""""" (1?B) Click on %&&ly and O-

+hi# #te& i# $andatory to debu. code e*ecutin. ro$ SP,=, la#h4 el#e debu..er will alway# ail to #et break&oint to debu. code) 2ith ollowin. error'

Now con i.ure the debu..er 2ith $ou#e Ri.ht click on &ro;ect4 choo#e 3ebu. %# -E 3ebu. con i.uration#)))

3ouble click on C(CFF ?C6 %&&lication to auto$atically create hackBr ;ellybean 3ebu. Entry

Now chan.e de C(CFF %&&lication to $iniblink)el u#in. ull &ath

,n the e*a$&le ='JSKNJlibo&enc$>B+itan?-3Je*a$&le#Jl&c7>**Jhackr -;ellybeanJ$iniblink)el 3i#able the auto build too)

Con i.ure the debu..er' 1) Hou can chan.e ISto& on #tartu& at'I by re#etBhandler or u#in. an addre## like "*""""1!>7 i you want to #to& e*ecution be ore the de ault $ain code (it not alway# #to& to debu. it ro$ #tart you need to la#h it and then debu.)) !) Chan.e debu..er o&tion# to u#e NXP LPC7>** (S23) becau#e 0+%1 ne<er work or $e) Now click on %&&ly and 3ebu.)

The debugger is launched and code is running

Just click on Pause "||" to stop it

Now !ou can do step b! step or check asse"bl! code or core register #in debug view or b! adding the window$ %ou can also view Peripherals with details #b! de&ault in debug view$ Warning 'iew on ()*+ ((*, or ((*- peripheral trig an error or even crash #&or ((*,.-$ crt/e"u/lpc,0/12/nxp exe

3&ter the crash o& crt/e"u/lpc,0/12/nxp exe !ou need to kill the debug session+ power o&& the LP(12xx board+ power on LP(12xx board and restart debug session+ else all is crashed

Вам также может понравиться