This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for packages\hal\arm\arch\current\src\vectors.S


According to LPC2XXX datasheet, checksum of all 8 vectors value must be zero, which means Reserved Vector value must be the inversed value of sum of other 7 vectors value, so we must compute it before compile and place the hardnumber in it.

Actually, when download hex file to LPC2XXX board through ISP, if the Reserved Vector is not valid, the ISP program changes this vector to a checksum number automatically, and cause error when verify the flash.

So I modified the vectors.s to resolve it.

***current code***
.global __exception_handlers
__exception_handlers:
#ifdef CYGSEM_HAL_ROM_RESET_USES_JUMP
// Assumption: ROM code has these vectors at the hardware reset address.
// A simple jump removes any address-space dependencies [i.e. safer]
b reset_vector // 0x00
#else ldr pc,.reset_vector // 0x00
#endif ldr pc,.undefined_instruction // 0x04
ldr pc,.software_interrupt // 0x08 start && software int
ldr pc,.abort_prefetch // 0x0C
ldr pc,.abort_data // 0x10
.word 0 // unused
ldr pc,.IRQ // 0x18
ldr pc,.FIQ // 0x1C


***modified code***
.global __exception_handlers
__exception_handlers:
#ifdef CYGSEM_HAL_ROM_RESET_USES_JUMP
// Assumption: ROM code has these vectors at the hardware reset address.
// A simple jump removes any address-space dependencies [i.e. safer]
b reset_vector // 0x00
#else ldr pc,.reset_vector // 0x00
#endif ldr pc,.undefined_instruction // 0x04
ldr pc,.software_interrupt // 0x08 start && software int
ldr pc,.abort_prefetch // 0x0C
ldr pc,.abort_data // 0x10
#ifdef CYGPKG_HAL_ARM_LPC2XXX
#ifdef CYGSEM_HAL_ROM_RESET_USES_JUMP
.word 0xB4405F62 // checksum of other vectors
#else .word 0xB8A06F58 // checksum of other vectors
#endif #else
.word 0 // unused
#endif
ldr pc,.IRQ // 0x18
ldr pc,.FIQ // 0x1C


Should it be patched ?



--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]