LPC4337 Boot

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

LPC4337 Boot

1,559 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hetech on Mon Dec 09 17:59:20 MST 2013
I am trying to create a project for the M4 core in a LPC4337, for internal flash.

I create a project using the wizard, in LPCxpresso 6.1.2

Using CMSISv2p10_LPC43xx etc

All I want to do is make ANY io line go low.  Nothing happens.
LPC_GPIO_PORT->DIR[0] = 0xFFFFFFFF;// Output
LPC_GPIO_PORT->CLR[0] = 0xFFFFFFFF;// LOW

I also tried simply turning on the external crystal oscillator - Nothing happens.
LPC_CGU->XTAL_OSC_CTRL = 0b00000001;// EXT 12MHz Xtal

The code does not appear to excecute.
I download the .hex with Flash Magic 7.37.3076, into Bank 0, and with Activate Flash Bank ticked.

The .hex must be valid, as the MCU will not reprogram unless ISP pin is low during reset.

-Sam
Labels (1)
0 Kudos
Reply
8 Replies

1,250 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hetech on Wed Dec 11 21:57:16 MST 2013
Solved.

Changed post build steps to this:-

arm-none-eabi-size "${BuildArtifactFileName}"; arm-none-eabi-objcopy -O ihex "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.hex" ; arm-none-eabi-objcopy -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" ; checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin"

Previous was... (Which worked fine for LPC17xx)

arm-none-eabi-size "${BuildArtifactFileName}"; arm-none-eabi-objcopy -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" ; checksum -v "${BuildArtifactFileBaseName}.bin"; arm-none-eabi-objcopy -I binary "${BuildArtifactFileBaseName}.bin" -O ihex "${BuildArtifactFileBaseName}.hex";

I believe the main difference is the way the checksum is created.
0 Kudos
Reply

1,250 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hetech on Tue Dec 10 23:08:36 MST 2013
I wired in JTAG.

If I program the MCU using JTAG, then toggle RESET, my software runs!!

If I program the MCU using Flash Magic (using .hex file), then toggle RESET, my software DOES NOT RUN.

Flash magic appears to program the MCU successfully.

0 Kudos
Reply

1,250 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hetech on Tue Dec 10 20:15:33 MST 2013
Files attached

Also I measued the JTAG lines (even tho they are not used)

TDO lo
TMS hi
TRST hi
TCK lo


I also built a 2nd board.  Does nothing.

I tried GNDing DBGEN.  Does nothing. (normally it reads HIGH)


0 Kudos
Reply

1,250 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hetech on Tue Dec 10 20:08:54 MST 2013
Device is not going into ISP mode by accident, because once it is programmed, it cannot be programmed again without me holding ISP line low during reset.  Reset will not allow re-programming without me holding that line low.  There is a pullup resistor on that line (2k2)

ISP pin just goes to external pushbutton to GND.
0 Kudos
Reply

1,250 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Tue Dec 10 19:45:10 MST 2013
Hi hetech,
In your schematic ISP Pin(P2.7) is connected somewhere. Can you also check voltage on this. Device may be going into  ISP mode
0 Kudos
Reply

1,250 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hetech on Tue Dec 10 15:13:50 MST 2013
Also when I open the example ZIP files that you suggested (on the LPCOpen site), at least half of the directories are corrupted and cannot be used.
0 Kudos
Reply

1,250 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hetech on Tue Dec 10 15:02:45 MST 2013
I tried the following example projects:-
LPC4337-Xplorer_Blinky_DualM0
LPC4337-Xplorer_LedToggle

CPU appears to do nothing.

The boot mode is all Boot select pins low.  According to the data sheet, the boot select pins only affect the booting when ISP pin is low, and the device boots from internal flash when ISP pin high.

The MCU programs and reads fine (When reset while ISP pin is low). 

I do not have JTAG on this board.

http://www.razorbackecu.com/temp/Schematic%20Prints1.pdf
http://www.razorbackecu.com/temp/nxp1.jpg
http://www.razorbackecu.com/temp/nxp2.jpg

Thankyou
Sam


0 Kudos
Reply

1,250 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Tue Dec 10 01:17:00 MST 2013
Hello Sam,

I would suggest you test one of the existing examples in our LPCOpen package:

http://www.lpcware.com/content/nxpfile/lpcopen-platform

Looking at one of these running projects you might get an impression what's going wrong in your project.

There are many possible reasons why the chip is not doing anything useful:
- wrong bootmode setting on the board
- wrong/missing initialization code
- no flash signature for the internal flash
- board not powered  (no, this was a joke ;-) )

Regards,
NXP Support Team
0 Kudos
Reply