Access Error

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

Access Error

1,489 Views
luethich
Contributor I
Hi there,
 
i have a serious problem with access errors on 52233 devices. I have written an ethernet bootloader which works great. Also, i am able to program an application (which starts at 0x6000 in FLASH) which i can download and start with thee bootloader. The problem is, as soon as the application executes a function with an address > 0x8000, it enters the acces error interrupt (instruction fetch error).
 
I have no idea why this happens.
Any ideas?
 
Cheers
Christian
Labels (1)
0 Kudos
2 Replies

441 Views
luethich
Contributor I
Hi Simon,
 
thanks a lot, this was the solution of the problem! After appending these lines in my vectors.s everithing works fine.
 
Great, thanks! 
0 Kudos

441 Views
SimonMarsden_de
Contributor II
Sounds like a problem that hit me a while ago.

One possible solution is that you're not correctly setting up the Flash protection fields. These are located starting at offset 0x400 in the on-chip Flash, and get loaded into the CFM registers at boot. There are bits to control access to various banks of Flash, so you might have accessess enabled for 0x6000 but disabled for 0x8000, leading to the effect you describe.

You need to make sure that you define the Flash configuration field, which is typically located directly after the end of the Exception Vector Table. Here's a version I use, which I add in my 'vectors.s' file at the appropriate location.


; Offset 0x00000400: CFM Flash Configuration Field
;
; For ColdFire processors with on-chip Flash, addresses 0x400 - 0x417
; are reserved array space used to determine the Flash module protection
; and access restrictions out of reset

KEY_UPPER:  .long 0x00000000
KEY_LOWER:  .long 0x00000000
CFMPROT:    .long 0x00000000
CFMSACC:    .long 0x00000000
CFMDACC:    .long 0x00000000
CFMSEC:     .long 0x00000000




Hope that helps.


Simon
0 Kudos