User Tools

Site Tools


oak:tutorials:serialfirmware

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
oak:tutorials:serialfirmware [2016/03/13 00:01]
pfeerick [Connecting Your Oak]
oak:tutorials:serialfirmware [2016/04/08 19:43] (current)
pfeerick [Connecting Your Oak]
Line 30: Line 30:
 ====== Connecting Your Oak ====== ====== Connecting Your Oak ======
  
-To program your Oak over serial, you will want to connect the GND of your USB-Serial Adapter to the Oak's GND, RX to TX, TX to RX, and P2 to GND. You can then power the Oak via the on-board MicroUSB slot, or by providing appropriate power to the VIN or VCC pins. This is probably a good time to also ensure that you [[https://​github.com/​digistump/​OakRestore|reset your Oak to factory defaults]]so that it runs your program when you upload via serial (by resetting the bootloader to running the program loaded in slot 0). +To program your Oak over serial, you will want to connect the GND of your USB-Serial Adapter to the Oak's GND, RX to TX, TX to RX, and P2 to GND. You can then power the Oak via the on-board MicroUSB slot, or by providing appropriate power to the VIN or VCC pins. This is probably a good time to also ensure that you [[https://​github.com/​digistump/​OakRestore|reset your Oak to factory defaults]] ​or use the below esptool command ​so that it runs your program when you upload via serial (by resetting the bootloader to running the program loaded in slot 0).
  
-//Needs pic of an adapter here, and some more detailed explaination of pin connections//​+<​code>​ 
 +esptool --baud 115200 --port YOUR_COM_PORT write_flash -fs 32m 0x1000 blank.bin 0x101000 blank.bin 0x102000 blank.bin 0x202000 blank.bin 
 +</code>
  
-====== Programming via the Arduino IDE ======+//Needs pic of an adapter here, and some more detailed explanation of pin connections//​
  
-You will need to change your Upload settings in the Arduino IDE (under the Tools menu) from "​Particle OTA" to "​Serial (Expert Use Only - Requires Python)",​ and make sure that the Port settings is set to the right serial port.+====== Programming via the Arduino IDE ======
  
-//​Screenshot?//+{{ :​oak:​tutorials:​arduino_ide_serial_upload_selection.png?100|}} 
 +You will need to change your Upload settings in the Arduino IDE (under the Tools menu) from "​Particle OTA" to "​Serial (Expert Use Only - Requires Python)",​ and make sure that the Port settings is set to the right serial port. Click on the image on the right to see a screenshot demonstrating where these options are. As you can see in the image, I am still in Particle OTA programming mode at the time the screenshot was taken, and the Port menu is dimmed out as a result. It will become available for use once you change to the Serial upload mode.
  
 When you upload your program to your Oak, you should see a message in the compile/​upload log at the bottom of the Arduino IDE displaying the following message. If you scroll that view, you should see the percentage increasing as the program is being transferred to your Oak.  When you upload your program to your Oak, you should see a message in the compile/​upload log at the bottom of the Arduino IDE displaying the following message. If you scroll that view, you should see the percentage increasing as the program is being transferred to your Oak. 
Line 63: Line 66:
  
 ====== Troubleshooting ====== ====== Troubleshooting ======
 +===== Failed to connect to ESP8266 =====
  
 Failing to power, connect the serial TX & RX pins, or ground the P2 pin can result in the following error message. Failing to power, connect the serial TX & RX pins, or ground the P2 pin can result in the following error message.
Line 72: Line 76:
 </​code>​ </​code>​
  
-If you code doesn'​t ​run... have you run OakRestore so that the Oak knows to run the program loaded in slot 0, which is where serial uploaded programs always go?+===== Program ​doesn'​t ​seem to be running =====
  
 +If your upload appears to be successful, and your code doesn'​t appear to be running, this is usually due to having not run OakRestore, and the Oak bootloader not knowing to run the program loaded in slot 0. Serial uploads always load to slot 0, but OTA updates load into slots 1 and 2, and the bootloader is probably trying to run programs from those slots, instead of your new serial uploaded program. Follow the [[https://​github.com/​digistump/​OakRestore|steps to reset your Oak to factory defaults]], and all should be good.
oak/tutorials/serialfirmware.1457856068.txt.gz · Last modified: 2016/03/13 00:01 by pfeerick