I2C Master Bootloader Bridge Example Help

Go To Last Post
2 posts / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,


I'm trying to get the I2C Master Bootloader Bridge Example working for the SAMD21 Xplained Pro Dev board and I'm having issues getting the code running. I currently have the following setup:

  • SAMD21 Eval Board successfully working with Atmel Studio 7 and programmed with the I2C Master Bootloader Bridge Example
    • I think the drivers are installed correctly. In device manager, I can see the Atmel section with the EDBG Data Gateway and the EDBG Virtual COM Port under Ports. However, Should I see the EDBG Debugger as well? I was looking at this I2C Document as a reference and on page 6 and 7 they list the EDBG Debugger under the Atmel section of the device manager.
    • the EDBG is set as DGI and not MSG
    • In any case, the eval board is able to be seen in the available tools and upgraded the EDBG to v3.25
  • A second SAMD21 has the SAM I2C Slave Bootloader installed with the I2C lines(And GND) tied together
  • A pair of 10k pullup resistors has been placed on the SDA and SCL pins
  • Also have a logic analyzer tied to the SDA and SCL pins to look at the traffic
  • Python 2.7 is installed on PC with the pyserial module.
    • The project documentation states that we need to use a provided python script to communicate with the master over USB and transfer the binary app file.
    • Through some trail and error I went with Python 2.7 instead of Python 3. I've found that Python 2.7 often has print statements without parens () whereas Python 3 will pull a error. Please let me know if this is not the case.
    • I've had to guess what serial module they used and just went with the first serial module i found which happened to be pyserial
  • A binary file has been created that starts at flash location 0x00002000
    • This is just the starting project code of pressing SW1 and LED0 will turn on.


I've gotten to the part when I use "python bootloader.py -p COM3 -i led_toggle_flash.bin" command. When I use the command I get as far as "Transfering File..". Reading through the python script it seems like it got past opening the virtual port, sending the length of the file and then just hangs waiting for a response. When I try and debug this on the Atmel studio side, I set breakpoints and found that the COM port is never even detected as opened so it doesn't fall through to the file transfer part. 


My only thought is if there another COM port that is supposed to exist for the DGI? I can only see one and it says its the EDBG Virtual COM port. Although when I connect to this COM port with TeraTerm, I can see the "Starting Application" prinf statements that are written into the code.


Any Suggestions would be great. (Also sorry for the wall of text)


Version information and helpful links:


​Thanks in Advanced!

This topic has a solution.
Last Edited: Mon. Jul 23, 2018 - 06:33 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Found the issue.


I didn't fully understand the scope of the example project. There are supposed to be two separate virtual COM ports discovered on the PC side. The SAMD21 board during this project is setup as a compound device with a CDC port(Communications Device Class) on the "Target USB" port, not the "Debug USB" port. This is the port that needs to be used for this example project.  My original thought was since the DGI is setup through the Debug port that the COM port needed for the project but that was incorrect.


Below is what I have found to be discovered via Device Manager when plugged in:


Debug USB Port(Listed from Device manager):

  • Atmel 
    • EDBG Data Gateway
  • Ports
    • EDGB Virtual COM Port(COM20)
      • Used to see system debug messages from printf when setup

Target USB Port(Listed from Device manager):

  • Ports
    • Communications Device Class ASF example(COM21)
      • ​Used to communicate and transfer bin file via python script.