chipKIT® Development Platform

Inspired by Arduino™

Extreme Noob needs help please

Created Sat, 14 Feb 2015 13:13:21 +0000 by Hanno


Hanno

Sat, 14 Feb 2015 13:13:21 +0000

Guys I need help from some one that knows more than me. To be fair I expect that means everyone else on this forum , but hopefully one day I can also be there to help others.

I am running (K)ubuntu 14.13.3 and have a chipKIT Max32 that I am just trying to program with the basic blink sketch for now.

I am fairly clued up in windows (and grew up using DOS), but have recently switched to Linux where I am totally out of my depth.

When I try to upload the sketch I get a continuous error message that says :

avrdude: stk500v2_ReceiveMessage(): timeout

And nothing gets loaded to the chipKIT. I have 2 chipKIT's and have tried with both with no success so I assume my problem lies on the PC/Linux side.

I would be very happy if someone with a some patience can help and guide me through the error trapping. Please bear in mind that I am not a fluent Linux user and would probably not understand the the linux sublanguage :mrgreen:

Hoping to hear from you soon.


majenko

Sat, 14 Feb 2015 17:02:46 +0000

There's two things you have to watch out for on Linux with serial ports.

First is to make sure you have permission to access the serial device (it sounds like you probably do) by making sure you are in the "dialout" group:

$ sudo usermod -G dialout hanno

Secondly is to make sure that nothing else is using the serial port. On normal Ubuntu it's often the Modem Manager that is to blame (though I'm not sure about Kubuntu). Unless you are using dialup networking (and that is highly doubtful in this day and age) it's recommended to uninstall the modem manager:

$ sudo apt-get remove modemmanager

There are other programs that some other linux systems install by default that grab any serial ports. One that springs to mind is "brltty" on Debian.

You can find out if anything is using the device by:

$ fuser /dev/ttyUSB0
/dev/ttyUSB0:         8859

That number (if there is one) is the process ID of the process using the port. You can then find the process with:

$ ps -p 8859

Hanno

Sat, 14 Feb 2015 17:42:16 +0000

Thanks for the reply majenko

So far I have done the following :

upgraded to the lastest MPIDE.

uninstalled modemmanager

made sure I have permissions for the usb

I have checked now and no other process is grabbing the port.

I have a friend in Cape Town who is also trying to help me via teamviewer so lets see if we win.

else I will come and ask again.


Hanno

Sun, 15 Feb 2015 07:02:42 +0000

Ok

After a long night I am not any further in getting my chipkit to play along.

I am thinking that the bootloader may be corrupt / missing as I got the board from a friend.

Can anyone tell me where I can find the bootloader hex file for my chipKIT Max32 so I can reflash it. ?

I do have a PICKit 3 progammer and have installed the MPLABx IPE succesfully.


majenko

Sun, 15 Feb 2015 11:00:01 +0000

It's all on Github: [url]https://github.com/chipKIT32/PIC32-avrdude-bootloader[/url]

The pre-compiled bootloaders are in the BootloadersCurrent-Hex folder.


Hanno

Sun, 15 Feb 2015 11:26:44 +0000

Thank you . I have found them since.

Downloaded chipkit-max32.hex and flashed the board succesfully using MPLABX IPE.

Then tried to load the blink sketch again.

and I am getting the same error message still.

avrdude: stk500v2_ReceiveMessage(): timeout

I am now stumped.


jmlynesjr

Sun, 15 Feb 2015 16:33:20 +0000

Have you looked in the Linux log files to see if/which USB port is getting initialized when you plug in the cable?

I have had the same errror message in the past and it was related to Ubuntu changing the USB address when plugging/unplugging the cable. Then the port assignment didn't match what I had set up in MPIDE. There may be old posts discussing this issue. Search under my ID and see if you find them.

James


Hanno

Tue, 17 Feb 2015 11:01:16 +0000

Yep

Took a look at the logs. Correct USB is being used.

Keep on getting the timeout error.

I am at the point of giving up and looking for another platform to work on.


majenko

Tue, 17 Feb 2015 13:06:11 +0000

Have you given UECIDE a go yet?