SAM3x8E based custom board, controls bunch of peripherals | Upload Frmware Prob|

Hi,

I have designed a custom PCB using SAM3x8E.
However, I am now unable to upload code.

I am trying to upload the code through FTDI FT232 module. With Rx of FT232 connecting with Rx of SAM3x8E and Tx of FT232 with Tx of SAM3x8E.

The arduino IDE detects the COM port.
However when i upload the code it shows device not found error.

Please help me as I have already invested a lot in making the PCB.

Thanks
Saumil

Saumil:
With Rx of FT232 connecting with Rx of SAM3x8E and Tx of FT232 with Tx of SAM3x8E.

I think you need to cross over RX/TX, ie. RX of FT232 should be connected to TX of SAM3X8E.

It sounds like the OP is trying to emulate the programming port on the Due. I say that because the much easier approach would have been to go the native route and just hook up to the USB port on the SAM3X and program that way. I've done that with TONS of custom boards and it works fine.

If you insist on going the serial port route then you must ensure two things:

  1. Like bobcousins said - be careful about your RX/TX directions. It's easy to mix this up and then it will not work. Try swapping them.

  2. You have to reset the SAM3X into bootloader mode. Look here: Arduino Playground - DueBootloaderExplained

Make sure you're doing the things that the link says you have to do in order to get it into programming mode.

hi colllins & bob

thanks for help.

I will correct the RX to TX and vice versa.

Secondly, when i try to connect with Native Port, the compiler say NO device found on COM12

thanks
saumil

Infact, when I go to device manager , the board is not even recognized.

I am guessing , I need to install SAM BA USB driver ?

I highly recommend reading chapter 20 in the SAM3X8E user manual. SAM3X/SAM3A Series Complete

Hi bob,

I read the document, its still quite low level language for me.
I am not able to understand much.

I do understnad couple of things.

SAM-BA has to be initiatlized on a new chip.
This can be done either through SAM3-BA driver tool or Bossa if I want to upload the code through Native Port. Other wise I can bypass this activity with a ATMEGA16U2 which can provide upload on RX TX via software ERASE.

I am not using ATMEGA16U2 in my circuit.I though i could upload it throufh Ft232 but getting sfoware erase is an issue. How can I get HArdware ERASE on Programming port through FT232.

Secondly way, Through Native Port, How do implement bossa.exe. Ineed a step by step guide to run SAM32x8E through Bossa. All i know of bossa is that there are commands of a particualr format that I hve to write in terminal window adn write the .bin file of my code to that command. How do i create the .bin fiel in Arduinio IDE? Do ineed to program in ATMEL STUDIO to generte .bin file.?

Please help.!

thanks
Saumil

Ok, I strongly suggest you buy a Due and use that as a base for your project.

I get your point.. I have t learn few things..if i need to get out of the prob...using a due as base is not a solution.

thanks

Saumil:
Secondly way, Through Native Port, How do implement bossa.exe. Ineed a step by step guide to run SAM32x8E through Bossa. All i know of bossa is that there are commands of a particualr format that I hve to write in terminal window adn write the .bin file of my code to that command. How do i create the .bin fiel in Arduinio IDE? Do ineed to program in ATMEL STUDIO to generte .bin file.?

Through the native port it will show up as "BOSSA Programming Port" or something of that sort. You can directly flash sketches this way right through the Arduino IDE. It even can erase the chip automatically for you. You don't have to do much of anything special, the secret sauce is all in the chip and the Arduino sketches you flash. But, sometimes a sketch will go belly up and die and then you can't flash properly through the native port. Most everyone connects the erase pin to a button on the board you can press. If you run into trouble you press that button for about 2 seconds then power cycle. Now you're back to the native port presenting as BOSSA and you can flash again.

You can also use a button like that to reset for your programming port too. Really, the erase button is your friend.

ERASE pin needs to be high for a period of time when the CPU is reset. Any other time is does nothing (see SAM3X user manual, section 6.6).

To use your PCB at all, you need to get access to the ERASE pin, connect it to a switch or jumper. Then the Erase sequence is:

  1. Put ERASE HIGH
  2. Put RESET low for a few milliseconds
  3. Release RESET (should be pulled high)
  4. Wait a second or two
  5. Release ERASE (should be pulled low)

The SAM3X should now be erased, and the SAM-BA ROM bootloader active.

Now you can connect to the FTDI chip, and program using bossa.exe. In Arduino IDE turn on verbose mode and you can see the commands that are used to create the BIN file. I'm not sure if Atmel Studio has the option to create a bin file, otherwise run the command in a DOS prompt or add a custom build step in Studio.

If you want to replicate the auto-erase feature of the 16u2 on the Due using the FTDI, it can be done using the custom IO lines, or maybe DTR/CTS. You will need to wire up ERASE and RESET lines to the FTDI, (refer to the Due schematic).

Just for fun, here is a pic of the SAM3X board I designed

Hi bobcousins and Collins,

Thanks to your suggestions the board has started being discovered by my PC as BOSSA Programming Port.
I had heard earlier but now I am actually realising the power of open source.

There is one last step I think.
Even the program gets upload fine. But, the output does't show.

My inference.

T program the board using Arduino IDE, the BOSSA needs to give control to ARduino. This happens automatically in Arduino Due where as soon as I connect theDUE it shows up as BOSSA port but when the program uploads the COM port automatically changes to Arduino Native USB Port.

Unfortuantely, this same activity is not happening in my board. I do see the BOSSA Programming COM port refreshing after upload but the Arduino NAtive USB port does not get recognized. Hence my program is not showing results.

Do you have any suggestions. I suspect that my SAM3x8E VID ,UID need to be updated in drivers ?
Plz help.

Thanks
Saumil

Saumil:
Do you have any suggestions. I suspect that my SAM3x8E VID ,UID need to be updated in drivers ?

Yes if you are using your own VID/PID (and not Atmel ones), then you need to create a new driver. That can be easy or hard depending on what OS and version you are using.

I sought of know the VIDs and PIDs for due. Its fixed fro all Dues

SAM - BA - VID 6124 PID 03EB

Native Port VID 6124 PID 003E

Programming Port VID 6124 PID 003D and these are the ATMEL ones.

still I can't get BOSSA port to change to ARDUINO DUE once i upload the code.

Plz advice ?

bobcousins:
ERASE pin needs to be high for a period of time when the CPU is reset. Any other time is does nothing (see SAM3X user manual, section 6.6).

To use your PCB at all, you need to get access to the ERASE pin, connect it to a switch or jumper. Then the Erase sequence is:

  1. Put ERASE HIGH
  2. Put RESET low for a few milliseconds
  3. Release RESET (should be pulled high)
  4. Wait a second or two
  5. Release ERASE (should be pulled low)

The SAM3X should now be erased, and the SAM-BA ROM bootloader active.

Now you can connect to the FTDI chip, and program using bossa.exe. In Arduino IDE turn on verbose mode and you can see the commands that are used to create the BIN file. I'm not sure if Atmel Studio has the option to create a bin file, otherwise run the command in a DOS prompt or add a custom build step in Studio.

If you want to replicate the auto-erase feature of the 16u2 on the Due using the FTDI, it can be done using the custom IO lines, or maybe DTR/CTS. You will need to wire up ERASE and RESET lines to the FTDI, (refer to the Due schematic).

Just for fun, here is a pic of the SAM3X board I designed

can you pubblish the schematic of your project please? thanks :slight_smile:

1 Like