[solved] One upload, I am fine, the next upload, not so well

idahowalker
Posts: 166
Joined: Wed Aug 01, 2018 12:06 pm

[solved] One upload, I am fine, the next upload, not so well

Postby idahowalker » Thu Mar 28, 2019 4:52 pm

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default, 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Debug"

Sketch uses 193616 bytes (14%) of program storage space. Maximum is 1310720 bytes.
Global variables use 12768 bytes (3%) of dynamic memory, leaving 314912 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6-beta1
Serial port COM4
Connecting........___
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 30:ae:a4:fe:00:ec
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 780.2 kbit/s)...
Hash of data verified.
Compressed 17664 bytes to 11528...

Writing at 0x00001000... (100 %)
Wrote 17664 bytes (11528 compressed) at 0x00001000 in 0.2 seconds (effective 651.2 kbit/s)...
Hash of data verified.
Compressed 193776 bytes to 96041...

Writing at 0x00010000... (16 %)
Writing at 0x00014000... (33 %)
Writing at 0x00018000... (50 %)
Writing at 0x0001c000... (66 %)
Writing at 0x00020000... (83 %)
Writing at 0x00024000... (100 %)
Wrote 193776 bytes (96041 compressed) at 0x00010000 in 1.6 seconds (effective 951.6 kbit/s)...
File md5: 597c1d7998c435aef451084750589ef5
Flash md5: a2108da8fb2aba742e4a2df9ca8304b8
MD5 of 0xFF is 516cfd990a85d4f063cb345cd85dcb18

A fatal error occurred: MD5 of file does not match data in flash!
A fatal error occurred: MD5 of file does not match data in flash!
The code I am trying to upload, after the 3rd failure:

Code: Select all

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}
The code I uploaded to cause the failure

Code: Select all


#include <driver/spi_master.h>
#include "esp_system.h" //This inclusion configures the peripherals in the ESP system.
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/timers.h"
#include "freertos/event_groups.h"
#include "sdkconfig.h"
////////////////////////////////////////////////////
#define TaskCore1 1
#define TaskCore0 0
#define SerialDataBits 115200
#define csPinAG 15
#define csPinM 15
#define spiCLK 14 // CLK
#define spiMOSI 13 // MOSI
#define spiMISO 12 // MISO
#define TaskStack30K 30000
#define Priority4 4




void setup()
{
  Serial.begin( SerialDataBits );
  xTaskCreatePinnedToCore ( fGetIMU, "v_getIMU", TaskStack30K, NULL, Priority4, NULL, TaskCore0 );

}

void loop() {}

void fGetIMU( void *pvParameters )
{

  spi_bus_config_t bus_config;
  bus_config.sclk_io_num = spiCLK; // CLK
  bus_config.mosi_io_num = spiMISO; // MOSI
  bus_config.miso_io_num = spiMISO; // MISO
  bus_config.quadwp_io_num = -1; // Not used
  bus_config.quadhd_io_num = -1; // Not used
  Serial.println("... Initializing bus.");

  spi_device_handle_t handle;
  spi_device_interface_config_t dev_config;
  dev_config.address_bits     = 0;
  dev_config.command_bits     = 0;
  dev_config.dummy_bits       = 0;
  dev_config.mode             = 0;
  dev_config.duty_cycle_pos   = 0;
  dev_config.cs_ena_posttrans = 0;
  dev_config.cs_ena_pretrans  = 0;
  dev_config.clock_speed_hz   = 10000;
  dev_config.spics_io_num     = csPinAG;
  dev_config.flags            = 0;
  dev_config.queue_size       = 1;
  dev_config.pre_cb           = NULL;
  dev_config.post_cb          = NULL;
  Serial.println("... Adding device bus.");
  ESP_ERROR_CHECK(spi_bus_add_device(HSPI_HOST, &dev_config, &handle))
  ESP_ERROR_CHECK(spi_bus_initialize(HSPI_HOST, &bus_config, 1));
  ////
//  char data[3];
//  spi_transaction_t trans_desc;
//  trans_desc.address   = 0;
//  trans_desc.command   = 0;
//  trans_desc.flags     = 0;
//  trans_desc.length    = 3 * 8;
//  trans_desc.rxlength  = 0;
//  trans_desc.tx_buffer = data;
//  trans_desc.rx_buffer = data;
//  data[0] = 0x12;
//  data[1] = 0x34;
//  data[2] = 0x56;
//  Serial.println("... Transmitting.");
//  ESP_ERROR_CHECK(spi_device_transmit(handle, &trans_desc));



  TickType_t xLastWakeTime;
  const TickType_t xFrequency = pdMS_TO_TICKS( 1000 );
  // Initialise the xLastWakeTime variable with the current time.
  xLastWakeTime = xTaskGetTickCount();

  while (1)
  {
    vTaskDelayUntil( &xLastWakeTime, xFrequency );
Serial.println ( " doing a loop " );


    xLastWakeTime = xTaskGetTickCount();
  }
  vTaskDelete(NULL);
}
I have tried 3 ESP32's, several HSB hubs, and several USB cables. All produce the same error
Any idea on how to fix this?

idahowalker
Posts: 166
Joined: Wed Aug 01, 2018 12:06 pm

Re: [solved] One upload, I am fine, the next upload, not so well

Postby idahowalker » Thu Mar 28, 2019 6:04 pm

In the past I got away with using for SPI, GPIO pins 14, 12, and 13. This time, not the case.

The LSM9DS1, begins outputting data as soon as its able; shortly after power up. Using those above pins, I am suspecting GPIO 12; a.k.a. TDI, as I used that for MISO, the LSM9DS1 began outputting a data stream which caused the error.

Thanks for having a place for me to do a bit of freak out.

Wooo-saaaaa.

Who is online

Users browsing this forum: No registered users and 55 guests