Inconsistencies in NXP LPC documents

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Inconsistencies in NXP LPC documents

574件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Thu Feb 24 05:57:03 MST 2011
I got some new LPC-related documents from NXP website and while reading them I found the following:

AN11008 - no code samples are published, but the text says that IAP calls are used to write 16-byte records to Flash. The description of IAP routines found in User Manuals for LPC1xxx series states that the minimum allowed size for Flash Write is 256 bytes.

UM10441 - there must be something terribly wrong with division routines contained in Flash, as the example 23.4.3 says that dividing -99 by 6 yields the result value 24. :eek:
0 件の賞賛
返信
3 返答(返信)

557件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Feb 25 03:09:29 MST 2011

Quote: gbm

UM10441 - there must be something terribly wrong with division routines contained in Flash, as the example 23.4.3 says that dividing -99 by 6 yields the result value 24. :eek:



I was pretty sure from previous testing work I've done that this must be a documentation error, but have just double checked this to be sure on actual LPC1227 silicon.

The documentation states....
23.4.2 Signed division
The example C-code listing below shows how to perform a signed integer division via the
ROM API.
/* Divide (-99) by (+6) */
int32_t result;
result = pDivROM->sidiv(-99, 6);
/* result now containts (-16) */


23.4.3 Unsigned division with remainder
The example C-code listing below shows how to perform an unsigned integer division with
remainder via the ROM API.
/* Modulus Divide (+99) by (+4) */
uidiv_return result;
result = pDivROM-> uidivmod (-99, 6);
/* result.quot containts (+24) */
/* result.rem containts (+3) */
And running my test code I see the results...

-99 sdiv 6 = -16, rem -3
99 udiv 4 = 24, rem 3
The issue here thus appears to be that there is a cut'n'paste error in the docs, such that the parameter values passed in the second example (-99,6) have not been updated to match the values listed in the comment at the start of the example (99,4).

Regards,
CodeRedSupport
0 件の賞賛
返信

557件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Feb 24 08:44:45 MST 2011
With reference to the LPC12's rom divide routines, you might be interested to know that there is support for making use of these in the project wizard in version 3.6.2 of the IDE (3.8.2 on Linux). More information at:

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

Regards,
CodeRedSupport
0 件の賞賛
返信

557件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Thu Feb 24 07:31:17 MST 2011
hello gbm,

thanks for the remarks ... we will look at it.
0 件の賞賛
返信