Go Down

Topic: Forcing reset using 1200 bps (Read 856 times) previous topic - next topic


Hi everyone,

I'm working on a simple program that will take a .bin file and re-flash the sam3x8e via the native port (I'm only interested in the native port). Currently, my program uses bossa for read/write operations and it seems to work okay except for one issue. After the sam3x8e has been programmed with Arduino code it is no longer recognized by the program or bossa. To my understanding, this is because the sam no longer boots from it's factory installed sam-ba bootloader. I've figured out how to clear the GPNVM1 bit on the sam and force it to boot from sam-ba, rather than flash, making it recognizable again. Problem is, I can only do this from code within the sam itself- which is only partially helpful.

Code: [Select]

#include <flash_efc.h>

uint32_t boot_samba() {
    uint32_t ul;
    uint32_t ul_gpnvm1 = 1;
    ul = flash_clear_gpnvm(ul_gpnvm1);
   return ul;

This page here describes how the Arduino IDE is able to reprogram the sam (http://playground.arduino.cc/Bootloader/DueBootloaderExplained) and says the following: "When the port is opened with baud rate 1200, it will set the GPNVM bits apporiately for booting to SAM-BA, and reset itself."

This is what I'm having trouble with. Due to a lack of understanding I have not been able to figure out how to open the com port at 1200 bps. My hopes are to incorporate some code into my program which can do this, but for now I'm looking for any information. I've tried using other software (putty) to connect to the com port with 1200 baud rate and haven't even had success with that.

If anyone has any wisdom they'd like to share or can point me in the right direction, I'd much appreciate it! Thanks.


when you are using putty, I assume you are working under windows.

just enter:  
Code: [Select]
mode COMxy: 1200 and you are set!  replace xy with the right number of your COM port!

Go Up