Created Wed, 16 Dec 2015 17:59:20 +0000 by udokrix
Wed, 16 Dec 2015 17:59:20 +0000
Hello members of the forum,
because I am new here I want to introduce myself first. My name is Udo Krix and I live in Oberhausen, Germany. I am a retired teacher for physics, chemistry and computer science.
I work since 2011 very successfully with chipKIT uno32 in several projects like controlling a milling machine with with hpgl- and gcode-interpreter.
At the moment I work on my own customer board with PIC32MX150F128B, a processor in SPDIP-form with 28 pins and without USB. I adapted the variant files for mpide. mpide, version 0150-linux32-20150820 runs on 32 Bit Linux OpenSuSe 11.4. A bootloader was build from the sources I got from [url]https://github.com/chipKIT32/PIC32-avrdude-bootloader[/url] ,used as linkerscript MX1-2-boot-linkerscript.ld ( without USB) and as base examples.h for the configuration. The compiler, that comes with mpide, was used to translate the sources. The bootloader hex-file was flashed to the PIC32MX150F128B by MPLAB IPE and a PicKit3-programmer. With those tools I could see that the bootloader fits in the boot flash memory and the heartbeat LED was flashing as wished. The problem came with the application. I tried to upload the standard Blink-program using the chipKIT-application-32MX150F128.ld linkerscript where I removed "OPTIONAL("libmchp_peripheral_PIC32MX150F128D.a")". The first steps of uploading the sketch , the negotiations between avrdude and the stk500v2-bootloader, were ok. When the stk500v2-machine came to the command CMD_PROGRAM_FLASH_ISP (0x13), there an error was thrown :
avrdude: ser_recv(): programmer is not responding avrdude: stk500v2_ReceiveMessage(): timeout
I made some variations in baudrate (usually 115200 on /devttyS0) cpu-frequency (40MHz) and wait cycles (6us) for erasing the program-flash-memory but nothing helped. There was also nothing to erase because all cells had 0xFF.
It would be nice,
Many thanks in advance
with best regards
btw. the processor is not defect, I could work well over a UART-connection with a MicroMite BASIC-interpreter on it.
Wed, 16 Dec 2015 18:41:35 +0000
The problem is most likely the compiler. I have tried compiling the bootloader in the past with the normal MPIDE compiler and have had similar results to you. There is a new version of the compiler in beta testing at the moment which is based on XC32 v1.40 which I have had success with. It's not available for general puboic release at the moment, but if you post your board config file for the bootloader here I can compile it for you and post the hex file.
You can rest assured that using the mx150 is certainly supported with the bootloader, since I use it myself.
Sent from my SM-T555 using Tapatalk
Thu, 17 Dec 2015 08:04:00 +0000
Thank you Majenko for your quick response I did not expect. I am lucky that you made the offer of building the avrdude bootloader for me. I have attached the config file for my board. Hoping you are right and the compiler is the reason why I want to thank you very much again.
Thu, 17 Dec 2015 12:22:14 +0000
Here you go, try this one and see if it works.
Thu, 17 Dec 2015 14:13:56 +0000
Thank you very much for your efforts Majenko. I flashed your bootloader , which is significant shorter (ca. 500 Bytes) than mine, to the board. When uploading the Blink sketch avrdude finished with avrdude done. Thank you. but before there was an error thrown
avrdude: verifying ... avrdude: verification error, first mismatch at byte 0x00f8 0x00 != 0xff avrdude: verification error; content mismatch
So there is an error but different from that I got before. As I can see in MPLAP IPE the total program flash memory kept erased, all 0xFF, there is no program written to the memory. In the config memory I see the fields FUSBIDIO and FVBUSONIO set to ON though the chip is not an USB-device :?: Nevertheless thanks again and I will keep on searching to solve the problem though that will be not easier when the sort of compiler is obviously in the game.
Thu, 17 Dec 2015 15:07:54 +0000
Try this version - I compiled against the wrong branch last time (though it shouldn't have mattered).
Also the USB settings in the config have no effect on the MX150 chip. I don't know why they are there, but those bits in the config words do absolutely nothing.
We're generally moving away from using avrdude for programming - we use pic32prog now. It's the default programmer in chipKIT-core. If you don't have it you can get it here: https://github.com/sergev/pic32prog
Thu, 17 Dec 2015 19:55:51 +0000
Success!!! What a joy. A Christmas present one week too early. Thank you Majenko. As an old schoolmaster I would give you a 1+ (very good) because of knowledge, tenacity and helpfulness.
Obvious there is in your system a right branch that solved the problem. :) The PIC32MX150F128B runs as planned.
Fri, 18 Dec 2015 00:23:35 +0000
Only too glad to help :)
If you ever need another bootloader compiling (and the new compiler hasn't been released yet) just shout up - I'm more than happy to compile them.
Mon, 21 Dec 2015 11:08:27 +0000
earlier than I had expected I need your support again. I wanted to test my custom board without a 8MHz quartz and had to learn, that you must not remove the crystal without confusing the whole time system of the processor. The processor now runs with a much smaller frequency. So I changed the oscillator settings to FRC-Oscillator in the bootloader config file, which I have attached to this post. I hope I have not forgotten an essential point.
I ask you to build a new bootloader for me if you find the time, don't hurry.