Arduino 1.6.7 IDE pic32prog no target found CMOD board

andcvi
Posts: 12
Joined: Fri Oct 31, 2014 11:33 pm

Arduino 1.6.7 IDE pic32prog no target found CMOD board

Post by andcvi » Tue May 17, 2016 2:19 am

Correct me if I am wrong but as I understand the MPIDE IDE is no longer being supported, so will eventually have to use the Arduino IDE.

I have setup Arduino IDE 1.6.7 with release version chipkit-core-windows-16778039.master.v1.1.0-18-gcd8bbd3.zip

It compiles my programs without problems, but uploads via the the CMOD board serial port bootloader fails, all I get is pic32prog version 2.0.186 no target found, I have no problems uploading when using the MPIDE IDE.

Does pic32prog have to use the pickit3 rather than serial port upload, if that is the case how do I use the serial port bootloader in the Arduino IDE.

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Arduino 1.6.7 IDE pic32prog no target found CMOD board

Post by majenko » Tue May 17, 2016 10:06 am

pic32prog is the program that is used in MPIDE for programming the chipKIT boards - unless you have a very old version of MPIDE that still uses avrdude. It talks STK500 the same as avrdude through the UART port.

If it's not detecting the board then it may be that it's not resetting the board properly. Check that it does actually reset when you tell it to program (LED flashes). There have been a lot of issues with the FTDI drivers of late.

Personally I would recommend switching to UECIDE rather than the Arduino IDE - simply because it is about 1000x better, and I wrote it :) Support for the chipKIT boards is considerably better than in the Arduino IDE.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

andcvi
Posts: 12
Joined: Fri Oct 31, 2014 11:33 pm

Re: Arduino 1.6.7 IDE pic32prog no target found CMOD board

Post by andcvi » Thu May 19, 2016 3:16 am

Hello majenko

Thanks for the reply, the mpide IDE I use is mpide-0150-windows-20150820.

I downloaded your UECIDE.0.8.8.alpha22 and it has the same problem as Arduino.1.6.7 IDE using pic32prog, if I use avrdude option then it uploads the code without problems.

The FTDI drivers I had loaded were version 2.8.30.0 so updated to the latest version 2.12.16.0, again same problem, this is with Windows XP SP3, so installed UECIDE on Windows 7 SP1 with latest FTDI driver same problem.

The Cmod appears to be reset using pic32prog because the bootload led goes out, but does not flash.

avrdude works ok so it must be a problem with pic32prog.
Attachments
uecide2.jpg
uecide2.jpg (106.9 KiB) Viewed 1061 times
uecide1.jpg
uecide1.jpg (208.16 KiB) Viewed 1061 times

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Arduino 1.6.7 IDE pic32prog no target found CMOD board

Post by majenko » Thu May 19, 2016 10:57 am

There is a known issue with pic32prog in windows using some of the factory shipped bootloaders from Digilent. If you have a hardware programmer you could try updating the bootloader to the current open-source version which you can get here: https://github.com/majenkotech/PIC32-av ... urrent-hex
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Arduino 1.6.7 IDE pic32prog no target found CMOD board

Post by majenko » Thu May 19, 2016 11:28 am

Virtual XP machine, UECIDE 'alpha22, cmod with freshly installed "stock" bootloader (downloaded from digilent's site) and it programmed straight away.
uploaded.png
uploaded.png (106.9 KiB) Viewed 1056 times
The FTDI drivers I am using are the last "zip" XP version: http://www.ftdichip.com/Drivers/CDM/CDM ... tified.zip
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

andcvi
Posts: 12
Joined: Fri Oct 31, 2014 11:33 pm

Re: Arduino 1.6.7 IDE pic32prog no target found CMOD board

Post by andcvi » Sun May 22, 2016 4:04 am

Hello majenko,

Thanks for your help.

I tried the 2.8.24 FTDI drivers, still no go, also tried the original Cmod bootloader and the one from your pic32-avrdude-bootloader and I tried the FTDI drivers on another windows xp pc same result.

I also used MPLABX and your pic32-avrdude-bootloader code to compile the Cmod bootloader, I use the chipkit xc32 compiler and it compiles without any problems, again same result.

I should have stated that I have made a Cmod compatible board using the Cmod bootloader without external crystal osc, I use the internal osc, since I had no problems with mpide and avrdude. I used a serial port monitor to log data between my Cmod board and pic32prog, don't know if this will help.

I was thinking that using the internal osc maybe causing the 115200 baud rate to be slightly off, but if avrdude has no problems then pic32prog should work also.

If you plan to keep the avrdude option in your UECIDE then I will continue using the avrdude option.

pic32prog serial monior.zip
(2.69 KiB) Downloaded 31 times

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Arduino 1.6.7 IDE pic32prog no target found CMOD board

Post by majenko » Sun May 22, 2016 11:12 am

I wasn't planning on keeping avrdude in UECIDE for the PIC32 but I certainly can do - I'll build a programmer plugin for the preview version of UECIDE so it stays available.

That trace is hard to understand what is going on. Better would be to manually run pic32prog in debugging mode and capture the output. I'm not entirely sure how you'd do that in Windows, but in Linux I run:

Code: Select all

$ ~/.uecide/cores/chipkit/tools/linux64/pic32prog -d /dev/ttyUSB0 -DD
That will spew out everything that is sent and received along with lots of extra debugging information about what it is doing when. Of course, you'd need to find that pic32prog executable (in /Users/<you>/AppData/Local/uecide/cores/chipkit/tools/windows I think) and change /dev/ttyUSB0 to the COM port you are using. You can turn on verbose command execution in UECIDE to see the full command that is being run and copy and paste that into a command prompt and add -DD to turn on debugging.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

andcvi
Posts: 12
Joined: Fri Oct 31, 2014 11:33 pm

Re: Arduino 1.6.7 IDE pic32prog no target found CMOD board

Post by andcvi » Mon May 23, 2016 5:13 am

hello majenko,

I used the original Cmod bootloader and used an 8mhz resonator across the osc pins and it made no difference with pic32prog.

I did as you suggested and ran pic32prog in debug mode from a terminal and the results are in the text file. Hope this helps in finding out why it doesn't work with my setup.

have included the original Cmod bootloader from Digilent and my recompiled Cmod bootloader using intosc and pin 33 & 34 for bootload serial port

pic32prog debug output.zip
(7.18 KiB) Downloaded 33 times

andcvi
Posts: 12
Joined: Fri Oct 31, 2014 11:33 pm

Re: Arduino 1.6.7 IDE pic32prog no target found CMOD board

Post by andcvi » Wed May 25, 2016 4:04 am

hello majenko,

I managed to get pic32prog to upload.

My FTDI USB serial cable has only RTS and CTS lines and have been using the RTS line to reset the board, tried CTS but did not reset the board, I then tried another USB serial cable which had the DTR line but this did not reset the board.

So the next thing I tried was to just have GND, TX, RX connected and manually kept the board in reset until I pressed the compile and upload button and then it worked, obviously it has to do with timing when using the RTS line which in my setup does reset the board.

Another thing on my board I have the the MCLR pin connected to a 10k resistor and a 0.1uf capacitor, do you think the capacitor in the reset circuit maybe the problem. I haven't tried yet as I have a broken hand so am one handed for the next couple of weeks.

uecide manual reset.jpg
uecide manual reset.jpg (406.49 KiB) Viewed 1011 times

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Arduino 1.6.7 IDE pic32prog no target found CMOD board

Post by majenko » Wed May 25, 2016 9:21 am

Ah, it's starting to all become clear now.

CTS can never work - it's an input TO the chip that would connect to RTS on a remote device - to look to see if it's clear to send (the other end is signalling it's ready to send).

So RTS is all you have. I thought RTS should work fine in UECIDE - as long as the board is configured to use it. It's related to this post: http://uecide.org/forum/viewtopic.php?f ... 9&start=30

RTS will struggle in other IDEs that don't know about it.

Can you upload the schematic of your reset circuit, including the RTS (or DTR) connection?
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

Post Reply