LPC11U ROM divide example

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

LPC11U ROM divide example

2,296 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed May 08 02:09:19 MST 2013
I've uploaded a simple example showing how the ROM divide functionality built into the LPC11Uxx family can be used from within LPCXpresso IDE...

http://support.code-red-tech.com/CodeRedWiki/RomDivideLPC11U

More background information on ROM division, and also how to access it if using an LPC12xx part can be then found in this FAQ:

http://support.code-red-tech.com/CodeRedWiki/RomDivide

Regards,
CodeRedSupport
0 Kudos
Reply
10 Replies

2,266 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon May 13 00:44:15 MST 2013

Quote: cwpjr
Also if I have a image pre-loaded and boot into ISP and goto the image would the serial port still work as per the ISP init?



Sorry - what has this to do with the thread subject of "LPC11U ROM divide example"? Suggest you create a new thread.

Regards,
CodeRedSupport
0 Kudos
Reply

2,266 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cwpjr on Sun May 12 18:25:55 MST 2013
Also if I have a image pre-loaded and boot into ISP and goto the image would the serial port still work as per the ISP init?
0 Kudos
Reply

2,266 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Thu May 09 14:18:24 MST 2013

Quote: CodeRedSupport
I've just uploaded the zip again, and then tried downloading from the webpage - all seems OK now. Please can you try again?

Regards,
CodeRedSupport



Yes, it works now, thank you.
0 Kudos
Reply

2,266 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu May 09 09:59:44 MST 2013

Quote: neilt6
Thank you. I tried the new example, however it still hard faults when I try to debug it on an LPC11U35. Upon further investigation, it doesn't appear the files in the example have been changed from the versions I tried yesterday. Is it possible the zip file hasn't been updated yet?


I've just uploaded the zip again, and then tried downloading from the webpage - all seems OK now. Please can you try again?

Regards,
CodeRedSupport
0 Kudos
Reply

2,266 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Thu May 09 09:24:41 MST 2013

Quote: CodeRedSupport
New version of example now available from:

http://support.code-red-tech.com/CodeRedWiki/RomDivideLPC11U

Changes:
[INDENT]- Startup file updated to cope with rom driver table being in different locations in different silicon variants.
- Main function updated to cause calls to both signed and unsigned division routines. [/INDENT]

Regards,
CodeRedSupport



Thank you. I tried the new example, however it still hard faults when I try to debug it on an LPC11U35. Upon further investigation, it doesn't appear the files in the example have been changed from the versions I tried yesterday. Is it possible the zip file hasn't been updated yet? In the meantime I've been able to get ROM division to work by changing the DIVROM_BASE definition to 0x1FFF1EC8, but this will break if the silicon changes again...

EDIT: I just tried downloading it for the third time and got the updated version. The code now works perfectly! Thank you very much for the example!
0 Kudos
Reply

2,266 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu May 09 02:08:09 MST 2013
New version of example now available from:

http://support.code-red-tech.com/CodeRedWiki/RomDivideLPC11U

Changes:
[INDENT]- Startup file updated to cope with rom driver table being in different locations in different silicon variants.
- Main function updated to cause calls to both signed and unsigned division routines. [/INDENT]

Regards,
CodeRedSupport
0 Kudos
Reply

2,266 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu May 09 01:00:50 MST 2013
In the short term, modify the startup file supplied in the example by changing the line:

#define DIVROM_BASE 0x1FFF1F64


to

#define DIVROM_BASE 0x1fff1ec8


I'll get a modified version of the project uploaded shortly that will handle this automatically and post again when this is available for download.

Regards,
CodeRedSupport
0 Kudos
Reply

2,266 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Wed May 08 14:31:34 MST 2013

Quote: CodeRedSupport
It looks like may be different silicon revisions with the rom divide routines at different addresses -we are investigating.

In the meantime, it would be useful if you could you drop down to the gdb console within a debug session to your LPC11U silicon - as detailed here...

http://support.code-red-tech.com/CodeRedWiki/AccessingGDBwithinGUI

Then enter the command

x/x 0x1FFF1FF8


This will display something of the form

[FONT=Courier New][SIZE=2]0x1FFFF1FF8 : <val>[/SIZE][/FONT]

Can you then enter the command

x/6x <val>


where you replace <val> with the value displayed by the first command.

Please post the output from both commands.

Regards,
CodeRedSupport



Here is the output of the commands:

x/x 0x1FFF1FF8
0x1fff1ff8:0x1fff1eb8


x/6x 0x1fff1eb8
0x1fff1eb8:0x1fff1f200xffffffff0xffffffff0x1fff1e98
0x1fff1ec8:0x1fff1ea80xffffffff
0 Kudos
Reply

2,266 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed May 08 12:56:46 MST 2013
It looks like may be different silicon revisions with the rom divide routines at different addresses -we are investigating.

In the meantime, it would be useful if you could you drop down to the gdb console within a debug session to your LPC11U silicon - as detailed here...

http://support.code-red-tech.com/CodeRedWiki/AccessingGDBwithinGUI

Then enter the command

x/x 0x1FFF1FF8


This will display something of the form

[FONT=Courier New][SIZE=2]0x1FFFF1FF8 : <val>[/SIZE][/FONT]

Can you then enter the command

x/6x <val>


where you replace <val> with the value displayed by the first command.

Please post the output from both commands.

Regards,
CodeRedSupport
0 Kudos
Reply

2,266 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Wed May 08 12:44:41 MST 2013

Quote: CodeRedSupport
I've uploaded a simple example showing how the ROM divide functionality built into the LPC11Uxx family can be used from within LPCXpresso IDE...

http://support.code-red-tech.com/CodeRedWiki/RomDivideLPC11U

More background information on ROM division, and also how to access it if using an LPC12xx part can be then found in this FAQ:

http://support.code-red-tech.com/CodeRedWiki/RomDivide

Regards,
CodeRedSupport



Thank you very much for the example! Unfortunately though, I'm not able to get it to run on either an LPC11U14 Xpresso board, or an Embedded Artists LPC11U35 QuickStart Board. The code immediately Hard Faults when I step over the division line: res = x / y.
0 Kudos
Reply