LPC Xpresso settings

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

LPC Xpresso settings

2,776 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elm on Fri Dec 03 03:42:35 MST 2010
Hi,
I have 2 questions to some settings in the LPCxpresso IDE.

1. Is there a checkbox or something in the IDE were I can choose if the PLL init is done by code or set in the startup file? Or is it taken from the code if done in code and startup file?

2. I am gernerating a hex file by using the instructions from this page. http://support.code-red-tech.com/CodeRedWiki/OutputFormats?highlight=%28hex%29

So now the problem is. I have only the basic version of LPCxpresso. If I have a code more than 130 kB and use the optimization it works with the *.axf file. But if I convert it an try to flash it via the LPCxpresso environment it says the file is too big for this version of LPCxpresso. So I estimate while converting to hex the optimization isn't taken to the new file.

Has someone had this problem as well? Or am I wrong in how I do it?

Thanks
Florian
0 Kudos
Reply
15 Replies

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elm on Wed Dec 08 00:47:03 MST 2010
I will look for these two last threads.
Thanks for the repeat.

Florian
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Dec 07 09:56:56 MST 2010
One other thing to be aware of. During flash program, the LPCXpresso flash programmer calculates and embeds an appropriate CRC check word at the correct offset for your application code. This check word is read by the ISP during boot, and compares it against an internal calcuation done by ISP for the same purpose. This determines whether the ISP will attempt to boot the user application in flash. It could be there is an issue here, and if so, you'll need to take care of this detail in your link. An explanation of the CRC operation is provided in the user's manual for this device.
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Dec 07 06:48:04 MST 2010
Looks like you missed my post, so I repeat it:

A couple of things that might be causing this with Flash Magic:

1. Have you got the flash checksum correctly set?
2. Are you using FlashMagic to set the CRP (Code Read Protect)? If you have not allocated this in your application, FlashMagic will set the CRP and overwrite your code.
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elm on Tue Dec 07 05:18:14 MST 2010

Quote: Zero
So (original) Keil & FlasMagic is working, and ported LPCXpresso & FlashMagic isn't?
Perhaps you should reduce your software to a minimum, zip it and let the support see if there's something wrong with your project settings?



Yes Keil & Flashmagic is working and Xpresso & Flashmagic not. But the very strange thing is. If I flash the raw *.axf file created with Xpresso like described in one of my earlier posts today in step 4. everything works fine. The application code is running. So I thought that the error is in the conversion. But I don't know anymore.

I think I am not allowed to post this code. And to minimize it would be quite workload as the code is a lot. Enough that I need optimization if I want to debug.

Thanks
Florian
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Dec 07 05:16:55 MST 2010
A couple of things that might be causing this with Flash Magic:

1. Have you got the flash checksum correctly set?
2. Are you using FlashMagic to set the CRP (Code Read Protect)? If you have not allocated this in your application, FlashMagic will set the CRP and overwrite your code.
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Dec 07 04:48:12 MST 2010
So (original) Keil & FlasMagic is working, and ported LPCXpresso & FlashMagic isn't?
Perhaps you should reduce your software to a minimum, zip it and let the support see if there's something wrong with your project settings?
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elm on Tue Dec 07 04:28:27 MST 2010
I tested about semihosting. I think this is not the problem as I am in the Release and can disconnect the debugger while the code is running.

@zero: About that simplier problem. I would like to do that. But I am testing with an prototype board. Not the normally connected CPU. I am working with an LPC2362. Maybe there is also a possibility with such a project. I could measure with a scope on the output pin to see if it is working.

To test if the *.hex file is correct. Is there a possibility to flash the file with the LCPxpresso IDE to be sure this conversion works properly?

Your right the problem could be on the flashmagic side. But I don't think so. The software I am implemeting was written in Keil(by someone else). I also have a *.hex file created with Keil. And if I play this to the flash with flashmagic with the same options everything works fine.

Thanks
Florian
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Dec 07 04:09:34 MST 2010
In addition to Zero's suggestion of trying a simple application, you might want to do some digging on the flashmagic website

http://www.flashmagictool.com/

For example, the following post on their forums suggests some issues programming ARM7 based parts (which I believe you may be using?) with certain versions of flashmagic ...

http://forum.flashmagictool.com/index.php?topic=3617.msg4713#msg4713

I'm afraid that we at CodeRed can't offer much help with the use of flashmagic, as we don't tend to use this tool very often. Other forum members may be able to offer more suggestions on its use though.

Regards,
CodeRedSupprot
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Dec 07 03:59:11 MST 2010
Did you try to flash a simple example (like blinky...) with FlashMagic?
Never had a problem with converting to hex and flashing with FlashMagic, so I would test it with one of the simple examples.
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elm on Tue Dec 07 03:29:18 MST 2010
Ok.
At first the debugging problem is solved. That works fine now.

Now from the begining about the problem with the hex format. In steps.
Maybe your right. I will read more about semihosting.

1. Run the Code in Debug mode in the LPCXpresso IDE successfully (application code does what it should)

2. Switch the built option to Release via right click on the project name in the project explorer->Build configurations->Set active-> Release

3. Built all (Release)

4. use the *.axf file from the Release folder. With right click ->Binary Utilities->Program Flash
(The application code on the device works fine)

5. use the cmd window you reach by Strg left click on the project name in the bottom left of the IDE window. Type in the following to convert the *axf file to hex [B]arm-none-eabi-objcopy -O ihex Release\file.axf test.hex[/B]

6. using flashprogrammer to flash the Microcontroller. With the convertet file.
[SIZE=4][B](The application code on the device doesn't work!!!)[/B][/SIZE]

Ok maybe I am doing something wrong. I am didn't work so much with this IDE yet and didn't do so much at all with microcontrollers. So don't hit me for an fundamental error if I did one.

I will read also more about semihosting in you library now and hope to find something there.

Thanks for your help so far
Florian
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Dec 07 00:27:28 MST 2010
Sorry, I am not sure that I fully understand what your debug/flash magic problems are. You will need to explain in more detail.

If you are saying that your code runs OK when downloaded and run through the IDE, but does not run when downloaded via flash magic, then the most likely explanation is that your code makes use of some semihosting functionality - which requires the debug connection in under to operate. For more details on semihosting, please see our C Library FAQs at:

http://support.code-red-tech.com/CodeRedWiki/CodeRedFAQ#CLibrary

With regards to your breakpoint problem, please can you explain in more detail, preferably with an example that shows up the problem.

Regards,
CodeRedSupport.
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elm on Mon Dec 06 08:22:48 MST 2010
Ok I didn't know so far that it is possible to built bigger files in size. And then flash them with flashmagic. Thanks for that information. Maybe I will need it in the future.

I did test again if I did the conversion correctly. But I think I did so far. As I delete all old files this time to make sure I do. The line I used to convert is:[B]arm-none-eabi-objcopy -O ihex Release\file.axf test.hex[/B]
( I reached the cmd by pressing Strg and clicking the projekt name in the bottom of the LPCXpresso window)
Aftwerwards I am flashing the file with flashmagic.

If I am using the same optimization options and run the debug mode it works. That is somehow strange I think.

With it doesn't work with flashmagic I meant, that the aplication software is not working. The flashing itself works fine.

Although I got another strange problem. I added some new code. And if I activate just this code with an software switch then I can set but not reach any breakpoints in the code.

Thanks
Florian
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Dec 03 08:19:54 MST 2010
There is no restriction on the size of the image that you create with LPCXpresso. The 128k limitation is only when using LPCXpresso to debug or download to flash, the image. Thus, you can create ANY size image and use Flash Magic (or any other flash programmer) to download the image.

The axf to hex conversion program does not know, or care, anything about the size of application. It will convert any size of application. Are you sure that you are converting the same image that you are running? Note that the built-in flash programmer can program .axf images and binary images.

When you say that using Flash Magic "it doesn't work", what do you mean? Does flash magic refuse to program, or does the application not
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elm on Fri Dec 03 05:32:54 MST 2010
If I create an apllication >128k and use the optimization to get smaller code. Then test it in debug mode. And then built a release *axf file. Last step is to convert it to *.hex to flash the MCU with flashmagic or an similar tool.
So if I play the *.axf with the LPCxpresso IDE to the flash it works. But if I play the *.hex with flashmagic it doesn't work. To check whats the reason I chose the *.hex with the LPCxpresso IDE to play into the flash. But it told me the file is too big for this version of the IDE. So I estimate the IDE can't play a .hex to the flash or converting the file didn't take the Optimization of the code.

Thanks
Florian
0 Kudos
Reply

2,669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Dec 03 04:02:24 MST 2010
1. No. You have to provide the PLL code yourself - I suggest you use the CMSIS library code to do this.
2. I'm not clear what you mean. If I create an application that is >128k, then I cannot debug it, or program it into flash. Can you explain exactly what you mean?
0 Kudos
Reply