Firmware upgrade using BLUETOOTH

Here is the place for all your dsPic or autopilot questions.

Moderator: lukasz

Firmware upgrade using BLUETOOTH

Postby bogdan » Mon Feb 28, 2011 9:25 am

I have been working with this board (v0.1n) for a coaxial helicopter and I have a strange problem.
1. I programmed the boot loader using MPLAB ICD2.
2. I programmed the firmware using ds30loader via the bluetooth connection.
Everything ok so far.
3. I try upgrading the firmware using Gluonpilot GUI (via the bluetooth ) and I get an error: "Found unknown device id(84) fw ver. 9.9.9"
4. I try upgrading using the FTDI cable and it works.

Why can I program the firmware using bluetooth but not update it ?
Does updating the firmware work via XBee ?

Thank you,
Bogdan
bogdan
 
Posts: 8
Joined: Mon Feb 28, 2011 8:52 am

Re: Firmware upgrade using BLUETOOTH

Postby Tom » Mon Feb 28, 2011 9:28 am

Hi Bogdan,

To be honest, I don't know. I always upgrade the firmware using the FTDI cable.

The bootloader is pre-programmed to work at 115200 baud, which is too fast for Zigbee and maybe as well for bluetooth.
If you wish to use this, you might change the bootloader firmware (included on the SVN server) and change the baudrate to something lower such as 9600 (depending on the speed of your RF modem).

Tom
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Firmware upgrade using BLUETOOTH [SOLUTION]

Postby bogdan » Thu Mar 24, 2011 4:27 pm

I have found the problem. Maybe someone else will find this useful:

The bootloader on the board has a 1 second delay before starting the actual software. The ds30loader (used in gluonpilot) has a parameter "-b" (reset time) also set to 1 second. This works fine using a cable, but with wireless there are additional delays (100ms in case of my bluetooth device). If you increase the reset time parameter, or reduce the bootloader delay everything will work fine.
Note: Programming using wireless is very slow because of the bidirectional communication of the bootloader (used for data integrity).

Tom - maybe you will add an option in the next gluonpilot to switch the -b parameter from 1000 to 1100 (or 1200)
bogdan
 
Posts: 8
Joined: Mon Feb 28, 2011 8:52 am

Re: Firmware upgrade using BLUETOOTH

Postby Tom » Thu Mar 24, 2011 6:44 pm

Thanks! Good find.

So I will change the line
\\ds30loader\\ds30LoaderConsole.exe", " -k=" + _serial.PortName + " -f=\"" + fd.FileName + "\" -p -d=dsPIC33FJ256MC710 -r=" + _serial.BaudRate + " -q=0a;5a;5a;3b;31;31;32;33;0a -u=115200 -b=1000 -o

To

\\ds30loader\\ds30LoaderConsole.exe", " -k=" + _serial.PortName + " -f=\"" + fd.FileName + "\" -p -d=dsPIC33FJ256MC710 -r=" + _serial.BaudRate + " -q=0a;5a;5a;3b;31;31;32;33;0a -u=115200 -b=1200 -o

Will this be enough?
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Firmware upgrade using BLUETOOTH

Postby bogdan » Mon Mar 28, 2011 10:51 am

Yes. It will be OK.
1 second is the delay between receiving the reset command and actually resetting. The extra 200ms should cover all communication delays and is below the bootloader time of 1 second (the time after the which the bootloader starts the program).
So the only remark is that the bootloader time should not be set below 200ms (in the bootloader you provided the value is 1000ms).
bogdan
 
Posts: 8
Joined: Mon Feb 28, 2011 8:52 am

Re: Firmware upgrade using BLUETOOTH

Postby Tom » Mon Mar 28, 2011 11:04 am

Great, how long does it take to upgrade the firmware over bluetooth? Daniel said it can take a while.
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Firmware upgrade using BLUETOOTH

Postby bogdan » Mon Mar 28, 2011 11:12 am

104.1 seconds versus 17.9 seconds by FTDI cable, both at 115200 BAUDRATE.
bogdan
 
Posts: 8
Joined: Mon Feb 28, 2011 8:52 am

Re: Firmware upgrade using BLUETOOTH

Postby Tom » Mon Mar 28, 2011 11:27 am

Slow but still cool to do it wirelessly, I'll give my XBee a try :-)

Any luck with the motor controllers which (according to Daniel) were broken?
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Firmware upgrade using BLUETOOTH

Postby bogdan » Mon Mar 28, 2011 1:09 pm

The motor drivers are fixed now. The problem was that the drain-source on resistance was too high (0.4 ohms), in other words bad choice for transistors (although they should have worked since they are rated at 9 Amps and the motors use less than 3 Amps).

Another problem we had since the beginning is that the motors would start to spin for a short amount of time when we apply power. I checked with the scope and all PWM outputs have this problem: there is short pulse (10 to 20 ms) then the board is powered. For servos this is not a concern.
I can solve this by using a 3-way switch and to connect the Vbat to the motors after powering the board but this is not the best solution.
I think that this pulse can be avoided by connecting a uC pin to either OE1 or OE2 of the output buffer plus a pull-up resistor (since OE is 0 enabled) and enable the buffer in software. I put the scope on the input of the buffer and it is clean at power on, were as the output has the previously mentioned pulse.
bogdan
 
Posts: 8
Joined: Mon Feb 28, 2011 8:52 am

Re: Firmware upgrade using BLUETOOTH

Postby Tom » Mon Mar 28, 2011 1:23 pm

Hmmm this is not something that can be solved in the firmware?
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Next

Return to Firmware

Who is online

Users browsing this forum: No registered users and 3 guests

cron