Re: Bootloader for ARSOV UAV BOARD V1.1

337 views
Skip to first unread message

Piotr Markiewicz

unread,
Nov 17, 2012, 9:27:53 AM11/17/12
to uavde...@googlegroups.com
It should work without DTR, as I understand DTR is needed for UDB4 because there is no reset button. But till now I have no succeess.
Can post correct settings.inc file? Looking inside MP code telemetry port is UART1 with alt pins, but loader is unable to detect bootloader.

regards
Piotr

W dniu piątek, 2 listopada 2012 23:05:38 UTC+1 użytkownik bagger napisał:
Hi all,

   I would like to use a bootloader from last MatrixPilot package - ds30. In document I found that it needs a DTR line for reset. How to implement this bootloader for hardware from Nick - ARSOV UAV BOARD V1.1. Should it start working on power up? Or it will be work without DTR line only with switch reset on board? I'm working a lot with AVR's and PIC is somthing new for me.


Regards,

Jarek 

Robert Dickenson

unread,
Nov 18, 2012, 5:39:00 AM11/18/12
to uavde...@googlegroups.com
G'day Jarek,

Please note the ds30 loader for the UDB4 is already in the MatrixPilot SVN respository under a couple of branches. I have just checked and it is included in the tools directory of the barometer branch. Since I have already done the customisation work for it to work with the UDB4 board, I suspect it will possibly work as is on the AUAV2.

If you could test the existing version, and get back to me, we could fix any problems and merge it with trunk for use by the wider MatrixPilot community.

Thanks and regards, Robert.

On 3 November 2012 09:05, bagger <sba...@o2.pl> wrote:
Hi all,

   I would like to use a bootloader from last MatrixPilot package - ds30. In document I found that it needs a DTR line for reset. How to implement this bootloader for hardware from Nick - ARSOV UAV BOARD V1.1. Should it start working on power up? Or it will be work without DTR line only with switch reset on board? I'm working a lot with AVR's and PIC is somthing new for me.


Regards,

Jarek 

--
--
 
 

Piotr Markiewicz

unread,
Nov 18, 2012, 6:01:09 PM11/18/12
to uavde...@googlegroups.com
Robert,

first problem is that AUAV1 is using different processor, I tried a lot of things but I cannot send correctly anything over UART. I tried to send few chars after bootloader and UART init but it doesn't work.
AUAV2 isn't available yet so I'm looking for solution for existing hardware.

regards
Piotr

GliderUAV

unread,
Nov 25, 2012, 8:18:12 AM11/25/12
to uavde...@googlegroups.com
Hi Jarek,
 
I tried Ds30 on Udb4 and it works.
 
The is one issue I found: I can reset the Udb4 with RTS (to the Reset-pin) from the Ds30 GUI. But for some reason this only works the first two seconds after power-up. (I can "Check for BL" multiple time quickly ok)  As soon Led 1 comes on, I can still reset the board, but ds30 will no longer respond. I cannot explain this.
 
Regards,
Kees
 

Op vrijdag 2 november 2012 23:05:38 UTC+1 schreef bagger het volgende:

Piotr Markiewicz

unread,
Dec 30, 2012, 12:37:45 PM12/30/12
to uavde...@googlegroups.com
Any progress on bootloader for AUAV1?

regards
Piotr

W dniu niedziela, 2 grudnia 2012 15:36:40 UTC+1 użytkownik bagger napisał:
Thank you all for answers.I will try to use the  Ds30 in AUAV.


Regards,


Jarek

GliderUAV

unread,
Feb 8, 2013, 5:39:08 AM2/8/13
to uavde...@googlegroups.com
Hi,
 
I tried to build ds30 for the AUAV1, (UDB4 is ok) but no luck so far.
 
This is what I have right now:
 
- Bootloader on AUAV1:
  - tip: test the serial connection using Hilsim (Status flags 010 when both RX and TX are working)
  - For AUAV1: TX is LVTTL input, RX is TTL output.
  - use the files in MatrixPilot_3_3\Tools\ds30 Loader\firmware 16-bit\src
  - FRC_PLL8 (7.3728 MHz Internal RC oscillator, 8x PLL enabled) => Fout = 58982400, FCY = 14745600, UXBRG = 7 (is calculated)
  settings.inc:
   .equ __30F4011, 1
   .equiv  FCY, 14745600                    // FRC_PLL8 as MP/AUAV1
   .equiv USE_UART2, 1                     // GPS/Hilsim port# differs from UDB4, comment out UART1
   .equiv  BAUDRATE, 115200
   ;.equiv USE_ABAUD                // commented out
   ;.equiv USE_BRGH                 // commented out
   config  __FOSC,  CSW_FSCM_OFF & FRC_PLL8  // same as MP/AUAV1
Any suggestions are more than welcome.
 
Regards,
Kees

Op zondag 30 december 2012 18:37:45 UTC+1 schreef Piotr Markiewicz het volgende:

Robert Dickenson

unread,
Feb 8, 2013, 6:53:49 AM2/8/13
to uavde...@googlegroups.com
Hi Kees, are you using the version which I've committed to the repository, or going it from scratch with the ds30 source?


--
--
---
You received this message because you are subscribed to the Google Groups "uavdevboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Robert Dickenson

unread,
Feb 8, 2013, 6:55:43 AM2/8/13
to uavde...@googlegroups.com
Sorry Kees, I didn't read your post very well.

My first suspicion would be that the oscillator/baud rates are not correct. Can you modify the code to just send a known character out repeatedly, and check for it in a terminal.

GliderUAV

unread,
Feb 8, 2013, 3:25:29 PM2/8/13
to uavde...@googlegroups.com
Hi Ansuz,

Nice to hear from you. I will try that when i have the time. Do my calculations look right to you?

Regards,
Kees

Robert Dickenson

unread,
Feb 8, 2013, 6:49:30 PM2/8/13
to uavde...@googlegroups.com
Hi Kees,

You may want to try this:

in module ds30loader.s, insert the following lines directly after the rcall to CommInit:

testme:
        SendL     ( 55 )
        bra        testme


Build the project, program your UDDB, open a terminal program set to your choosen baudrate.

You should see ASCII character '7' repeating (very quickly)

If this fails and you have an oscilloscope handy, ASCII '7' is hexadecimal 0x55, or binary 01010101, which gives a signal on the scope which makes it rather easy to measure the bit time of.

Let me know how you get on...




;------------------------------------------------------------------------------
; Init
;------------------------------------------------------------------------------
        UserInit                    ;macro in user_code.inc
        clr        WDOERASE                
        rcall    CommInit

testme:
        SendL     ( 55 )
        bra        testme

;------------------------------------------------------------------------------
; Receive hello
;------------------------------------------------------------------------------



GliderUAV

unread,
Feb 10, 2013, 3:19:22 PM2/10/13
to uavde...@googlegroups.com
Ansuz,
 
I tried this:
 
testme:
        SendL     ( 0x55 )
        bra        testme
 
and I got this:
 
0x55 0x55 0x55 0x55 0x55 0x55
and no framing errors.
 
Hmmm..
I need to check if tx to the pic is ok, tx from the pic seems ok.
 
Kees
 

Op zaterdag 9 februari 2013 00:49:30 UTC+1 schreef Ansuz het volgende:

Robert Dickenson

unread,
Feb 10, 2013, 8:10:48 PM2/10/13
to uavde...@googlegroups.com
Hi Kees,

That's a good sign, I'm glad to hear the intent of my suggested test has worked.

I'm in another city at the moment and hence don't have my hardware with me. However hopefully later tonight I'll be back and be able to make another edit which will aim to echo back characters you send. Then we'll have an idea of whether or not your serial comms is working both ways.

Cheers, Robert.

Robert Dickenson

unread,
Feb 11, 2013, 6:15:38 AM2/11/13
to uavde...@googlegroups.com
'evening Kees,

Try the edit below. If the expected result isn't obvious, you should get an echo of any characters you type into your terminal program. If this works you at least know your serial comms is working as expected.


;------------------------------------------------------------------------------
; Init
;------------------------------------------------------------------------------
        UserInit                    ;macro in user_code.inc
        clr        WDOERASE                
        rcall    CommInit
       
testme:
        rcall    Receive
        rcall    Send

        bra        testme

;------------------------------------------------------------------------------
; Receive hello
;------------------------------------------------------------------------------




GliderUAV

unread,
Feb 11, 2013, 2:42:54 PM2/11/13
to uavde...@googlegroups.com
Hi Robert,
 
Thanks again for your help
 
This test confirmd the issue:
 

BUILD SUCCEEDED

--and--

Initiating write...
      Searching for bl .
      Found dsPIC30F4011 fw ver. 4.0.3
      Waiting for the boot loader to be ready...ok
      Parsing hexfile...
            File timestamp: 7-2-2013 16:13:18
            Opening hexfile...ok
            Validating hexfile...ok
            Hex file successfully parsed
      Writing flash....ok
      Tx 48,1kB / Rx 487 bytes / 7,6s
      Write successfully completed

YES!

remember my comment:

- tip: test the serial connection using Hilsim (Status flags 010 when both RX and TX are working)

- For AUAV1: TX is LVTTL input, RX is TTL output.?

I was using a MAX232 on 3.3V, and it seemed to work with HILSIM, because I needed both RX and TX to get status 010.

Your code proved me wrong.

So, I placed a Level Converter (Sparkfun) on the TX wire of the MAX232 and powered that with 5V.

Solved!, thanks Robert & Mikael Gustavsson.

So it is important to use a serial port that can handle "TX is LVTTL input", "RX is TTL output" or add a single external Level Converter.

I read about a LVTTL aware FTDI running on 5V, I dont know if that's true?

 

Next I want to test RTS or DTR reboot and bootload without power-cycling the board.

I will cleanup my settings.inc and post it here soon. Also I would like to add the .hex file for ease of use. Then more testing.

 

Regards,

Kees

Op maandag 11 februari 2013 12:15:38 UTC+1 schreef Ansuz het volgende:

GliderUAV

unread,
Feb 13, 2013, 3:07:54 PM2/13/13
to uavde...@googlegroups.com
Hello,
 
Here is the setting.inc file for the AUAV1.
The bootloader works ok without a reset line, it should be active the first few seconds after power on.
If you like, you can attach a wire from DTR or RTS to the MCLR-pin. Tick the pin in the Reset tab of the ds30 GUI. You can start bootloading at any time after power-up this way.
 
Robert, will you publish this in trunk, please?
 
Kees
 

Op maandag 11 februari 2013 20:42:54 UTC+1 schreef GliderUAV het volgende:
settings.inc.auav1

GliderUAV

unread,
Feb 14, 2013, 6:38:10 AM2/14/13
to uavde...@googlegroups.com
And the hex file.
 
Cheers, Kees.
ds30_Bootloader_115200_Gps_port_AUAV1.hex

Kees Guijt

unread,
Feb 17, 2013, 9:47:21 AM2/17/13
to uavde...@googlegroups.com
Robert,
 
It works.!  I posted the files in the thread.
 
Regards,
Kees

GliderUAV

unread,
Feb 26, 2013, 3:49:19 PM2/26/13
to uavde...@googlegroups.com
Hi, in case you missed it, the bootloader works now. I hope someone out there is willing to place it in trunk one day.

Regards,
GliderUav

Robert Dickenson

unread,
Feb 27, 2013, 4:42:58 AM2/27/13
to uavde...@googlegroups.com
G'day GU,

Please note the ds30-bootloader is included in trunk under the tools directory. I have not included a hex file at this point since i've always wanted to firstly somehow include 'remove before flight' tag functionality, especially before promoting it for general use. My thoughts so far include identifying a pair of pins common to most (all) board types, which require a jumper in order for the bootloader to be invoked on reset. This is to prevent any possible inadvertent entry to the bootloader should the UDB somehow reset during flight - not a desirable failure mode.

Any thoughts from the group welcome.

Thanks and regards, Robert.


Piotr Markiewicz

unread,
May 15, 2013, 4:47:14 AM5/15/13
to uavde...@googlegroups.com
Hi,

I have a strange problem with bootloader, I tried hex file from here and also I tried settings.inc with loop sending 0x55 char and also nothing.
MP sends data without any problem with both prolific and ftdi.
Any idea?

regards

GliderUAV

unread,
May 15, 2013, 1:16:00 PM5/15/13
to uavde...@googlegroups.com
Hi Piotr,
 
If the Auav1.1 board is sending 0x55 and you don't see data coming in, then maybe the voltage level of the Rx pin of the Gps connector (that is the pin that TRANSMITs, the pin next to the Vcc pin) the data is not matched with your prolific and ftdi devices. Are they TTL (5v) compatible? Using a LVTTL device might not work with this pin. If you have a level-converter (like the sparkfun Logic Level Converter  BOB-08745, put it in and test it again.
BTW the Tx pin is LVTTL(3.3V) already.
 
Good luck,
GliderUav
 

Op woensdag 15 mei 2013 10:47:14 UTC+2 schreef Piotr Markiewicz het volgende:

Piotr Markiewicz

unread,
May 16, 2013, 4:40:55 AM5/16/13
to uavde...@googlegroups.com
OK both Prolific and FTDI are TTL (5V) levels, but why they work correctly with matrix pilot code? I can see telemetry sent by MP but nothing from test bootloader. 
I just ordered LVTTL FTDI so I will do a check.

regards
Reply all
Reply to author
Forward
0 new messages