bootloader issue on my DIY 32bit clone board

edited January 2016 in Build-it-yourself
I have fabricated the 32bit board myself in accordance with design files shared by the OpenBCI Team. So I have to load the bootloader by myself, and unfortunately, I fail to load the 32bit board. 

I download the bootloader UDB32-MX2-DIP.hex from the website :
and I go on the loading procedure exactly as the instruction from the digilent website:
  In this document above, the MPLAB IDE v8.92 is used. The loading procedure is failed, the blue LED will not light on, and will not have any other reaction when press the buttons PROG and REST, and the bootloader is not working.And I have also tried MPLAB IPE .After the programming action, the output box shows "Device Erased..." and "Programming/Verify complete".But the "start adress" and the "end adress" is shown blank in the output box. The loading fails too. I also have tried the chipKIT-DP32 bootloader, and the result is failure too.
  To verify the procedure of programming, I have write a small code to make the blue LED blink with MPLAB IDE, After the programming action, the output box shows "Device Erased..." and "Programming/Verify complete".But the "start adress" and the "end adress" is shown certain number in the output box. And after I load the hex file, the blue LED does blink, which verifies that the procedure of programming is correct, and I don't have any error in this procedure.Then what's wrong with the loading procedure? Is there anything that I forget to consider? Please let me know, 
Thanks very much.

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Bruce, I assume you've looked through this thread,

    http://openbci.com/forum/index.php?p=/discussion/208/chipkit-uploading-tips-restarting-bootloader

    Although your hardware there probably has some variations.
  • biomurphbiomurph Brooklyn, NY
    Bruce,

    Good on ya for diving into hardware creation!
    We use MPLAB X IDE v2.35 to flash the PIC32 in our lab. 
    You can download it here (we don't use their beta version 3.0, if you try, please let us know if it works)
    You will also have to download the compiler XC32 Compiler v1.34

    We use the PICkit3 programming tool to upload with. What tool are you using?
  • @biomurph,
    I have tried the MPLAB X IDE v2.35, the UDB32-MX2-DIP.hex file is import from the File>Import>Hex/ELF..File, and the hardware tool is chosen as PICkit3/ SN:BUR132284452. And I don't do anything more in the procession of importing the image file. When it is finished, I check the "Make and Program Device" option to load the hex file. and the output shown like this:

    Connecting to MPLAB PICkit 3...
    Currently loaded firmware on PICkit 3
    Firmware Suite Version.....01.36.10
    Firmware type..............PIC32MX

    Target voltage detected
    Target device PIC32MX250F128B found.
    Device ID Revision = A1

    The following memory area(s) will be programmed:
    boot config memory
    configuration memory

    Device Erased...

    Programming...
    Programming/Verify complete

    As you may have notice that  the boot config memory  and  configuration memory are blank in the output box. Is it normal and correct? or Something Wrong?
    and in the processiong of programming, the time is very short, it is as short as one second. Is it correct?

    In my comprehension, the XC32 is useful in the compling the code written by C, not in the loading of hex file. Do you use the MPLAB X IDE to flash the PIC32
    generally or in the usage of OPENBCI?  If should I obtain the project of the C source file for UDB32-MX2-DIP, and build the hex file myself? In the github, there
    is an example project for the bootloader, should I work on it to rebuild the UDB32-MX2-DIP bootloader? Is this a heavy work, or are there some tutorials and
    guides that I can get?

    Thanks so much.

  • @wjcroft,
    Yeah, I have looked through the thread your mentioned, and I can't find helpful thing for my problem.
     
    Thanks all the same.
  • biomurphbiomurph Brooklyn, NY
    Hi Bruce,

    It looks like you did it correctly. 
    We use MPLAB X to bootload the PIC32. We do not use MPLAB X IDE to program anything in house or in the world.
    To write and upload code to the OpenBCI 32bit Board we use mpide, which is based on Arduino 0023.
  • @biomurph
    Thank you for your comments. I have solved the problem. As your instuction, I use MPLAB X to bootload the PIC32, and find out the external crystal is not working because one capacitance besides the crystal happened to break down. After the capacitance is replaced with a good one, the bootloader can work now. and the blue LED light pleasantly when upload the code.

    (1)However, here I counter another problem. when I upload the code to the OpenBCI 32bit Board with mpide, the error happens:
    avrdude: Expected signature for 32MX250F128B is 50 49 43
                 Double check chip, or use -F to override this check.

    and I am sure that the signature in boolloader is correct and so is the chip 32MX250F128B. It is very confusing. Do you have some guess at the cause? I have focus on the baud rate as below, do I miss something important?

    (2)After some trying, I focus on the 115200 baud rate. I think that the precision of system clock 40M is not enough because of my design placement of crystal in my DIY PCB board. In the bootloader, I have inseted a segment of program to transmit data in a range of 1 t0 255 through serial at 115200 baud rate. I use the tool of serial debugging assistant to see the transmission of data from the PIC32MX. The result shows that the data from 0x00 to 0x 7F have a random chance to be wrong with the highest bit in a byte is changed. like 0x03 to 0x83, 0x47 to 0xC7 and so on. However, the data form 0x80 to 0xFF is always correct.  I have tried a series of capacitance values about the capacitance byside the crystal without any improvement. Should I replace the crystal with a active oscillator?

    (3)I also tryed another way to overcome the problem: to reduce the baud rate of upload the code. I can modified the configuration bits about serial ports to reduce the baud rate to 57600. And I also change the board.txt in the OpenBCI forlder obtained from the OpenBCI,and the folder is correctly placed as the instruction online. In this way, when the code is uploading, the blue led lights pleasantly only one senconds, and then light off. So I must have neglected something in the configuration about the mpide or about the bootloader. Can you give me a comment, please?

    Thanks. I personally think the third question may solve the problem and expect the answer from you. Any comments  are helpful to me.



  • biomurphbiomurph Brooklyn, NY
    Hi,

    I have not seen this error that you show 

    avrdude: Expected signature for 32MX250F128B is 50 49 43
                 Double check chip, or use -F to override this check.

    That's a new one on me. 
    I do not follow your discussion in number (2) it is very confusing.
    It may help if you showed, or provide a link, to your hardware design and system connection setup.
    You are open-source, are you not?

  • @biomurph
    Thanks. I have made a stupid error. I have hacked the board and use USB-to-TTL to communicate the board with the PC. All of the problems I metioned on May 21 are solved by simply replacing the bad-quality USB-to-TTL with a better one.
    Thanks again.
  • biomurphbiomurph Brooklyn, NY
    YAY!
Sign In or Register to comment.