• PIC24 Topics
  • EZBL_EraseAll or EZBL_NVMKEY not working in mplab x IDE version 5.4
2020/11/11 23:44:33
hamboy75
I have a bootloader working for mplab x IDE v4.2 for years. It is compilated with XC16 1.35.
We are updating it to be used on MPalb x IDE v5.40. I have been able to make this by creating an example of ezbl and replacing the files with my code from version 4.2.
 
I had to make small changes to certain files (just few undefined ports not defined in newest version).
My bootloader searchs for a firmware update in a SD memory and burns it to the flash. As I said this code is working perfectly in 4.2
 
The thing here is that EZBL_EraseAll is not deleting the flash memory in version 5.4. If i set it to verbose mode I get this:
 
 Write: 002198 9059FE DD19C8 710083 90610E
         0021A0 514F8A 360003 400408 488489 37FFE9 BE050C 97B60F 97B69F
         0021B0 EF6870 20A9C2 97B03F 97B0CF 07337D E00400 3A0003 EFA850
  Read: 002198 320009 B2C206 3A000A 200045
         0021A0 FB8039 32010A 2006C6 E10406 3A0004 200025 B00065 FB8039
         0021B0 320103 B2C250 320024 B2C460 3200E3 781F88 E9040F B001CF
  Write: 0021C0 EF2852 37009B 97B03F 97B0CF 884280 884291 560661 5E86E0
         0021D0 97B0DF 660201 97B16F 668002 EB0080 DD01C0 200002 B82061
         0021E0 710100 718181 90602E 504FE3
                                               MISMATCH (program and erase restricted; bootloader mismatch)
  Write: 0021C0 EF2852 37009B 97B03F 97B0CF 884280 884291 560661 5E86E0
         0021D0 97B0DF 660201 97B16F 668002 EB0080 DD01C0 200002 B82061
         0021E0 710100 718181 90602E 504FE3
  Read: 0021C0 B2C3B0 320073 B2C200 32006F B2C0D0 32002E B2C110 320019
         0021D0 B2C0D0 320017 B2C190 320069 B2C1F0 320067 B101CF 78044F
         0021E0 B2C1C0 3200AC B2C1D0 3200D3
  Write: 0021E8 3A001A 20A9C0 97E9EF 797003
         0021F0 97B80F 2FF004 97B2FF 620205 EB0280 DD2B48 DE2248 730204
         002200 DE2AC8 20A9D1 78F104 E80081 797080 20F001 600001 B80261
                                                                           MISMATCH (program and erase restricted; bootloader mismatch)
  Write: 0021E8 3A001A 20A9C0 97E9EF 797003
         0021F0 97B80F 2FF004 97B2FF 620205 EB0280 DD2B48 DE2248 730204
         002200 DE2AC8 20A9D1 78F104 E80081 797080 20F001 600001 B80261
  Read: 0021E8 B2C080 3200D8 B2C030 3200D6
         0021F0 B2C200 3200D4 B2C220 3200D2 B2C200 3200D0 3700D4 E80408
         002200 37FF6C A6F01A 37000B 2002D7 786C07 200010 550385 EA8BD7
  Write: 002210 DD2BC8 DE2248 738204 DE2AC8 20A9F0 787104 370069 504FE2
         002220 3A000E 20A9C0 97E8EF 797001 2FF004 97B1FF 620203 EB0280
         002230 DD2B48 DE2248 730204 DE2AC8


Write operating are not working either
 
Some sectors are FFFF when read is shown , specially last sectors, and write operations dont modify them.
 
EZBL_NVMKey is set to 0xFC21
 
Well, I would like to know why the same code is working for version 4.2 and not for version 5.4 even when compiler is in both case XC16.
 
Thanks in advance.
© 2021 APG vNext Commercial Version 4.5

Use My Existing Forum Account