|
|
View previous topic :: View next topic |
Author |
Message |
benedictkim
Joined: 14 Nov 2019 Posts: 11
|
[dsPIC30F6014]Bootloader + No interrupt in Application FW |
Posted: Mon Nov 18, 2019 4:29 am |
|
|
Dear all, I created a boot loader and application FW.
All application FWs have been downloaded in the bootloader state.
After rebooting, it will be changed to application FW. The basic behavior in the code flow is good. However, interrupts are not processed.
Where is the problem?
1 case-CCS bootloader + CCS application OK
2 cases-CCS bootloader + my application OK
3 cases-my bootloader + CCS applicatoin NG
4 cases-my bootloader + my application NG
Based on the results, we thoroughly reviewed the boot loader.
If the code flow changes from the boot loader to the application FW, aren't interrupt permissions managed by the application FW rather than the boot loader? The entire written hex code for case 1 and case 3 was read and compared using PicKit 3 and MPLAB IDE. The application FW memory space was matched.
Is it a problem with the boot loader that the interrupt does not occur in the application program?
1 cases's hex code
:020000040000FA
:100000006004040000000000FFFFFF00081400006F
:100010000C14000010140000141400001814000048
:100020001C140000201400002414000028140000F8
:100030002C140000301400003414000038140000A8
:100040003C14000040140000441400004814000058
:100050004C14000050140000541400005814000008
:100060005C140000601400006414000068140000B8
:100070006C14000070140000741400007814000068
:100080007C14000080140000841400008814000018
:100090008C140000901400009414000098140000C8
:1000A0009C140000A0140000A4140000A814000078
:1000B000AC140000B0140000B4140000B814000028
:1000C000BC140000C0140000C4140000C8140000D8
:1000D000CC140000D0140000D4140000D814000088
:1000E000DC140000E0140000E4140000E814000038
:1000F000EC140000F0140000F4140000F8140000E8
:10010000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FB
:10011000FFFFFF00FFFFFF00FFFFFF00FFFFFF00EB
:10012000FFFFFF00FFFFFF00FFFFFF00FFFFFF00DB
:10013000FFFFFF00FFFFFF00FFFFFF00FFFFFF00CB
:10014000FFFFFF00FFFFFF00FFFFFF00FFFFFF00BB
:10015000FFFFFF00FFFFFF00FFFFFF00FFFFFF00AB
:10016000FFFFFF00FFFFFF00FFFFFF00FFFFFF009B
:10017000FFFFFF00FFFFFF00FFFFFF00FFFFFF008B
:10018000FFFFFF00FFFFFF00FFFFFF00FFFFFF007B
:10019000FFFFFF00FFFFFF00FFFFFF00FFFFFF006B
:1001A000FFFFFF00FFFFFF00FFFFFF00FFFFFF005B
:1001B000FFFFFF00FFFFFF00FFFFFF00FFFFFF004B
:1001C000FFFFFF00FFFFFF00FFFFFF00FFFFFF003B
:1001D000FFFFFF00FFFFFF00FFFFFF00FFFFFF002B
:1001E000FFFFFF00FFFFFF00FFFFFF00FFFFFF001B
:1001F000FFFFFF00FFFFFF00FFFFFF00FFFFFF000B
:100200003220EF00C3102000008041001040BA00EF
:100210000160EF00000006000D0A000052650000BA
:100220007365000074740000696E0000672E0000A2
:100230002E2E00002E2E0000000000003220EF00C5
:10024000A3122000008041001040BA000160EF00BE
:10025000000006000D0A0000646F0000776E0000C9
:100260006C6F0000616400002E2E00002E00000064
:100270003220EF0043142000008041001040BA00FB
:100280000160EF00000006000D0A0000537400003A
:1002900061720000742000004170000070000000D6
:1002A0004200F8003600F8003200F800801F7800A5
:1002B000200020000C000900B01F7800A0012000E1
:1002C0000C0009004F1078004F0078003200F90050
:1002D0003600F9004200F90000400600851F780052
:1002E0009468EF009568EF00A44480004822DE0087
:1002F0006224E100220031009288BF001404200033
:100300001024E1000E003C0094C8BF000160EF0023
:10031000C402DD009288BF0000027800144078001B
:100320000000FB00850240001504B100EA82420093
:100330000500780094E8B700B60104000000000052
:1003400094C8BF000160EF00C402DD009288BF00C6
:1003500000027800144078000000FB008502400095
:10036000040320000480520094E8B70095C8BF0041
:100370009568EC009228EC00740104000000000075
:1003800094C8BF0000E0B700CF027800000006006C
:100390004200F800801F780081E0A900140280006C
:1003A000040EB3001402880081E0A800013B88001D
:1003B00054052000343B8800A40A2000343B880008
:1003C00061E7A80000000000000000004F00780076
:1003D00081E0A9004200F90081E0A80000000600C9
:1003E000851F7800C500200003000900B51F7800B4
:1003F0000300A1000310A1000300E000340032005C
:100400000000A1000200A100910188008000780096
:10041000F4FF2F00F003200001006000080032000C
:10042000811F7800C608DE00C608DD008408BB0016
:100430008498BB0062005000FCFF3A00CF007800B7
:10044000F00320000100600006003A008008BB00B5
:10045000811F780011042400C80102000000000080
:10046000CF007800B208BB00B298BB000100E000EA
:100470004220AF003220EC00F0032000008060003A
:1004800005003A00811F780011002400C801020015
:1004900000000000CF007800E4815100E8FF3A003E
:1004A000F00320000080600009003200F4FF2F00FC
:1004B0008408BB008498BB00F0032000008060002B
:1004C000FBFF3A0011002400C801020000000000F8
:1004D0002501200003000900CF127800CF02780028
:1004E00000000600851F7800861F78000228A900FA
:1004F0000828EF001028EF000228AF00D3003700D3
:100500003228EF0044832000934180008482410020
:100510001802AE00FEFF3700E0108000804A78002D
:100520003288BF003228EC0080027800448320002B
:1005300004804200104278006D24E1000500320082
:1005400094418000030420000418E10001003900F8
:10055000ECFF370030C1B3001922AF00FEFF3700B7
:100560001AE2B7001B62EF000208A800A441800055
:10057000A4C3B200A9003A00548320009444880028
:100580006E0102000000000010E8B7001168EF00E3
:1005900074832000944488006E0102000000000073
:1005A0008042780094832000944488006E01020009
:1005B00000000000004378000608F800E6FF9F00F6
:1005C0000608F9000540780007E8B700B48320006A
:1005D000944488006E0102000000000004E8B700A7
:1005E00046408000354080005540880066408800C5
:1005F0000C28D5000AA8D7000368EF0010C0B3008C
:100600000EE8B700944180006300520074408000FF
:100610000960EF000020E10010003100744080000C
:100620000960EF0043832000830242009544880064
:100630006E01020000000000804278000540780052
:100640000368B400744080006242420004407800B5
:100650000EE8B70002030400000000001440800010
:100660004822DE00F30F200084825100E1C24200E4
:100670000540780003E8B70094418000E30252008F
:100680004483200004834200964488006E010200E7
:10069000000000000348E300030032000208A90044
:1006A000F203040000000000244080006124E10007
:1006B00003003A000228A800F20304000000000032
:1006C000244080006424E10011003A00D48320001B
:1006D000944488006E01020000000000804278000F
:1006E000F4832000944488006E01020000000000A2
:1006F000004378000808F800E6FF9F000808F900AA
:100700000540780009E8B700F2030400000000008B
:100710000448E20033003A00644080006020E100B9
:100720003000390004003E0054408000F33F2100B7
:100730000418E1002B003100644080006120E100DA
:1007400028003E00040039005440800003002800C7
:100750000418E1002300360090C0B3000EE8B70093
:100760000568EF00944180006300520074408000EF
:100770000960EF000020E1001400310005C8BF004F
:100780000568EC000080FB000160EF002481200080
:1007900084024000744080000960EF004383200021
:1007A00003034200964488006E010200000000002E
:1007B000804A780074408000624242000440780021
:1007C0000EE8B700B2030400000000000A88BF0072
:1007D000614080002281200083408000F0010200FF
:1007E000000000000208AE000500370060C0B30042
:1007F0001922AF00FEFF37001AE2B7001B62EF00BC
:1008000010C1B3001922AF00FEFF37001AE2B70093
:100810001B62EF00220404000000000060C0B3006F
:100820001922AF00FEFF37001AE2B7001B62EF008B
:1008300010C1B3001922AF00FEFF37001AE2B70063
:100840001B62EF007C0204000000000060C0B300E7
:100850001922AF00FEFF37001AE2B7001B62EF005B
:1008600010C1B3001922AF00FEFF37001AE2B70033
:100870001B62EF0001002000010078000160EF0022
:1008800000010200000000008100E8001922AF0012
:10089000FEFF37001AA2B700F00020000008E600B3
:1008A000F5FF37000000FE004F037800CF0278000C
:1008B00000000600720202000000000000000600B6
:1008C0000F782200F07F220020A0B7000000000077
:1008D00081E0A80004402800B410880004402000F3
:1008E000C410880034002000F4108800A8A2EF0093
:1008F000E5E2A800E7E2AE000E00370001002000AC
:10090000010078000160EF001E01020000000000FD
:100910008100E8001922AF00FEFF37001AA2B700DD
:10092000C00020000008E600F5FF37005A0402006E
:100930000000000001002000010078000160EF00CD
:1009400038010200000000008100E8001922AF0019
:10095000FEFF37001AA2B700A00020000008E60042
:10096000F5FF370000140200000000000040FE0008
:10097000FFFFFF00FFFFFF00FFFFFF00FFFFFF0083
:10098000FFFFFF00FFFFFF00FFFFFF00FFFFFF0073
:10099000FFFFFF00FFFFFF00FFFFFF00FFFFFF0063
:1009A000FFFFFF00FFFFFF00FFFFFF00FFFFFF0053
:1009B000FFFFFF00FFFFFF00FFFFFF00FFFFFF0043
3 cases's hex code
:020000040000FA
:10000000F00A040000000000FFFFFF0008140000D9
:100010000C14000010140000141400001814000048
:100020001C140000201400002414000028140000F8
:100030002C140000301400003414000038140000A8
:100040006A0400004014000044140000481400003A
:100050004C14000050140000541400005814000008
:100060005C140000601400006414000068140000B8
:100070006C14000070140000741400007814000068
:100080007C14000080140000B2030000660300002E
:100090008C140000901400009414000098140000C8
:1000A0009C140000A0140000A4140000A814000078
:1000B000AC140000B0140000B4140000B814000028
:1000C000BC140000C0140000C4140000C8140000D8
:1000D000CC140000D0140000D4140000D814000088
:1000E000DC140000E0140000E4140000E814000038
:1000F000EC140000F0140000F4140000F8140000E8
:10010000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FB
:10011000FFFFFF00FFFFFF00FFFFFF00FFFFFF00EB
:10012000FFFFFF00FFFFFF00FFFFFF00FFFFFF00DB
:10013000FFFFFF00FFFFFF00FFFFFF00FFFFFF00CB
:10014000FFFFFF00FFFFFF00FFFFFF00FFFFFF00BB
:10015000FFFFFF00FFFFFF00FFFFFF00FFFFFF00AB
:10016000FFFFFF00FFFFFF00FFFFFF00FFFFFF009B
:10017000FFFFFF00FFFFFF00FFFFFF00FFFFFF008B
:10018000FFFFFF00FFFFFF00FFFFFF00FFFFFF007B
:10019000FFFFFF00FFFFFF00FFFFFF00FFFFFF006B
:1001A000FFFFFF00FFFFFF00FFFFFF00FFFFFF005B
:1001B000FFFFFF00FFFFFF00FFFFFF00FFFFFF004B
:1001C000FFFFFF00FFFFFF00FFFFFF00FFFFFF003B
:1001D000FFFFFF00FFFFFF00FFFFFF00FFFFFF002B
:1001E000FFFFFF00FFFFFF00FFFFFF00FFFFFF001B
:1001F000FFFFFF00FFFFFF00FFFFFF00FFFFFF000B
:100200003220EF00C3102000008041001040BA00EF
:100210000160EF0000000600010000003220EF0046
:1002200083112000008041001000BA000000060089
:100230000000000021100000422000006330000098
:1002400084400000A5500000C6600000E770000078
:1002500008810000299100004AA100006BB1000054
:100260008CC10000ADD10000CEE10000EFF1000034
:100270003220EF0043142000008041001040BA00FB
:100280000160EF000000060052530000323300000E
:1002900032200000546900006D6500006F75000099
:1002A000740D00000A0000003220EF000316200049
:1002B000008041001040BA000160EF00000006001D
:1002C000537400006172000074200000426F00004F
:1002D0006F7400006C6F00006164000065720000C4
:1002E0000D0A0000000000003220EF00031820007B
:1002F000008041001040BA000160EF0000000600DD
:10030000505200004F470000524100004D5F000076
:100310004D4500004D4F0000525900003A3000009A
:1003200078250000780D00000A0000003220EF0060
:10033000231A2000008041001040BA000160EF0045
:1003400000000600464C000041530000485F0000DA
:100350004552000041530000455F00005349000032
:100360005A4500003A30000078250000780D000062
:100370000A0000003220EF00631C200000804100D2
:100380001040BA000160EF0000000600464C00007B
:1003900041530000485F00005752000049540000DC
:1003A000455F0000534900005A4500003A30000004
:1003B00078250000780D00000A0000003220EF00D0
:1003C000A31E2000008041001040BA000160EF0031
:1003D0000000060052450000414400005F5000004C
:1003E000524F000047520000414D00003A300000DB
:1003F00078250000780D00000A0000003220EF0090
:10040000A3202000008041001040BA000160EF00EE
:10041000000006004C4F000041440000455200001F
:100420005F4500004E4400003A300000782500008F
:10043000780D00000A0000003220EF008322200027
:10044000008041001040BA000160EF00000006008B
:100450004C4F000041440000455200005F53000033
:10046000495A0000453A0000307800002578000025
:100470000D0A0000000000003220EF00832420005D
:10048000008041001040BA000160EF00000006004B
:100490004C4F000041440000455200005F41000005
:1004A00044440000523A00003078000025780000F3
:1004B0000D0A0000000000003220EF00832620001B
:1004C000008041001040BA000160EF00000006000B
:1004D00041500000505F0000464C000041530000B6
:1004E000485F000042410000534500005F410000AA
:1004F0004444000052450000535300003A300000CD
:1005000078250000780D00000A0000003220EF007E
:1005100023292000008041001040BA000160EF0054
:100520000000060041500000505F0000464C0000F3
:1005300041530000485F0000454E0000445F00004A
:10054000414400004452000045530000533A00006B
:1005500030780000257800000D0A0000000000003F
:100560003220EF00C32B2000008041001040BA0071
:100570000160EF0000000600464C000041530000FF
:10058000485F000050410000474500005F530000F5
:10059000495A0000453A00003078000025780000F4
:1005A0000D0A0000000000003220EF00032E2000A2
:1005B000008041001040BA000160EF00000006001A
:1005C000424F00004F5400004C4F000041440000D7
:1005D000455200005F410000545F0000535400008A
:1005E000415200005420000064650000666900006C
:1005F0006E650000640D00000A0000003220EF006C
:10060000A3302000008041001040BA000160EF00DC
:1006100000000600446F0000776E00006C6F000061
:1006200061640000204A0000756D000070540000F5
:100630006F41000070700000233100000D0A0000BF
:10064000000000003220EF00E33220000080410073
:100650001040BA000160EF000000060045450000B0
:10066000505200004F4D0000203000007833000051
:10067000303A00002030000078250000780D00009E
:100680000A0000003220EF00E33420000080410027
:100690001040BA000160EF0000000600446F000047
:1006A000776E00006C6F000061640000204A00005B
:1006B000756D0000705400006F4100007070000004
:1006C000233200000D0A0000000000008720A9006E
:1006D0004200F8003600F8003200F800801F780071
:1006E000200020000C000900B01F7800E08FBF0040
:1006F000E02FEC0080027800C4BE2000048042009D
:1007000010437800064078001922AF00FEFF370042
:100710001AE2B7001B62EF00EA8BBF00047F800083
:100720000020E10006003900EA2BEF00EA0BF80098
:10073000E00FF9008F20A900A203040000000000D0
:100740008F20A800A00120000C0009004F107800A5
:100750004F0078003200F9003600F9004200F9003D
:10076000004006004200F8003600F8003200F800B1
:10077000801F7800200020000C000900B01F7800C6
:100780001802AE00FEFF3700E010800096F1B700BF
:1007900004408000833E20000418E10001003E0078
:1007A0000028EF0096D1BF000160EF001080B2007A
:1007B000050032005080B200120032004081B200C9
:1007C0002200320030003700D84FAE000A00370058
:1007D0000088BF000028EC00800278002480200000
:1007E000048342009691BF0000439800D84FA900AF
:1007F000FE030400000000000028EF00580404007D
:1008000000000000D84FAE000A0037000088BF008B
:100810000028EC008002780024802000048342003D
:100820009691BF0000439800D84FA900220404000D
:1008300000000000044080006120E100010036005B
:10084000D82FA8005804040000000000D84FAE00C4
:100850000A0037000088BF000028EC008002780002
:1008600024802000048342009691BF00004398003A
:10087000D84FA9004004040000000000D84FA80091
:1008800058040400000000000088BF000028EC00AD
:100890008002780024802000048342009691BF00EB
:1008A00000439800D84FA90058040400000000003D
:1008B0008700A900A00120000C0009004F1078005B
:1008C0004F0078003200F9003600F9004200F900CC
:1008D000004006004200F8003600F8003200F80040
:1008E000801F7800200020000C000900B01F780055
:1008F000D42FEC004220AF00D62FEC0084C0A9001A
:10090000A00120000C0009004F1078004F00780073
:100910003200F9003600F9004200F90000400600FC
:100920004200F8003600F8003200F800801F78001E
:10093000200020000C000900B01F7800A00120005A
:100940000C0009004F1078004F0078003200F900C9
:100950003600F9004200F900004006000000E00007
:100960004220AF0004003700471D090000000000CE
:100970000000E900FCFF3A0000000600851F780037
:10098000861F7800871F78008402780000027800B4
:100990000580FD0017C1B3000B60ED000E60ED0097
:1009A0001900320003007800460020000482D200C3
:1009B0008180D2000281D2008381D2000603E90047
:1009C000FAFF3A004C00DE00F000B20004003A00EA
:1009D000613CE100020032000BE0AE00EEFF3700A8
:1009E0000003B000A60320000600E100010039006A
:1009F0000A40B4000F22AF00FEFF370010A2B7007C
:100A00000BE0A800E4FF3700CF0378004F03780025
:100A1000CF02780000000600800178000180FD0010
:100A200054C0B3000360ED000860ED001300320015
:100A300003007800C419DD004C00DE00F000B200B5
:100A400004003A006124E1000200320003E0AE003D
:100A5000F4FF37000003B000A20320000200E10011
:100A6000010039000240B4000F22AF00FEFF370042
:100A700010A2B70003E0A800EAFF3700000006005C
:100A800001002F0083814000F1072000E080480032
:100A9000910188000500A1000500E000030032007C
:100AA000331ABA008582E900FCFF3A000000060014
:100AB000DC8FBF000008E300060032000008F800E9
:100AC000DC0FF900D42FEF00D62FEF0094050400BF
:100AD00000000000B47E80006020E10012003900B8
:100AE00004003E00A47E8000430620000418E100BC
:100AF0000D00310001002000010078000160EF00CE
:100B000038010200000000008100E8000F22AF0061
:100B1000FEFF370010A2B700E00020000008E6004A
:100B2000F5FF3700D80FA8000000EB00D80FAF008A
:100B30000000E80000000600851F7800861F78008E
:100B40007C31EF00B18B80007491BF007431ED00F7
:100B50004200AE007631ED000000E00002003A00F5
:100B60000100E00043003200E58B8000CC2ADE006B
:100B70007291BF00104378000D60EF004430DE003A
:100B800078B1B7000500780078B1B6007A31EF008F
:100B90007891BF00EF0260000003EB00140020001A
:100BA0000960EF0005007800860078000402E80084
:100BB0000402E900030032000000D0008180D2006E
:100BC000FBFF370000C0BF000E0102000000000064
:100BD000800278007C91BF004400DD007CB1B7004A
:100BE000050078007CB1B600E58B8000CC2ADE00E1
:100BF0007291BF00104378000D60EF00060078008E
:100C000078B1B7000500780078B1B6007A31EF000E
:100C10007891BF00EF0260000003EB001400200099
:100C20000960EF0005007800860078000402E80003
:100C30000402E900030032000000D0008180D200ED
:100C4000FBFF370000C0BF000E01020000000000E3
:100C5000800278007C91BF004400DD007CB1B700C9
:100C6000050078007CB1B6007231EC00A2050400EA
:100C7000000000007C91BF0000A0B7004F03780087
:100C8000CF027800000006004200F800801F7800C4
:100C900081E0A90014028000040EB3001402880051
:100CA00081E0A800013B880054052000343B880007
:100CB000A40A2000343B880061E7A800000000007F
:100CC000000000004F00780081E0A9004200F90018
:100CD00081E0A80000000600851F7800C500200004
:100CE00003000900B51F78000300A1000310A10054
:100CF0000300E000340032000000A1000200A10067
:100D00009101880080007800F4FF2F00F00320009C
:100D10000100600008003200811F7800C608DE0074
:100D2000C608DD008408BB008498BB006200500048
:100D3000FCFF3A00CF007800F003200001006000C3
:100D400006003A008008BB00811F780011042400CF
:100D50004406020000000000CF007800B208BB008B
:100D6000B298BB000100E0004220AF003220EC004E
:100D7000F00320000080600005003A00811F780029
:100D8000110024004406020000000000CF0078009B
:100D9000E4815100E8FF3A00F00320000080600089
:100DA00009003200F4FF2F008408BB008498BB00C8
:100DB000F003200000806000FBFF3A0011002400D7
:100DC0004406020000000000250120000300090085
:100DD000CF127800CF02780000000600851F78004F
:100DE000861F7800871F7800881F78001030EF007A
:100DF0001230EF00448080006520E100AA00390035
:100E00001290BF000610B400848080000042900061
:100E1000848088001170EF00400020001010B400A2
:100E200014B0B700100020001210B4008002780047
:100E3000050078000610B400104378002000200060
:100E40001210B40080037800070078000610B40088
:100E5000104478000E10F800E8FF9F000E10F90013
:100E6000064078000FF0B700300020001210B400E8
:100E700080027800050078000610B400801F78001A
:100E80001040780037F0B7004F007800F67E800001
:100E90007580800055808800668088000C30D50001
:100EA0000AB0D7003670EF003970EF0039D0BF00BC
:100EB0000160EF00A48080000020E1000D003600FA
:100EC000C48180004822DE00040078001210B400C3
:100ED00080027800050078000610B4000002780057
:100EE000144078003670B4003970EC0056070400E6
:100EF00000000000B48180000960EF00F30F2000C3
:100F000084825100E1C242000540780036F0B7000B
:100F10001490BF001210B400800278000500780021
:100F20000610B40000027800144078003650E30048
:100F3000020032005008040000000000B48180006C
:100F40004822DE006124E10003003A005600370029
:100F50003C08040000000000B48180004822DE004C
:100F60006424E10013003A00400020001210B40095
:100F700080027800050078000610B4001043780065
:100F8000500020001210B4008003780007007800A1
:100F90000610B40010447800DE0FF800E8FF9F0050
:100FA000DE0FF90006407800DFEFB7003C080400D0
:100FB000000000003750E2002F003A0064808000FB
:100FC0006020E1002C00390004003E0054808000C5
:100FD000F33F21000418E100270031006480800005
:100FE0006120E10024003E000400390054808000AC
:100FF000030028000418E1001F00360040C0B300C1
:1010000039F0B7003870EF0039D0BF000160EF0051
:10101000A48080000020E1001100360038D0BF001D
:101020003870EC000080FB000160EF0064012100DB
:1010300084024000C48180004822DE000400780061
:101040001210B40000037800060078000610B40007
:10105000904A78003970EC00040804000000000099
:101060000A90BF00618080006201210083808000BF
:101070006C060200000000008480800065024200CF
:1010800004007800448080000000520008B0B700DF
:101090008480800065024200040078001230B400B1
:1010A000FA060400000000004F047800CF03780027
:1010B0004F037800CF027800000006004200F800DD
:1010C000801F780081E0A90014028000040EB300A4
:1010D0001402880081E0A800013B8800540520002C
:1010E000343B8800A40A2000343B880061E7A80054
:1010F000000000000000000061E7AF00FEFF3700C5
:101100004F00780081E0A9004200F90081E0A800CA
:1011100000000600811F780001002F0000804000C1
:101120008000EB00F1072000E0804800910188007A
:10113000CF0078000200A1000200E00011003200A0
:101140001108BB00811F7800410424005E080200E2
:1011500000000000CF0078003108BB000080E800EC
:1011600001003A003220EC00811F78004100240089
:101170005E08020000000000CF0078000281E90054
:10118000EFFF3A0000000600851F7800861F7800F8
:1011900002C8BF00F6EFB70002C8BF00ECEBB70013
:1011A000F6CFBF000160EF001080B20009003200EE
:1011B0003080B200180032001080B20041003200CE
:1011C0007080B2004A0032001080B200610032002C
:1011D000690037002300200002002000D1BE20005B
:1011E000831F780002007800000102000000000068
:1011F000CF017800805878000201E8008301E900FF
:101200004220AE00F6FF370034002000D47E880074
:10121000C00904000000000004402100C47F8800D1
:10122000FA2FEF00F22FEF00F42FEF00A47F8000E1
:101230006020E1001F003E0004003900947F800020
:10124000F35A20000418E1001A0036006400200060
:101250000960EF00F28FBF00A17F80000402E80068
:101260000402E900030032000000D0008180D200B7
:10127000FBFF3700C47F800084024000D47F8000E1
:1012800004834800050078008600780091018800FA
:101290000008BB0011042400440602000000000006
:1012A000F22FEC004220AF00F42FEC0016090400EE
:1012B0000000000014002000D47E8800C009040053
:1012C0000000000004408000E3025200348020004F
:1012D0003480880045808800EE060200000000008F
:1012E00014002000D47E8800C00904000000000023
:1012F00081FE20003280200003000900B2587800EF
:10130000C1FE20007280200003000900B25878005E
:10131000E80FF8007211F900EC0FF8007411F900F1
:10132000EE0FF8007611F9009C05020000000000A5
:10133000F0AFB700D1BE200002FF2000010009007D
:10134000B258780034002000D47E8800C009040020
:10135000000000001504200000032000A100200070
:10136000220020008A08020000000000D80FA80018
:10137000C009040000000000C009040000000000D3
:101380004F037800CF02780000000600851F780028
:10139000861F7800D82FAE0025003700044080005B
:1013A000E20252002480200004804200347F80004A
:1013B00000429000347F880004408000E102520027
:1013C0002480200004804200801F780010407800B4
:1013D000E7EFB7004F00780004408000E2025200BF
:1013E0000600200024802000948B8800A58B8800B4
:1013F000B68B88009C050200000000008002780087
:10140000347F80000520E10005003A0004408000A0
:101410006220E10002003600120A04000000000011
:1014200003003700C408020000000000D82FA90004
:101430004F037800CF02780000000600851F780077
:10144000861F7800D57E800006002000C4BE2000E4
:10145000948B8800A58B8800B68B88009C050200C1
:1014600000000000E6AFB700DA8FBF00DA2FEC0013
:1014700080027800C4BE200004834200E68FBF00D3
:1014800000439800DA8FBF00DA2FEC00800278006A
:10149000C4BE200004834200E7CFBF00004B7800A9
:1014A00081FE2000C2BE2000DA8FBF000000E900EC
:1014B0000200390000800900B2587800EA8BBF00B2
:1014C000EA2BEC0080027800C4BE200004834200B6
:1014D00010C0B300004B7800E830EF00EA30EF00B6
:1014E000548780006020E1002C003E000400390099
:1014F000E890BF00D47E80000020E1002700360085
:1015000084FE200043878000048041001042780060
:101510006424E1000C00320084FE20004387800038
:1015200004804100104278006124E100060032008E
:1015300084FE200043878000048041001042780030
:101540007024E10007003A00EA8BBF00EA2BEC00B0
:1015500080027800C4BE20000483420000C1B300B2
:10156000004B7800EA8BBF00EA2BEC008002780089
:10157000C4BE20000483420084FE20004387800014
:1015800004804100104B7800E830EC004220AF00AE
:10159000EA30EC00700A040000000000EA8BBF0093
:1015A000EA2BEC0080027800C4BE200004834200D5
:1015B00040C0B300004B7800DA2FEF004F037800F3
:1015C000CF02780000000600DA0FE20003003200CC
:1015D0001E0A0200000000008F20A8000000060084
:1015E0000F782200F07F220020A0B700000000004A
:1015F00081E0A80004002800641088000440200056
:101600007410880034002000A41088000400280012
:10161000B410880004402000C4108800340020006A
:10162000F4108800D42FEF00D62FEF00D80FA900B8
:10163000D82FA900DA2FEF00DC2FEF00DE2FEF000C
:10164000E02FEF00D84FA900A8A2EF00EA2BEF008F
:101650000028EF0001002000010078000160EF0089
:1016600054010200000000008100E8000F22AF00DA
:10167000FEFF370010A2B700100120000008E600AE
:10168000F5FF3700803E2000AE040200000000009D
:1016900004002800147F880014002000247F8800A4
:1016A00001002000010078000160EF0074010200D9
:1016B000000000008100E8000F22AF00FEFF3700AD
:1016C00010A2B700000120000008E600F5FF370077
:1016D000E28FBF00217F8000020020000300200075
:1016E00004712200BE040200000000000F22AF00BF
:1016F000FEFF3700D4002000841088000F22AF00C6
:10170000FEFF3700A4002000841088000408200099
:10171000147F8800E42FEF00010020000100780012
:101720000160EF0096010200000000008100E80067
:101730000F22AF00FEFF370010A2B70020012000EB
:101740000008E600F5FF3700E28FBF00217F800030
:10175000020020000300200004712200BE040200E9
:10176000000000000F22AF00FEFF3700D400200071
:10177000841088000F22AF00FEFF3700A400200075
:101780008410880004082000147F8800E42FEF00F4
:1017900001002000010078000160EF00BA010200A2
:1017A000000000008100E8000F22AF00FEFF3700BC
:1017B00010A2B700200120000008E600F5FF370066
:1017C000E28FBF00217F8000020020000300200084
:1017D00004712200BE040200000000000F22AF00CE
:1017E000FEFF3700D4002000841088000F22AF00D5
:1017F000FEFF3700A40020008410880014002000A1
:10180000147F8800E42FEF00010020000100780021
:101810000160EF00DE010200000000008100E8002E
:101820000F22AF00FEFF370010A2B700E00020003B
:101830000008E600F5FF3700E28FBF00217F80003F
:10184000020020000300200004712200BE040200F8
:10185000000000000F22AF00FEFF3700D400200080
:10186000841088000F22AF00FEFF3700A400200084
:101870008410880001002000010078000160EF0062
:10188000FE010200000000008100E8000F22AF000E
:10189000FEFF370010A2B700C00020000008E600DD
:1018A000F5FF3700F03F2100417022000C050200D7
:1018B000000000000F22AF00FEFF3700D400200020
:1018C000841088000F22AF00FEFF3700A400200024
:1018D0008410880001002000010078000160EF0002
:1018E0001C020200000000008100E8000F22AF008F
:1018F000FEFF370010A2B700D00020000008E6006D
:10190000F5FF3700F03F2100417022000C05020076
:10191000000000000F22AF00FEFF3700D4002000BF
:10192000841088000F22AF00FEFF3700A4002000C3
:101930008410880001002000010078000160EF00A1
:101940003C020200000000008100E8000F22AF000E
:10195000FEFF370010A2B700D00020000008E6000C
:10196000F5FF370000002000417022000C05020046
:10197000000000000F22AF00FEFF3700D40020005F
:10198000841088000F22AF00FEFF3700A400200063
:101990008410880001002000010078000160EF0041
:1019A0005C020200000000008100E8000F22AF008E
:1019B000FEFF370010A2B700800120000008E600FB
:1019C000F5FF370000402100417022000C050200A5
:1019D000000000000F22AF00FEFF3700D4002000FF
:1019E000841088000F22AF00FEFF3700A400200003
:1019F0008410880001002000010078000160EF00E1
:101A000086020200000000008100E8000F22AF0003
:101A1000FEFF370010A2B700700120000008E600AA
:101A2000F5FF370000002800110020000200200010
:101A30000300200004712200BE0402000000000028
:101A40000F22AF00FEFF3700D40020008410880072
:101A50000F22AF00FEFF3700A40020008410880092
:101A600001002000010078000160EF00B0020200D8
:101A7000000000008100E8000F22AF00FEFF3700E9
:101A800010A2B700100120000008E600F5FF3700A3
:101A900000082000417022000C0502000000000038
:101AA0000F22AF00FEFF3700D40020008410880012
:101AB0000F22AF00FEFF3700A40020008410880032
:101AC00001002000010078000160EF00D402020054
:101AD000000000008100E8000F22AF00FEFF370089
:101AE00010A2B700C00120000008E600F5FF370093
:101AF0001021EF0064DC2200640888000402280042
:101B0000840888008CC0A8008F00A80081E0A9008C
:101B10004220EF0081E0A800030320000400200021
:101B2000250020004005020000000000800278002F
:101B3000140420000520E1001A003A0001002000F2
:101B4000010078000160EF00FE02020000000000CA
:101B50008100E8000F22AF00FEFF370010A2B7009F
:101B6000500120000008E600F5FF370001002000CA
:101B7000010078000160EF00FE020200000000009A
:101B80008100E8001922AF00FEFF37001AA2B7005B
:101B9000500120000008E600F5FF370000140200A5
:101BA00000000000030320000400200025002000A6
:101BB00040050200000000008002780001002000C3
:101BC000010078000160EF00220302000000000025
:101BD0008100E8000F22AF00FEFF370010A2B7001F
:101BE000E00020000008E600F5FF3700050078005F
:101BF000417022000C050200000000000F22AF001F
:101C0000FEFF3700D4002000841088000F22AF00B0
:101C1000FEFF3700A4002000841088005805020051
:101C2000000000000004E00006003A00C6090200BF
:101C300000000000E40A0200000000000E0E040094
:101C40000000000001002000010078000160EF00AA
:101C500042030200000000008100E8000F22AF00F4
:101C6000FEFF370010A2B700500120000008E60078
:101C7000F5FF370001002000010078000160EF004F
:101C800042030200000000008100E8001922AF00BA
:101C9000FEFF37001AA2B700500120000008E6003E
:101CA000F5FF370000140200000000000040FE00B5
:101CB000FFFFFF00FFFFFF00FFFFFF00FFFFFF0030
:101CC000FFFFFF00FFFFFF00FFFFFF00FFFFFF0020
:101CD000FFFFFF00FFFFFF00FFFFFF00FFFFFF0010
:101CE000FFFFFF00FFFFFF00FFFFFF00FFFFFF0000 |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Mon Nov 18, 2019 5:32 am |
|
|
While I don't use that PIC...
1) Looking at the 4 cases, it's obvious that your bootloader is the problem.
2) Posting the hex code is a waste of time as nobody can easily reverse engineer it into CCS C code.
You need to post YOUR bootloader. Those that have the CCS BL, can then compare and see what you've changed. Without seeing the code, I suspect either FUSES are different or the ISR vector table may be different or odd byte boundary issue or ....
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19540
|
|
Posted: Mon Nov 18, 2019 5:49 am |
|
|
Exactly.
In CCS, it is the _bootloader_ that handles the re-vectoring of the interrupts
to the main code. Obviously your bootloader is failing to do this. Result
interrupts won't work. |
|
|
benedictkim
Joined: 14 Nov 2019 Posts: 11
|
|
Posted: Mon Nov 18, 2019 6:37 am |
|
|
Quote: |
2) Posting the hex code is a waste of time as nobody can easily reverse
engineer it into CCS C code.
|
Sorry. The hex code is posted for reference in case 1 and case 3.
We are using a boot loader on another PIC32MX chip, so we modified the
CCS bootloader for compatibility. So I didn't put it up because the source
was so complicated that it would be difficult to analyze.
With the advice of temtronic and Ttelmah, the boot loader seems to be
the problem. Thank you.
Quote: |
In CCS, it is the _bootloader_ that handles the re-vectoring of the
interrupts to the main code. |
Can you tell me where the re-vectoring part of the CCS example is?
benedict is struggling for four days. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19540
|
|
Posted: Mon Nov 18, 2019 7:43 am |
|
|
Two separate things:
Code: |
#int_default
void isr(void)
{
jump_to_isr(LOADER_END+5);
}
|
and in pcd_bootloader.h, the entire #ORG setup. This defines for the
bootloader where it will go, and where it's interrupt vectoring will begin
and for the loaded code where it should go and it's vectoring will go. Both have
to be right.
The 32MX will have a very different page size to the PIC30. This will affect
these settings. |
|
|
benedictkim
Joined: 14 Nov 2019 Posts: 11
|
|
Posted: Mon Nov 18, 2019 7:26 pm |
|
|
Ttelmah, thank you
I searched for "ccs boot loader re vertoring" on Google and normally I shouldn't use interrupts in the bootloader, but it seemed to work.
And
Code: | #int_global
void isr (void) {
jump_to_isr (LOADER_END + 5 * (getenv ("BITS_PER_INSTRUCTION") / 8));
} |
I tried to apply it but I got an "Invalid Pre-Processor directive" error
Let me explain the bootloader.
MCU: dsPIC30F6014A
CCS Ver: PCD 5.016
Boot loader:
In "EX_PCD_Bootloader.c"
Added timer 100ms and RS232 UART2 receive interrupt,
Code: |
setup_timer2 (TMR_INTERNAL | TMR_DIV_BY_64, 11718);
enable_interrupts (INT_TIMER2);
enable_interrupts (INT_RDA2);
enable_interrupts (INTR_GLOBAL);
|
I also added read EEPROM,
Code: |
if (read_eeprom (0x30) == TO_APP_FW_MODE) |
Finally, a fix has been made for compatibility with the PIC32MX.
It works well until I download the application FW from the boot loader.
By the way, booting into application FW works fine except for interrupts.
What's the solution?
The timer interrupt handles when data is not received in the boot loader.
Receive interrupt is processed for stable data reception.
Read EEPROM to move between boot loader and application FW.
Code: |
#include <30F6014A.h>
#include "main.h"
/******************** preprocessor ***********************/
#fuses HS, NOWDT, NOPROTECT // OK
#use delay(crystal = 30Mhz)
#use rs232(UART1, baud=115200, stop=1, parity=N, xmit=PIN_F3, rcv=PIN_F2, bits=8, stream=DBG_PINF3F2)
#use rs232(UART2, baud=115200, stop=1, parity=N, xmit=PIN_F5, rcv=PIN_F4, bits=8, stream=HMI_PINF5F4)
#INT_TBE2
void HMI_Uart2_Tx_isr(void)
{
static unsigned int16 tx_index = 0;
putc(TxBuff.Data[tx_index++], HMI_PINF5F4);
if (tx_index >= TxBuff.Len)
{
tx_index = TxBuff.Len = 0;
disable_interrupts(INT_TBE2);
}
else enable_interrupts(INT_TBE2);
}
void UartTxTask(void)
{
if(Reply_Data_Length)
{
// Get transmit frame from frame work.
GetTransmitFrame();
enable_interrupts(INT_TBE2);
}
}
#INT_RDA2
void HMI_Uart2_Rx_isr(void)
{
static unsigned int1 Escape = FALSE;
unsigned int8 ch;
ch = getc(HMI_PINF5F4);
if(RxBuff.Len >= sizeof(RxBuff.Data)) RxBuff.Len = 0;
switch(ch)
{
case SOH: //Start of header
if(Escape)
{
// Received byte is not SOH, but data.
RxBuff.Data[RxBuff.Len++] = ch;
// Reset Escape Flag.
Escape = FALSE;
}
// Received byte is indeed a SOH which indicates start of new frame.
else RxBuff.Len = 0;
break;
case EOT: // End of transmission
if(Escape)
{
// Received byte is not EOT, but data.
RxBuff.Data[RxBuff.Len++] = ch;
// Reset Escape Flag.
Escape = FALSE;
}
else
{
// Received byte is indeed a EOT which indicates end of frame.
// Calculate CRC to check the validity of the frame.
if(RxBuff.Len > 1) RxFrameValid = TRUE;
}
break;
case DLE: // Escape character received.
if(Escape)
{
// Received byte is not ESC but data.
RxBuff.Data[RxBuff.Len++] = ch;
// Reset Escape Flag.
Escape = FALSE;
}
// Received byte is an escape character. Set Escape flag to escape next byte.
else Escape = TRUE;
break;
default: // Data field.
RxBuff.Data[RxBuff.Len++] = ch;
// Reset Escape Flag.
Escape = FALSE;
break;
}
}
#INT_TIMER2
void TIMER2_isr(void)
{
Timer_100ms_Count++;
}
// Don't touch - Fixed position
#define _bootloader
// "Same with LOADER_PAGES of application FW"
#define LOADER_PAGES 80 // 74 ~ 84 NG
#include <pcd_bootloader.h>
#org LOADER_END+1,LOADER_END+5
void application(void)
{
while(TRUE);
}
#define APP_FLASH_BASE_ADDRESS (LOADER_PAGES * (getenv("FLASH_ERASE_SIZE")/2)) // 0x1440
#define APP_FLASH_END_ADDRESS getenv("PROGRAM_MEMORY") // 0x18000
#define FLASH_PAGE_SIZE getenv("FLASH_ERASE_SIZE") // 0x80
void main()
{
TxBuff.Len = 0;
RxBuff.Len = 0;
fprintf(DBG_PINF3F2, "Start Bootloader\r\n");
delay_ms(1000);
setup_timer2(TMR_INTERNAL | TMR_DIV_BY_64, 11718);
enable_interrupts(INT_TIMER2);
enable_interrupts(INT_RDA2);
enable_interrupts(INTR_GLOBAL);
if (read_eeprom(0x30) == TO_APP_FW_MODE)
{
fprintf(DBG_PINF3F2, "Download JumpToApp#1\r\n");
fprintf(HMI_PINF5F4, "Download JumpToApp#1\r\n");
application();
}
fprintf(DBG_PINF3F2, "EEPROM 0x30: 0x%x\r\n", read_eeprom(0x30));
while(!ExitFirmwareUpgradeMode()) // Be in loop till framework recieves "run application" command from PC
{
// Enter firmware upgrade mode. Be in loop, looking for commands from PC
FrameWorkTask(); // Run frame work related tasks (Handling Rx frame, process frame and so on)
UartTxTask(); // Run Uart Tx tasks
}
fprintf(DBG_PINF3F2, "Download JumpToApp#2\r\n");
fprintf(HMI_PINF5F4, "Download JumpToApp#2\r\n");
application();
}
#int_default
void isr(void)
{
jump_to_isr(LOADER_END+5);
}
|
|
|
|
benedictkim
Joined: 14 Nov 2019 Posts: 11
|
|
Posted: Mon Nov 18, 2019 11:36 pm |
|
|
In general, interrupts are not used by the boot loader, so the structure is changed to polling method. Interrupted in the application program.
Can't I use the timeout function that supports #use rs232 applied to polling method?
Code: |
#use rs232 (UART2, baud = 115200, stop = 1, parity = N, xmit = PIN_F5, rcv = PIN_F4, bits = 8, timeout = 5000, stream = HMI_PINF5F4)
void UartRxTask (void)
{
unsigned int8 ch;
while (! RxFrameValid) // Loop till len = 0 or till frame is valid
{
// Check any character is received.
ch = getc (HMI_PINF5F4);
// Pass the bytes to frame work.
BuildRxFrame (ch);
}
}
|
The first time you download the application FW from the boot loader, the application FW does not work. If interrupted by communication, the application FW is saved or if waiting for 30 seconds, it reboots and operates as the application FW.
Is that correct?
Lastly, the best way to do this is to interrupt the bootloader as asked above. |
|
|
benedictkim
Joined: 14 Nov 2019 Posts: 11
|
|
Posted: Tue Nov 19, 2019 2:05 am |
|
|
The first time you download the application FW from the boot loader, the application FW does not work. If interrupted by communication, the application FW is saved or if waiting for 30 seconds, it reboots and operates as the application FW.
Is that correct?
=> Debugging in the application part
Code: |
void main ()
{
setup_wdt (WDT_ON); // 250msec, 2015.3.19
Systemsinit ();
===================
void Systemsinit (void) {
setup_timer1 (TMR_INTERNAL | TMR_DIV_BY_64, 1171);
setup_timer2 (TMR_INTERNAL | TMR_DIV_BY_64, 11718);
setup_timer3 (TMR_INTERNAL | TMR_DIV_BY_1, 7499);
setup_adc_ports (sAN2 | sAN3 | sAN4 | sAN5 | sAN8 | sAN9 | sAN10, VREF_VREF);
setup_adc (ADC_CLOCK_DIV_2 | ADC_TAD_MUL_2);
setup_compare (1, COMPARE_PWM | COMPARE_TIMER3);
set_pwm_duty (1,0);
can_enable_interrupts (RX0 | RX1);
disable_interrupts (INT_CAN1);
can2_enable_interrupts (RX0 | RX1);
enable_interrupts (INT_CAN2);
enable_interrupts (INT_TIMER1);
enable_interrupts (INT_TIMER2);
enable_interrupts (INT_RDA); // PLC
fprintf (PLC, "S15 \ r \ n");
enable_interrupts (INT_RDA2); // HMI
fprintf (PLC, "S16 \ r \ n");
enable_interrupts (INTR_GLOBAL)
|
In the code,
It was displayed and stopped until S15. That is, it was stopped at enable_interrupts (INT_RDA2);.
Where is it wrong?
The results were the same when the order was changed as shown below.
Code: |
void Systemsinit(void){
setup_timer1(TMR_INTERNAL | TMR_DIV_BY_64, 1171);
setup_timer2(TMR_INTERNAL | TMR_DIV_BY_64, 11718);
setup_timer3(TMR_INTERNAL | TMR_DIV_BY_1, 7499);
setup_adc_ports(sAN2 | sAN3 | sAN4 | sAN5 | sAN8 | sAN9 | sAN10 , VREF_VREF);
setup_adc(ADC_CLOCK_DIV_2|ADC_TAD_MUL_2);
fprintf(PLC,"S15\r\n");
enable_interrupts(INT_RDA2); //HMI
fprintf(PLC,"S16\r\n");
setup_compare(1, COMPARE_PWM | COMPARE_TIMER3);
set_pwm_duty(1,0);
can_enable_interrupts(RX0 | RX1);
disable_interrupts(INT_CAN1);
can2_enable_interrupts(RX0 | RX1);
enable_interrupts(INT_CAN2);
enable_interrupts(INT_TIMER1);
enable_interrupts(INT_TIMER2);
enable_interrupts(INT_RDA);//PLC
enable_interrupts(INTR_GLOBAL);
can_init_user();
can2_init_user();
} |
|
|
|
allenhuffman
Joined: 17 Jun 2019 Posts: 554 Location: Des Moines, Iowa, USA
|
|
Posted: Fri Nov 22, 2019 9:08 am |
|
|
benedictkim wrote: | Code: | #int_global
void isr (void) {
jump_to_isr (LOADER_END + 5 * (getenv ("BITS_PER_INSTRUCTION") / 8));
} |
I tried to apply it but I got an "Invalid Pre-Processor directive" error
|
I was getting that too when I was starting with the bootloader code for the wrong PIC series. There is #int_global for one, and #int_default for the other.
Code: | #int_default
void isr(void)
{
jump_to_isr (APP_A_ADDRESS + 5); // Reset GOTO address location.
} |
APP_A_ADDRESS was the start of my application code in the flash.
(Why is it +5 ? shouldn't it be +4 to just skip over the GOTO instruction at the top of the vector table and get to the first address?) _________________ Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ? |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|