Skip to content

Instantly share code, notes, and snippets.

@amirgon
amirgon / README.md
Last active October 29, 2015 21:58
ESP8266 Deveopment on Linux VirtualBox

Backgroud

I'll summarize the list of steps I've taken to prepare a Linux VirtualBox on Windows as a development environment for ESP8266 . Prerequisites

  • Laptop with Windows (mine with with Windows 8.1)
  • ESP-12 module, this with it's "IO adapter plate Expansion" can fit nicely on two connected breadboards
  • Any USB to Serial / TTL Converter, like this one.
  • I'm not going to cover ESP wiring in this wirting.

List of plugins

Consider adding to .vimrc:

  • Automatically set :make directory as current buffer dir or the one above it:
    let &makeprg = 'if [ -f Makefile ]; then make -C %:p:h $*; else make -C %:p:h/.. $*; fi'
<!DOCTYPE html>
<!-- saved from url=(0083)http://10.185.6.78:8000/settings/QA_SITE_SETTINGS/#id_QA_SITE_SETTINGS__APP_URL__en -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="robots" content="NONE,NOARCHIVE"> <title>AttributeError at /settings/QA_SITE_SETTINGS/</title> <style type="text/css">
html * { padding:0; margin:0; }
body * { padding:10px 20px; }
body * * { padding:0; }
body { font:small sans-serif; }
body>div { border-bottom:1px solid #ddd; }
h1 { font-weight:normal; }
h2 { margin-bottom:.8em; }
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="robots" content="NONE,NOARCHIVE"> <title>ProgrammingError at /questions/scope:all/sort:activity-desc/page:1/query:asd/</title> <style type="text/css">
html * { padding:0; margin:0; }
body * { padding:10px 20px; }
body * * { padding:0; }
body { font:small sans-serif; }
body>div { border-bottom:1px solid #ddd; }
h1 { font-weight:normal; }
h2 { margin-bottom:.8em; }
@amirgon
amirgon / parse_map.awk
Last active April 11, 2019 05:49
Analyze object file sizes in memory map
# Parse ELF map file memory map
#
# Collect all files from memory map and sum the size of each object file.
# Print summary information for each file from large to small.
# File paths can be filtered by EXCLUDE and INCLUDE patterns
# Sections can be filtered by INCLUDE_SECTION and EXCLUDE_SECTION patterns.
#
# Handle two cases:
# 1. Symbol name is short and appears in the same line as the file name
# 2. Symbol name is long so it appears one line before the file name
@amirgon
amirgon / advanced_demo.py
Last active June 5, 2019 22:37
advanced_demo.py for online simulator (lvgl v5.3)
import lvgl as lv
# lvgl must be initialized before any lvgl function is called or object/struct is constructed!
lv.init()
# Create a style based on style_plain but with a symbol font
symbolstyle = lv.style_t(lv.style_plain)
symbolstyle.text.font = lv.font_symbol_40
# init
import lvgl as lv
lv.init()
import SDL
SDL.init()
# Register SDL display driver.
# init
import lvgl as lv
lv.init()
import SDL
SDL.init()
# Register SDL display driver.

Parsing stack trace

xtensa-esp32-elf-addr2line -aipfC -e ports/esp32/build/application.elf <stack-trace (pairs of hex:hex)
def init_drv():
import SDL
SDL.init()
# Register SDL display driver.
disp_buf1 = lv.disp_buf_t()
buf1_1 = bytes(480*10)
lv.disp_buf_init(disp_buf1,buf1_1, None, len(buf1_1)//4)
disp_drv = lv.disp_drv_t()