lpcware

Can't set ISR vector table to 0x00000000

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by cance on Mon Feb 24 04:33:38 MST 2014
Hi,

I have a problem with my program. I'm using a LPC1754. I have a software that was coded with an older version of CooCox by a former employee and I needed to add a feature and the feature works fine. Only when I exit the menu and the data should be saved to the flash I get an error (exception thrown). But everything I compile with CooCox makes problems. We have an old hex-File for our software that works fine but if I generate a new hex-file from the old project I get a different hex-file. The difference is that the old hex-file has its isr vector table at 0x00000000 and the code starts at 0x00002000 but the new hex-file has its vector table at 0x00002000 that is where the code should start and not the vector table. When I change the starting address of th code in the project settings the isr vector starts at the new address. It is always the address where the code should start. I think because of this I have the problem with the exception. Here you have the two hex files or at least the part that is interesting.

Woring hex (old one)
:100000007C3B001011B1000079B1000079B1000013
:1000100079B1000079B1000079B100000000000062
:1000200000000000000000000000000079B10000A6
:1000300079B100000000000091E2000059F90000D1
:1000400079B1000079B1000079B1000079B1000008
:1000500079B1000079B1000079B1000079B10000F8
:1000600079B1000079B1000079B1000079B10000E8
:1000700079B1000079B1000079B1000079B10000D8
:1000800079B1000079B1000079B1000079B10000C8
:1000900079B1000079B1000079B1000079B10000B8
:1000A00079B1000079B1000079B1000079B10000A8
:1000B00079B1000079B1000079B1000079B1000098
:0C00C00079B1000079B1000079B10000B6
:1020000080B584B000AF02460B46FA71BB71FB7914
:10201000002B06D04FF000004FF0400107F060FFAA
:1020200005E04FF000004FF0400107F06FFFBB7973
:102030004FF00200194607F053FFBB796FEA030324


Not working hex
:10200000EC3C0010F9BC000069BD000069BD000097
:1020100069BD000069BD000069BD0000000000004E
:1020200000000000000000000000000069BD00008A
:1020300069BD00000000000091FF000001120100D6
:1020400069BD000069BD000069BD000069BD0000F8
:1020500069BD000069BD000069BD000069BD0000E8
:1020600069BD000069BD000069BD000069BD0000D8
:1020700069BD000069BD000069BD000069BD0000C8
:1020800069BD000069BD000069BD000069BD0000B8
:1020900069BD000069BD000069BD000069BD0000A8
:1020A00069BD000069BD000069BD000069BD000098
:1020B00069BD000069BD000069BD000069BD000088
:1020C00069BD000069BD000069BD000080B584B035
:1020D00000AF02460B46FA71BB71FB79002B06D0AC
:1020E0004FF000004FF0400108F06CFC05E04FF0AD
:1020F00000004FF0400108F07BFCBB794FF002007C


So now I cant do any changes to our program because I always get this error. I looked into the system_LPC17xx.c where I found this

//  Set Vector table offset value
#if (__RAM_MODE__==1)
  SCB->VTOR  = 0x10000000 & 0x3FFFFF80;
#else
  SCB->VTOR  = 0x00000000 & 0x3FFFFF80;
#endif


When I look at this the isr vector table should always start at 0x00000000 (it's on flash not on the RAM)

Another difference is the map-file in the old file I have this

Name             Origin             Length             Attributes
rom              0x00002000         0x0001e000         xr
ram              0x10000000         0x00004000         xrw
ram1             0x2007c000         0x00004000         xrw
isr              0x00000000         0xffffffff
*default*        0x00000000         0xffffffff


and in the new one I have this

Name             Origin             Length             Attributes
rom              0x00002000         0x0001e000         xr
ram              0x10000000         0x00004000         xrw
ram1             0x2007c000         0x00004000         xrw
*default*        0x00000000         0xffffffff


So there is no isr in the new one but I don't know why. The former employee told me that he didn't do anything special to make it work but he can't tell what the problem is.

I can't figure out where the problem is, Can anyone help me with this problem because don't know what to do.


Best regards Cance

Outcomes