chipKIT uC32 with Dragino YUN shield

ltheoret
Posts: 50
Joined: Wed Dec 23, 2015 9:19 pm

Re: chipKIT uC32 with Dragino YUN shield

Post by ltheoret » Thu Feb 25, 2016 7:52 pm

Hi,

Tested this on both the ChipKIT wf32 and uC32, work well.
Tested it with the WiFire, works too.
With the WiFire the Dragino Shield cannot read the USB. tried it more than once, no SD. interesting.

Luc

ltheoret
Posts: 50
Joined: Wed Dec 23, 2015 9:19 pm

Re: chipKIT uC32 with Dragino YUN shield

Post by ltheoret » Thu Feb 25, 2016 8:18 pm

Hi,

One more comment. In the Service->chipkit.service file. there is a board id, majenko calls it wf32 I call it uC32. then in the UECIDE board.txt files you need this to match. well for the WF32, uC32 and WiFire boards I changed them all to uC32 as I realised it identified the family of boards not the model of board.

I do not recommend using this with the WiFire, it disables the USB on the Dragino shield.
I do not need the WiFire with the Dragino. I was just testing to see if it would work. my concluding is: do not use it with the WiFire.

Luc

ltheoret
Posts: 50
Joined: Wed Dec 23, 2015 9:19 pm

Re: chipKIT uC32 with Dragino YUN shield

Post by ltheoret » Thu Feb 25, 2016 8:39 pm

A big thank you to majenko for getting this up and running so fast.

Luc

ltheoret
Posts: 50
Joined: Wed Dec 23, 2015 9:19 pm

Re: chipKIT uC32 with Dragino YUN shield

Post by ltheoret » Thu Feb 25, 2016 11:26 pm

Hi,

I left the YUN-uC32 board running with just the blink demo running.
Now I tried to up load a MySQL example I am working on, and the board refused to upload the sketch.
So I changed uC32 boards and I uploaded the MySQL demo with no problem. but now I want to use the Blink example again mot to flood my my database with random data.
This is the error I get:
Compiling...
• Compiling sketch...
• Compiling core...
‣ api
• Compiling libraries...
• Linking sketch...
Compiling done.
Memory usage
• Program size: 6096 bytes
• Memory size: 492 bytes
• Compilation took 0.634 seconds
Uploading firmware...
Uploading firmware image...
Programming target...
Programmer for Microchip PIC32 microcontrollers, Version 2.0
Copyright: (C) 2011-2015 Serge Vakulenko
Adapter: STK500v2 Bootloader
Program area: 1d000000-1d1fffff
Processor: Bootloader
Flash memory: 2048 kbytes
Boot memory: 80 kbytes
Data: 6096 bytes
Erase: Cannot enter programming mode.
Done
'Cannot enter programming mode' or uC32 just hangs with the LD 4 status light blinking like crazy and the LD5 solid on, when that happens UECIDE hangs. Rebooting the Linux or the uC32 does not help.

Do I Have to close and open UECIDE between each sketch. could it because I have 2 UECIDE open at the same time, because now it works again.

When I cycle the power on the boards everything works again. I will try to only have one instance open at a time.

Luc

ltheoret
Posts: 50
Joined: Wed Dec 23, 2015 9:19 pm

Re: chipKIT uC32 with Dragino YUN shield

Post by ltheoret » Fri Feb 26, 2016 12:08 am

Hi,

I think it is the run-pic32prog in the YUN shield that is getting stuck. I invoked it with no command line parameters and it did the same, got stuck, with the lights flashing like above. Reboot Linux and then the uC32 and recovered.

Luc

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

Re: chipKIT uC32 with Dragino YUN shield

Post by majenko » Fri Feb 26, 2016 12:36 am

Yes, I have experienced this as well. There is something about the UART connection that it doesn't much like. I have a feeling that the level shifter for the UART is getting confused. It's supposed to automatically sense the direction of the signals, and I think it's maybe a little too sensitive sometimes and getting stuck in the wrong direction.

It would be nice to try bypassing that UART level shifter, since it shifts from a source voltage of 3.3V (the SPI shifter goes from 2.5V, but the UART is already shifted to 3.3V inside the HE module) and see if that improves things. I need to check which pins on the HE are the UART and solder some wires in to there - there's no way I can do it on the shifter chip ;)

Either that or there's something intercepting the data when it shouldn't. Either way it's causing a breakdown in the bootloader protocol which confuses everything.

At the moment I am working on a board that uses the USB variant of the bootloader, so it's not touching those UART pins at all, and it's working 100% reliably.

On a side note: I think I am going to bundle my FTDI drivers, my pic32prog and scripts, and the CDC/ACM drivers as well into one big "chipKIT" package to make it easier to install everything at once.
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".

ltheoret
Posts: 50
Joined: Wed Dec 23, 2015 9:19 pm

Re: chipKIT uC32 with Dragino YUN shield

Post by ltheoret » Fri Feb 26, 2016 12:42 am

Hi,

Still having issues. I think the problem is with the uC32 board. I cannot get it to program any more. Even after removing the power and restarting.
This is what I get when I try to use the program directly in the Dragino shield.
BusyBox v1.19.4 (2015-01-06 10:25:28 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

____ ____ _ ____ ___ _ _ ___
| _ \| _ \ / \ / ___|_ _| \ | |/ _ \
| | | | |_) | / _ \| | _ | || \| | | | |
| |_| | _ < / ___ \ |_| || || |\ | |_| |
|____/|_| \_\/_/ \_\____|___|_| \_|\___/

W i F i, L i n u x, M C U, E m b e d d e d

Model: Dragino v2
Version: Dragino-v2 common-2.0.7
Build Tue Nov 24 19:39:50 CST 2015

www.dragino.com
----------------------------------------------------

root@MyDragino-01:~# cd ..
root@MyDragino-01:/# cd mnt
root@MyDragino-01:/mnt# cd sd
root@MyDragino-01:/mnt/sda1# ls
$RECYCLE.BIN System Volume Information data
BLINK-uC32.hex arduino mysql.py
root@MyDragino-01:/mnt/sda1# run-pic32prog BLINK-uC32.hex
Programmer for Microchip PIC32 microcontrollers, Version 2.0
Copyright: (C) 2011-2015 Serge Vakulenko
Adapter: STK500v2 Bootloader
Program area: 1d000000-1d1fffff
Error setting parameter 70
root@MyDragino-01:/mnt/sda1#
The same error I was getting from UECIDE.

Luc

ltheoret
Posts: 50
Joined: Wed Dec 23, 2015 9:19 pm

Re: chipKIT uC32 with Dragino YUN shield

Post by ltheoret » Fri Feb 26, 2016 12:50 am

Hi majenko,

Yes from all the info I been reading on the YUN shield, it is very sensitive to the UART.
I look forward to a chipKIT package. Would that include hardware or just software?

Luc

ltheoret
Posts: 50
Joined: Wed Dec 23, 2015 9:19 pm

Re: chipKIT uC32 with Dragino YUN shield

Post by ltheoret » Fri Feb 26, 2016 1:22 am

I was reading and in order to make tis work, I think I will have to remove R1 and R2 from the UC32 board, it is the same for the wf32 board.
The problem is, the resistors are so tiny. If I get them off, they will be off permanently. I will try but I ran out of time, next week.

Luc

ltheoret
Posts: 50
Joined: Wed Dec 23, 2015 9:19 pm

Re: chipKIT uC32 with Dragino YUN shield

Post by ltheoret » Fri Feb 26, 2016 7:12 am

hi,

Well I had a little time so I removed R1 and R2 from my uC32 board, and now there is 100% failure rate in programming. Great, just threw a board out the window :( .
Will I had the brilliant idea of using 4.7 K ohm resistors to pull the RX and TX. well it reset OK but it made things worst. No Joy.

Is there a way to lower the baud rate for programming?

Luc

Post Reply