bossac patch

Discussion in 'Arduino IDE' started by Andy1988, Jul 26, 2014.

  1. Andy1988

    Andy1988 New Member

    Joined:
    Jul 26, 2014
    Messages:
    3
    Likes Received:
    0
    Hi all,

    I'd like to know what exactly you guys patched in bossac. I know that if you want to program the SAM3X from the iMX6 itself, I need to assert two GPIOs attached to ERASE and RESET. But what did you do for external programming?
    Unfortunately it seems that you only deliver the bossac binaries itself. Is the patch published somewhere?
     
  2. gfasino

    gfasino New Member

    Joined:
    Jun 27, 2014
    Messages:
    13
    Likes Received:
    0
    Hi,
    the bossac file is made for program the UDOO arduino part with the arduino IDE.
    You have to insert the bossac file into hardware/tools folder of arduino IDE.
    However you can use the patch arduino IDE downloadable here:
    http://udoo.org/download/files/arduino- ... DOO.tar.gz
     
  3. Andy1988

    Andy1988 New Member

    Joined:
    Jul 26, 2014
    Messages:
    3
    Likes Received:
    0
    I know that. I'd like to know what exactly was patched IN the bossac application.

    bossac itself is a regular open source application. Now licensed under BSD, before that it was licensed under GPL.
    https://github.com/shumatech/BOSSA

    I'm curious what you guys patched in that application.
     
  4. Halloween

    Halloween Member

    Joined:
    Jul 23, 2014
    Messages:
    33
    Likes Received:
    3
    Yes, it seems you need also a modfied bossac file with a booted Android, because it's working with booted Udoobuntu only.
     
    kenr likes this.
  5. pklaus

    pklaus New Member

    Joined:
    Dec 19, 2013
    Messages:
    2
    Likes Received:
    0
    Me too, I would like to know that. Without the source code / a diff you simply cannot be sure what happens there. The whole concept of open sourcing the Arduino environment is a farce if you need a binary blob to upload the file to the SAM3X in the end! Please let us know what you did there.
     
  6. Andy1988

    Andy1988 New Member

    Joined:
    Jul 26, 2014
    Messages:
    3
    Likes Received:
    0
    I recently reverse engineered what they are doing there. It's a combination between BOSSA patches and a custom kernel module.
    BOSSA patch: https://github.com/UDOOboard/BOSSA/comm ... 15db573229
    Kernel module: https://github.com/UDOOboard/Kernel_Uni ... udoo_ard.c

    What they do is, they are using DTR and RTS on the serial port to send commands to the linux kernel which resets or erases the SAM3U via GPIO lines. The kernelmodule just waits for the DTR and RTS lines to wiggle around and then controls the ERASE and RESET pins on the SAM3U via the gpio subsystem. RTS is the clock signal and DTR is a data bit for the protocol.

    This function here (https://github.com/UDOOboard/BOSSA/comm ... 0b4d78R102) 'authenticates' with a token which is 0xA5A5 and then sends 0xF as a following data byte. The kernel module then erases and resets the SAM3U. Before it resets, it disabled some UART and/or GPIO lines.

    Another function here (https://github.com/UDOOboard/BOSSA/comm ... 0b4d78R142) again sends the auth-token and then 0x0 as the following data byte. The kernel then reenables the UART and the GPIO lines it disabled beforehand.

    You can look up all the used pins in the schematic. Initially there was a small PIC inteded for performing exactly that task, but it's not populated on the boards. At least not on mine. Now they are doing all that in the said kernel module I linked to above.
     
  7. estebanSannin

    estebanSannin New Member

    Joined:
    Feb 21, 2015
    Messages:
    11
    Likes Received:
    8
    Andy1988 thanks for this post... very usefull!
     
  8. Itachi

    Itachi New Member

    Joined:
    Jun 14, 2015
    Messages:
    10
    Likes Received:
    0
    Hello,
    I got UDOO Quad. I am trying to program it externally using PC(windows 8.1) using Arduino IDE(version 1.5.4). I did patch up and connected UDOO(CN6) to my PC using micro usb with J18 unplugged.When I try to upload basic Blink code it is displaying the error "SAM-BA operation failed".
    [​IMG]

    When i deleted the cygwin1.dll file from" C:\Program Files (x86)\Arduino\hardware\tools " and trying to upload the code it is not displaying the errors but the code is not uploading.
    [​IMG]
     
  9. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi there all,
    we don't want to "hide" the bossac sources, we'll publish them as soon as we got a calmer moment :) Please be patient in the meanwhile.
     

Share This Page