Day: March 22, 2023

Installing python on Ubuntu

Very easy after you installed the drivers as I explained here:
https://acassis.wordpress.com/2023/02/14/getting-started-to-cuda/

$ pip install torch

Testing it:

$ python
>>> import torch
>>> use_cuda = torch.cuda.is_available()
>>> if use_cuda:
...     print('__CUDNN VERSION:', torch.backends.cudnn.version())
...     print('__Number CUDA Devices:', torch.cuda.device_count())
...     print('__CUDA Device Name:',torch.cuda.get_device_name(0))
...     print('__CUDA Device Total Memory [GB]:',torch.cuda.get_device_properties(0).total_memory/1e9)
... 
__CUDNN VERSION: 8500
__Number CUDA Devices: 1
__CUDA Device Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU
__CUDA Device Total Memory [GB]: 4.094164992
>>>

Bingo! We have CUDA support!!!

Testing AI-Thinker ESP32 Audio Kit V2.2 A247



This is the output of serial port (/dev/ttyUSB0) after pressing RST button:

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6792
load:0x40078000,len:12072
load:0x40080400,len:6708
entry 0x40080778
I (75) boot: Chip Revision: 3
I (75) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (40) boot: ESP-IDF v3.3.2-107-g722043f73-dirty 2nd stage bootloader
I (40) boot: compile time 11:08:03
I (41) boot: Enabling RNG early entropy source...                               
I (46) boot: SPI Speed      : 40MHz                                             
I (51) boot: SPI Mode       : DOUT                                              
I (55) boot: SPI Flash Size : 4MB                                               
I (59) boot: Partition Table:                                                   
I (62) boot: ## Label            Usage          Type ST Offset   Length         
I (70) boot:  0 nvs              WiFi data        01 02 00009000 00006000       
I (77) boot:  1 phy_init         RF data          01 01 0000f000 00001000       
I (85) boot:  2 factory          factory app      00 00 00010000 00100000       
I (92) boot: End of partition table                                             
I (96) boot_comm: chip revision: 3, min. application chip revision: 0           
I (103) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x1f670 (1p
I (159) esp_image: segment 1: paddr=0x0002f698 vaddr=0x3ffb0000 size=0x00978 ( d
I (160) esp_image: segment 2: paddr=0x00030018 vaddr=0x400d0018 size=0x22788 (1p
I (217) esp_image: segment 3: paddr=0x000527a8 vaddr=0x3ffb0978 size=0x014f8 ( d
I (220) esp_image: segment 4: paddr=0x00053ca8 vaddr=0x40080000 size=0x00400 ( d
I (224) esp_image: segment 5: paddr=0x000540b0 vaddr=0x40080400 size=0x0a190 ( d
I (257) boot: Loaded app from partition at offset 0x10000                       
I (257) boot: Disabling RNG early entropy source...                             
                                                                                
################################################                                
arch:ESP32, 3                                                                   
compile_time:Ai-Thinker|B&T                                                     
ble_mac:b8D61A59XXXX                                                            
wifi_mac:b8D61A59XXXX                                                           
sdk_version:v3.3.2-107-g722043f73-dirty                                         
firmware_version: v1.1.0                                                        
compile_time:Jun  8 2021 11:08:16                                               
################################################

How to copy (dump) flash memory of the ESP32

I use this command to dump the entire flash memory of my ESP32-Devkitc:

$ esptool.py --chip esp32 --port "/dev/ttyUSB0" --baud 921600 read_flash 0 0x400000 esp32_devkit_dump.bin
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: b8:d6:1a:59:ab:60
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
4194304 (100 %)
4194304 (100 %)
Read 4194304 bytes at 0x0 in 51.9 seconds (646.5 kbit/s)...
Hard resetting via RTS pin...