Code Warrior 8.8 Auto Generated Code Error

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

Code Warrior 8.8 Auto Generated Code Error

2,497 Views
RyanOh
Contributor I

##############################################
# Local Bus Interface (LBIU) Configuration
##############################################

## CS0 - 8MB FLASH
#writemem.l 0xe0005000 0xff001001 # BR0 base address at 0xFF000000, port size 16 bit, GPCM, valid
#writemem.l 0xe0005004 0xff000ff7 # OR0 16MB flash size (two 8M), 15 w.s., timing relaxed

# CS0 - 8MB FLASH
writemem.l 0xe0005000 0xff001001 # BR0 base address at 0xFE000000, port size 16 bit, GPCM, valid
writemem.l 0xe0005004 0xff000ff7 # OR0 16MB flash size (two 8M), 15 w.s., timing relaxed

## CS1 - board VSC7385
#writemem.l 0xe0005008 0xf8000801 # BR1 base address at 0xFE400000, port size 8 bit, GPCM, valid
#writemem.l 0xe000500c 0xfffe09ff # OR1 128KB size, 15 w.s., timing relaxed, external TA

# CS2 - 64MB SDRAM
##writemem.l 0xe0005014 0xfc006901 # OR2 32KB size, 13 rows, 9 cols, 64MB
##writemem.l 0xe0005010 0xf0001861 # BR2 base address at 0xF0000000, port size 32 bit, SDRAM, valid

# CS2 - LED & Board ID
writemem.l 0xe0005014 0xffe0ef97 # OR2 128KB size
writemem.l 0xe0005010 0xf8000801 # BR2 base address at 0xF8000000, port size 8 bit, GPCM, valid

 

---------------------------------------------------------------------------------------------------------------------------

The source code above is auto generated code from Code Warrior 8.8 When I make a new PPC project with MPC8349E + MITX(rev1) board. You can easily find comments and code mismatches. (See red color) specially in the case of the base register. In the data sheet, 17 bits represent the base address, but the code and the comment are some correct and some are wrong. What should I trust?

 

0 Kudos
Reply
6 Replies

2,486 Views
yipingwang
NXP TechSupport
NXP TechSupport

The initialization file provided in CodeWarrior is only used for MPC8349MDS demo board, you need to modify BRx and ORx registers according to your target board.

Please refer to section "10.3.1.1 Base Registers (BR0–BR7)" and "10.3.1.2 Option Registers (OR0–OR7)" in https://www.nxp.com.cn/docs/en/reference-manual/MPC8349EARM.pdf to configure BRx and ORx registers according to your target board.

0 Kudos
Reply

2,481 Views
RyanOh
Contributor I

Thank you for your kind answer.

I'm using MPC8349E-MiTX (rev.1) E/V board from NXP now. (You can choose this board when creating a project in Code Warrior v8.8) I was expecting that BRx and ORx should be modified to suit my target board, but what I don't understand is the mismatch between the (Red text) source code and the comments. Obviously, there is a mismatch between the two, and I don't know which of them is correct. Should I trust the source code or the comments? It makes me confused

0 Kudos
Reply

2,477 Views
yipingwang
NXP TechSupport
NXP TechSupport

According to the LAW definition, the source code is correct.

# Local Bus Local Access Windows
#################################
## WINDOW 0 - FLASH
#writemem.l 0xe0000020 0xff000000 # LBLAWBAR1 - begining at 0xFF000000
#writemem.l 0xe0000024 0x80000017 # LBLAWAR1 - enable, size = 16MB

# WINDOW 1 - FLASH
writemem.l 0xe0000028 0xff000000 # LBLAWBAR1 - begining at 0xFE000000
writemem.l 0xe000002c 0x80000017 # LBLAWAR1 - enable, size = 16MB


# WINDOW 2 - board BCSRs
##writemem.l 0xe0000030 0xf8000000 # LBLAWBAR2 - begining at 0xf8000000
##writemem.l 0xe0000034 0x8000000e # LBLAWAR2 - enable, size = 32KB

# WINDOW 3 - local bus SDRAM
##writemem.l 0xe0000038 0xf0000000 # LBLAWBAR3 - begining at 0xf0000000
##writemem.l 0xe000003c 0x80000019 # LBLAWAR3 - enable, size = 64MB

# PCI Local Access Windows
#################################

0 Kudos
Reply

2,472 Views
RyanOh
Contributor I

I still don't get it. For example,

################################################################

writemem.l 0xe0000028 0xff000000    # LBLAWBAR1 - begining at 0xFE000000

################################################################

In this one line, the value of 0xE000_0028 is 0xFF00_0000.

The comment should be "LBLAWBAR1 - beginning at 0xFF000000"

but the it says "LBLAWBAR1 - beginning at 0xFE000000"

Is this right? What did I miss....?

 

Tags (1)
0 Kudos
Reply

2,470 Views
yipingwang
NXP TechSupport
NXP TechSupport

Yes, you are correct.

0 Kudos
Reply

2,457 Views
RyanOh
Contributor I

If my opinion is correct, then it makes sense. Problem solved. I will trust the source code, not the comment. Thank you for good advice.

0 Kudos
Reply