ESP8266: Timed out waiting for packet header - arduino-uno

Hi somebody who can link an beginners guide for ESP 8266 on arduino uno? Or help me with this error :
Arduino:1.8.9 (Windows 10), Kort:"Generic ESP8266 Module, 80 MHz,
Flash, Legacy (new can return nullptr), All SSL ciphers (most
compatible), dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 4MB
(FS:3MB OTA:~512KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory,
Disabled, None, Only Sketch, 115200"
Executable segment sizes:
IROM : 227372 - code in flash (default or
ICACHE_FLASH_ATTR)
IRAM : 26368 / 32768 - code in IRAM (ICACHE_RAM_ATTR,
ISRs...)
DATA : 1252 ) - initialized variables (global, static) in
RAM/HEAP
RODATA : 672 ) / 81920 - constants (global, static) in
RAM/HEAP
BSS : 24848 ) - zeroed variables (global, static) in
RAM/HEAP
Sketch uses 255664 bytes (24%) of program storage space. Maximum is
1044464 bytes. Global variables use 26772 bytes (32%) of dynamic
memory, leaving 55148 bytes for local variables. Maximum is 81920
bytes. esptool.py v2.8 Serial port COM3
Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last): File
"C:\Users\Elev\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3/tools/upload.py",
line 65, in
esptool.main(cmdline) File "C:/Users/Elev/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py",
line 2890, in main
esp.connect(args.before) File "C:/Users/Elev/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py",
line 483, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error)) esptool.FatalError: Failed to connect to ESP8266: Timed
out waiting for packet header esptool.FatalError: Failed to connect to
ESP8266: Timed out waiting for packet header
_
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

If still. facing the issue try these settings
To Program Using Arduino Nano
Pin setup in nano:
Connect Nano GND pin to RST pin (ground to reset)
Pin setup in ESP-01
Connect GND to GPIO-0 (Initiates programming mode)
Connect VCC to CH_PD/CH_EN (Power pin to Chip Enable)
Pin setup between nano and ESP-01
Nano to ESP-01
Connect the VCC to VCC and CH_PD/CH_EN
Connect GND to GND and GPIO-0
Connect Tx to Tx
Connect Rx to Rx

Related

ROM doesn't load U-Boot on imx6solo

I'm trying to upgrade my u-boot from 2009 to 2020 using buildroot, but when I build the new one it doesn't boot (and I don't have JTAG).
When I load it with imx_usb_loader it works but when I flash it on the Nand, it doesn't boot on it.
As u-boot files, I use mx6sabreauto.c, mx6solo.cfg and mx6sabreauto.h
I don't use SPL or DTS, I only generate u-boot.imx
Boot logs with imx_usb_loader :
U-Boot 2020.04 (Feb 11 2023 - 15:41:38 +0100)
CPU: i.MX6SOLO rev1.3 at 792MHz
CPU: Industrial temperature grade (-40C to 105C) at 50C
Reset cause: POR
Model: i.MX6 DualLite/Solo SABRE Automotive Board
Board: MX6Q-Sabreauto rev#
DRAM: 2 GiB
NAND: nand_base: device found, Manufacturer ID: 0x2c, Chip ID: 0xd3
nand_base: Micron NAND 1GiB 3,3V 8-bit
nand_base: Micron NAND 1GiB 3,3V 8-bit
nand_base: 1024 MiB, SLC, erase size: 256 KiB, page size: 4096, OOB size: 128
use legacy bch geometry
1024 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 2
Loading Environment from MMC... MMC: no card present
mmc_init: -123, time 2
Warning - No block device, using default environment
Loading Environment from NAND... Scanning device for bad blocks
Warning - bad CRC, using default environment
No panel detected: default to Hannstar-XGA
Display: Hannstar-XGA (1024x768)
In: serial
Out: serial
Err: serial
Net: FEC [PRIME]
Warning: FEC (eth0) using random MAC address - ea:37:e5:51:c1:86
Boot from USB for mfgtools
Warning - Use default environment for
using default environment
Hit any key to stop autoboot: 0
Flash logs :
=> nand erase 0x0 0x40000000
NAND erase: device 0 whole chip
Erasing at 0x3ffc0000 -- 100% complete.
OK
=> tftp 0x10800000 u-boot.imx
Using FEC device
TFTP from server 192.168.30.30; our IP address is 192.168.30.10
Filename 'u-boot.imx'.
Load address: 0x10800000
Loading: #####################################################
3.9 MiB/s
done
Bytes transferred = 777216 (bdc00 hex)
=> nand read 0x10800000 0x00000000 777216
NAND read: device 0 offset 0x0, size 0x777216
7827990 bytes read: OK
=> reset
resetting ...
It worked when I flashed from the Linux rootfs using these commands :
$ flash_erase /dev/mtd0 0 0
$ kobs-ng init -x u-boot.imx --search_exponent=1 -v
It seems that the "search-exponent" option did the trick.

ESP32 WROVER-B programming issue

trying to program ESP32-WROVER-B it stops just after start, I have connected button EN (on pin EN) and tried various combinations but it didn't help.
Also tried to change baudrate, fix flash size to 4MB but still nothing.
This is the output:
$ make -j4 flash monitor
Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a5
Compiler version: 5.2.0
App "websocket_server" version: b4b6984-dirty
Python requirements from C:/ESP32/esp-idf/requirements.txt are satisfied.
Flashing binaries to serial port COM8 (app at offset 0x10000)...
esptool.py v2.6-beta1
Serial port COM8
Connecting........_____..
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 24:6f:28:4c:9b:4c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 230400
Changed.
Configuring flash size...
Compressed 24240 bytes to 14517...
Wrote 24240 bytes (14517 compressed) at 0x00001000 in 0.7 seconds (effective 295.4 kbit/s)...
A fatal error occurred: Timed out waiting for packet header
make: *** [/c/ESP32/esp-idf/components/esptool_py/Makefile.projbuild:63: flash] Error 2
Any hint?
In case your ESP32 looks like this one you need to keep pressed the RST button while uploading the new code to avoid that error.
Hope this helps you!

I2C driver changes to recognize multiple buses

We have defined the analog videoIn adv7180 metadata hardware definition in the i2c2 node in one iMX device tree file. The ultimate aim is to recognize adv7180 driver from the i2c2 bus.
During the boot process of the processor using the linux image made with defconfig changes for I2C, the second I2C bus is not getting recognized.
Given below are the serial console print statements:
U-Boot 2015.10+fslc+g1b6aee7 (Jan 16 2018 - 14:57:01 +0530)
CPU: Freescale i.MX6Q rev1.2 996 MHz (running at 792 MHz)
CPU: Automotive temperature grade (-40C to 125C) at 26C
Reset cause: POR
Board: MX6-SabreSD
I2C: ready
Line 129: i2c i2c-1: IMX I2C adapter registered //i2c-2 not registered??
Line 272 onwards: i2c /dev entries driver
IR NEC protocol handler initialized
IR RC5(x) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR RC5 (streamzap) protocol handler initialized
IR SANYO protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
mxc_v4l2_output v4l2_out.28: V4L2 device registered as video16
mxc_v4l2_output v4l2_out.28: V4L2 device registered as video17
i2c-core: driver [mag3110] using legacy suspend method
i2c-core: driver [mag3110] using legacy resume method
I have written these extra lines in defconfig files in the source directory of my Yocto Built.
CONFIG_IMX_HAVE_PLATFORM_IMX_I2C=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_IMX=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX=y
I have also check Kconfig files and seen that i2c driver is passed from the kernel-source directory in the built.
Do I have to make modifications to the C-files (driver files) made in the path /home/fsl-community-bsp-myproject/build/tmp/work-shared/imx6qonlinepdd/kernel-source/drivers/i2c of my yocto built?
There is even a C file for adv7180 in the sub-directory /drivers/media , can it be modified?
you should look in the device tree you're using if i2c bus 2 is enabled.
You need to add the folowing line in your dts :
&i2c2 { // Change the name as needed
status = "okay";
pinctrl-names = "default";
}
You've probably status = "disabled"; in the i2c node you're seeking.
EDIT:
At first glance provided dts (https://pastebin.com/Y0esXmaX) seems ok. In order to debug further, one shall look into /dev/ directory in order to find the i2c bus.
As an example :
root#pico-imx8mq:~# ls /dev/*i2c*
/dev/i2c-0 /dev/i2c-1 /dev/i2c-2
This means I have 3 i2c bus and I can find them all on my dts. If you don't have the bus there you probably do have a dts problem.
dmesg | grep i2c might also give some hints.
You can also use i2cdetect from i2ctools package :
root#pico-imx8mq:~# i2cdetect -y 0 ## that will detect devices on first i2c bus
root#pico-imx8mq:~# i2cdetect -y 1 ## that will detect devices on second i2c bus
root#pico-imx8mq:~# i2cdetect -y 2 ## that will detect devices on third i2c bus

Arduino changes COM port when uploading code (Windows)

I'm testing the new MKR1000 in Windows. I'm having an annoying issue that causes Windows to re-install the Arduino drivers in another port every time I upload new code into the board. E.g.:
If the Arduino is installed on COM4, when I upload code into the board Windows decides to install Arduino on COM5. This causes the IDE to tell me that the upload procedure failed (as there is no Arduino connected on COM5), but strangely enough, the code actually uploads correctly.
If I want to open the Serial monitor I need to go in the IDE and change the Arduino port back to COM4. It's super annoying to have Windows go through the driver installation procedure every time I upload new code into Arduino.
Some generic information:
This happens in both Windows 7 & 8
I'm troubleshooting with the Blink example (pin 6)
The problems happens with both the Arduino IDE (1.6.11) & Arduino Create (1.0.38)
The MKR1000 is correctly installed in Windows, showing up in the Device Manager as 'Arduino MKR1000 (COM4)'
SAMD Board 1.6.6 is installed
Tried multiple USB cables
The error in the Arduino IDE is:
Arduino: 1.6.11 (Windows 7), Board: "Arduino/Genuino MKR1000"
Sketch uses 7,972 bytes (3%) of program storage space. Maximum is 262,144 bytes.
Forcing reset using 1200bps open/close on port COM4
PORTS {COM3, COM4, } / {COM3, } => {}
PORTS {COM3, } / {COM3, } => {}
PORTS {COM3, } / {COM3, } => {}
PORTS {COM3, } / {COM3, COM5, } => {COM5, }
Found upload port: COM5
C:\Users\40009929\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino/bossac.exe -i -d --port=COM5 -U true -i -e -w -v C:\Users\40009929\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.ino.bin -R
Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Nov 24 2015 11:35:16
chipId=0x10010005
Connected at 921600 baud
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Atmel SMART device 0x10010005 found
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x10)
writeWord(addr=0x20004020,value=0x20008000)
Device : ATSAMD21G18A
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Chip ID : 10010005
version()=v2.0 [Arduino:XYZ] Nov 24 2015 11:35:16
Version : v2.0 [Arduino:XYZ] Nov 24 2015 11:35:16
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
none
readWord(addr=0x41004018)=0
Security : false
Boot Flash : true
readWord(addr=0x40000834)=0x7000a
BOD : true
readWord(addr=0x40000834)=0x7000a
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
chipErase(addr=0x2000)
done in 0.823 seconds
Write 8124 bytes to flash (127 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)
SAM-BA operation failed
An error occurred while uploading the sketch
[=============== ] 50% (64/127 pages)write(addr=0x20005000,size=0xfc0)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0xfc0)
[==============================] 100% (127/127 pages)
done in 0.051 seconds
Verify 8124 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = 7923
checksumBuffer(start_addr=0x3000, size=0xfbc) = b6c0
Verify successful
done in 0.010 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)
In Arduino Create the problem is the same:
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] Nov 24 2015 11:35:16
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : true
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.822 seconds
Write 8116 bytes to flash (127 pages)
[=============== ] 50% (64/127 pages)
[==============================] 100% (127/127 pages)
done in 0.052 seconds
Verify 8116 bytes of flash with checksum.
Verify successful
done in 0.010 seconds
CPU reset.
SAM-BA operation failed
Could not program the board
Hi based on your output there might be a reason why its doing that.
Other developers can correct me if I am wrong.
When you upload a code to the ATSAMD21,
-->The IDE/development environment used will put the board into bootloader mode for 5seconds. (At 1200bps) //STEP 1
-->But when it uploads the program to the board the bootloader locks after successful upload and changes its port //STEP 2
-->At STEP 1, the micro works as NATIVE USB Port and calls PROGRAMMING USB Port
-->At STEP 2, the micro finishes programming and after reset it goes back to its default state - NATIVE USB Port (this is where your COM port changes to the next port).
-->If you observe carefully when you open hyperterm and open the connected Arduino port (say COM4 for example) at 1200bps in 5sec, in your device manager you will notice a USB Serial Device in place of your Arduino MKR board.
Hope it helps.
Yeah I had the same problem too. Try to download arduino advance ide (enhanced release).
Here
This should help because when it does changes port it will tell you and ask you if you do want to.
Hope it helped!
Here is my fix for SAM-BA operation failed.
Situation
Windows 7 with USB3 port (previously worked on Windows 7 machine with only USB2 ports)
Uploading to Sparkfun Redboard Turbo
Put a USB 2 hub between the PC and the board.
SAM-BA error no longer occurres

AT91SAM9263ek booting Linux with Device Tree failed

I have problem booting Linux 3.16.1. I have compiled sources from http://www.kernel.org with at91sam9263_defconfig.
I have added Flattened Device Tree support in Boot options.
Followin tips suggested in this (https://www.slideshare.net/softpapa/device-tree-support-on-arm-linux-8930303) presentation to turn on Support device tree in /proc but i don't have that option in menuconfig.
I have U-Boot bootloader version 2014.10rc2 which supports device tree.
I have generated dtb from script shipped with kernel:
make at91sam9263ek.dtb
And now i'm getting this error:
Welcome to minicom 2.5
OPTIONS: I18n
Compiled on Feb 9 2011, 14:45:00.
Port /dev/ttyS0
Press CTRL-A Z for help on special keys
RomBOOT
>
U-Boot 2014.10-rc2-00200-g9170818-dirty (Sep 23 2014 - 15:16:39)
CPU: AT91SAM9263
Crystal frequency: 16.368 MHz
CPU clock : 199.919 MHz
Master clock : 99.960 MHz
DRAM: 64 MiB
WARNING: Caches not enabled
NAND: 256 MiB
MMC: mci: 0
In: serial
Out: serial
Err: serial
Net: macb0
Warning: Your board does not use generic board. Please read
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed.
Hit any key to stop autoboot: 0
U-Boot> tftp uImage
macb0: Starting autonegotiation...
macb0: Autonegotiation complete
macb0: link up, 100Mbps full-duplex (lpa: 0xcde1)
Using macb0 device
TFTP from server 192.168.1.247; our IP address is 192.168.1.240
Filename 'uImage'.
Load address: 0x22000000
Loading: #################################################################
#################################################################
#################################################################
##############
1.2 MiB/s
done
Bytes transferred = 3068016 (2ed070 hex)
U-Boot> tftp 20000000 dt
macb0: link up, 100Mbps full-duplex (lpa: 0xcde1)
Using macb0 device
TFTP from server 192.168.1.247; our IP address is 192.168.1.240
Filename 'dt'.
Load address: 0x20000000
Loading: #
340.8 KiB/s
done
Bytes transferred = 13279 (33df hex)
U-Boot> bootm 22000000 - 20000000
## Booting kernel from Legacy Image at 22000000 ...
Image Name: Linux-3.16.1
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3067952 Bytes = 2.9 MiB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 20000000
Booting using the fdt blob at 0x20000000
Loading Kernel Image ... OK
Loading Device Tree to 23ea3000, end 23ea93de ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Error: unrecognized/unsupported device tree compatible list:
[ 'atmel,at91sam9263ek' 'atmel,at91sam9263' 'atmel,at91sam9' ]
Available machine support:
ID (hex) NAME
000004b2 Atmel AT91SAM9263-EK
Please check your kernel config and/or bootloader.
Solution:
Add this line to .config:
CONFIG_MACH_AT91SAM9_DT=y
The correct configuration for this board when using device tree is at91_dt_defconfig.
However, I am quite surprised to see someone trying to use such an old kernel. This board is fully supported upstream. Why don't you use v5.3? If this doesn't work, please report any bug, we will be happy to help correct them.

Resources