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:
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.
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.?
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:
Put ERASE HIGH
Put RESET low for a few milliseconds
Release RESET (should be pulled high)
Wait a second or two
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
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.
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.
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:
Put ERASE HIGH
Put RESET low for a few milliseconds
Release RESET (should be pulled high)
Wait a second or two
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