bootloader issue on my DIY 32bit clone board
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
http://openbci.com/forum/index.php?p=/discussion/208/chipkit-uploading-tips-restarting-bootloader
Although your hardware there probably has some variations.
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.
Yeah, I have looked through the thread your mentioned, and I can't find helpful thing for my problem.
Thanks all the same.
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.
Double check chip, or use -F to override this check.
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.