• AVR Freaks

Hot!dsPIC33EV - EZBL Bootloader read-back verification failure

Author
Benjamin_hu
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2020/02/04 07:31:43
  • Location: Hungary
  • Status: offline
2020/02/13 16:38:48 (permalink)
0

dsPIC33EV - EZBL Bootloader read-back verification failure

Hi, Microchip and all!
 
I am trying to test the EZBL v2.11 in a dsPIC33EV256GM002 microcontroller but i have some problems and issues.
My hardware setup is the following. I have a custom board which have an embedded Linux. That board is similar to Rasp. Pi in 90%. Next to the main application processor it has a dsPIC33EV256GM002 with an UART and I2C connection. So, i can communicate to dsPIC from the embedded Linux well via UART and I2C.
 
My problem which is unresolved yet is that, i can not upload the "ex_app_led_blink" application to my dsPIC33EV256GM002 by "ex_boot_uart" and neither by "ex_boot_i2c" examples.
 
I am following the instruction of the pdf documentation. I can build these examples well, also i can programming "ex_boot_uart" and "ex_boot_i2c" to my dsPIC by an ICD3 programmer succesfully. But when i try to upload the .bl2 file of "ex_app_led_blink" examples via "ezbl_comm" in the end of the uploading at status of 99% or 100% i get "Bootloader read-back verification failure" (EZBL_ERROR_HARD_VERIFY_ERROR) from dsPIC, always.
 
I tested it in both mode UART and I2C in Linux and moreover, it was tested in Windows host PC too, by the "ezbl_comm.exe" (in UART mode by an FTDI USB to UART) which was pre-compiled by Microchip. Always, i get the same "Bootloader read-back verification failure" error in all platform and mode.
 
Dear Microchip and community, can you check my HW initializer codes ("dspic33ev_uart.c" and "dspic33ev_i2c.c") and ezbl_comm log files in my attachments?

I am using the following SWs and HWs for building:
  • Windows 10 (1809) 64bit
  • MPLAB X IDE v5.30
  • XC 16 v1.41 and v1.35 (both tested with failed)
  • EZBL v2.11
  • ICD3 programmer
  • PIC24/dsPIC Peripheral Libraries v2.00
post edited by Benjamin_hu - 2020/02/13 16:40:34
#1

3 Replies Related Threads

    Benjamin_hu
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2020/02/04 07:31:43
    • Location: Hungary
    • Status: offline
    Re: dsPIC33EV - EZBL Bootloader read-back verification failure 2020/02/13 16:43:48 (permalink)
    0
    My full example projects are available from the following link. Can you advise any fix for it and check my project settings, too?
    https://drive.google.com/drive/folders/1bSEY0q6QTRHYbxmjj6fcgytBFVatLFCj
     
    #2
    Benjamin_hu
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2020/02/04 07:31:43
    • Location: Hungary
    • Status: offline
    Re: dsPIC33EV - EZBL Bootloader read-back verification failure 2020/02/21 04:56:33 (permalink)
    0
    Finally, i got a workaround solution from official Microchip support.
     
    "It may be possible that there is an issue inside the EZBL generation procession that involved changes within the compiler. We encountered one single issue similar to this and we are currently working on it.
    As a workaround, in the Bootloader project, try removing the EZBL_SET_CONF() macro calls in the hardware initialization file and replace them with #pragma config statements generated by MPLAB X IDE. Minimally, the config bits in the FSEC register need to be defined with #pragma config statements instead of EZBL_SET_CONF()."
     
    So, this HW init code was solved my problem and now i am able to upload well "ex_app_led_blink" application example to EZBL bootloader.
    #if defined(EZBL_BOOT_PROJECT) // Compiling for a Bootloader Project
    // FSEC register need to be defined with #pragma config statements instead of EZBL_SET_CONF()
    //EZBL_SET_CONF(_FSEC, BWRP_OFF & BSS_DISABLED & BSS2_OFF & GWRP_OFF & GSS_DISABLED & CWRP_OFF & CSS_DISABLED & AIVTDIS_DISABLE)
    // _FSEC(x) legacy macro works
    //_FSEC( BWRP_OFF & BSS_DISABLED & BSS2_OFF & GWRP_OFF & GSS_DISABLED & CWRP_OFF & CSS_DISABLED & AIVTDIS_DISABLE )
    // #pragma config statements for Bootloader read-back verification failure bugfix: https://www.microchip.com/forums/m1128347.aspx
    #pragma config BWRP = OFF
    #pragma config BSS = DISABLED
    #pragma config BSS2 = OFF
    #pragma config GWRP = OFF
    #pragma config GSS = DISABLED
    #pragma config CWRP = OFF
    #pragma config CSS = DISABLED
    #pragma config AIVTDIS = DISABLE
    EZBL_SET_CONF(_FOSCSEL, FNOSC_FRC & IESO_OFF)
    EZBL_SET_CONF(_FOSC, POSCMD_XT & OSCIOFNC_ON & IOL1WAY_OFF & FCKSM_CSECME & PLLKEN_ON) // 8.000MHz XT crystal oscillator, allow multiple PPS remappings, enable clock switching and fail safe clock monitor, wait for PLL lock
    EZBL_SET_CONF(_FWDT, WDTPOST_PS1024 & WDTPRE_PR32 & FWDTEN_ON_SWDTEN & WINDIS_OFF & WDTWIN_WIN75)// ~1024ms timeout when watchdog is turned on in software (not forced on in hardware), use ordinary (non-windowed) Watchdog Timer mode
    EZBL_SET_CONF(_FPOR, BOREN0_ON)
    //EZBL_SET_CONF(_FICD, ICS_PGD3) // For external 6-pin PICkit header
    EZBL_SET_CONF(_FICD, ICS_PGD1) // For onboard PKOB Programmer/Debugger
    EZBL_SET_CONF(_FDMT, DMTEN_DISABLE)
    EZBL_SET_CONF(_FDEVOPT, PWMLOCK_OFF & ALTI2C1_OFF)
    #else // Compiling for an Application Project (EZBL_BOOT_PROJECT is not defined)
    EZBL_SET_CONF(_FALTREG, CTXT2_IPL7 & CTXT2_IPL6) // Do assign a context register set to IPL4 (or whatever you have your NOW Timer set to)
    #endif // Goes to: #if defined(EZBL_BOOT_PROJECT)
     
     
     

    post edited by Benjamin_hu - 2020/02/24 10:39:22
    #3
    RISC
    Super Member
    • Total Posts : 5907
    • Reward points : 0
    • Status: offline
    Re: dsPIC33EV - EZBL Bootloader read-back verification failure 2020/04/14 09:23:05 (permalink)
    0
    Hi,
    Thanks for the hint.
    By following this method I could get EZBL v2.11 to compile the bootloader for dsPIC33CH512MP508 and get the led blinking application to bootload.
    NB : it is necessary to copy ALL the configuration bits (not only FSEC) from the configuration bits window generated by MPLAB X into the (in my case) dspic33ch128mp508_explorer_16.c file located in the Hardware Initializers project directory and to comment all the EZBL_SET_CONF() macro calls. 
    Regards
    NB : this issue seems to currently affect all the 16bits devices. I also tried the default PIC24FJ1024GB610 and I had a similar issue.
    #4
    Jump to:
    © 2021 APG vNext Commercial Version 4.5