├── .babelrc ├── .electron-vue ├── build.js ├── dev-client.js ├── dev-runner.js ├── webpack.main.config.js ├── webpack.renderer.config.js └── webpack.web.config.js ├── .eslintignore ├── .eslintrc.js ├── .github └── dependabot.yml ├── .gitignore ├── LICENSE ├── README.md ├── build ├── entitlements.mac.plist └── entitlements.mas.plist ├── electron-builder.yaml ├── esp32-firmware-manufacturing-process.png ├── esp32-flash-tool.png ├── jsconfig.json ├── package-lock.json ├── package.json ├── src ├── index.ejs ├── main │ ├── copy_default_assets.js │ ├── flash_image.js │ ├── index.dev.js │ ├── index.js │ ├── scan_serial_ports.js │ └── unzip_image.js └── renderer │ ├── ESPFirmwareApp.vue │ ├── assets │ ├── fonts │ │ ├── Avenir-Book.woff │ │ ├── Avenir-Heavy.woff │ │ ├── Avenir-Light.woff │ │ ├── Avenir-Medium.woff │ │ └── Avenir-Roman.woff │ └── images │ │ └── background.png │ ├── components │ ├── AppFooter.vue │ ├── AppHeader.vue │ ├── AppLayout.vue │ ├── AppNav.vue │ ├── BaseFile.vue │ └── _globals.js │ ├── design │ ├── _colors.scss │ ├── _durations.scss │ ├── _fonts.scss │ ├── _layers.scss │ ├── _sizes.scss │ ├── _typography.scss │ └── index.scss │ ├── filters.js │ ├── i18n │ ├── en.js │ └── ja.js │ ├── main.js │ ├── plugins │ ├── bootstrap.js │ ├── i18n.js │ ├── router.js │ └── store.js │ └── views │ ├── Home.vue │ └── Setting.vue ├── static ├── .gitkeep ├── esptool │ ├── .github │ │ ├── ISSUE_TEMPLATE │ │ │ ├── bug-report-no-hw.yml │ │ │ ├── config.yml │ │ │ ├── feature-request.yml │ │ │ └── issue-with-hw.yml │ │ ├── pull_request_template.md │ │ └── workflows │ │ │ ├── build_esptool.yml │ │ │ ├── issue_comment.yml │ │ │ ├── new_issues.yml │ │ │ ├── new_prs.yml │ │ │ ├── release_esptool_pypi.yml │ │ │ └── test_esptool.yml │ ├── .gitignore │ ├── .gitlab-ci.yml │ ├── CONTRIBUTING.rst │ ├── LICENSE │ ├── MANIFEST.in │ ├── README.md │ ├── build_tools │ │ ├── Sign-File.ps1 │ │ └── espressif.ico │ ├── docs │ │ ├── README.md │ │ ├── _static │ │ │ └── esptool_versions.js │ │ ├── conf_common.py │ │ ├── en │ │ │ ├── about.rst │ │ │ ├── advanced-topics │ │ │ │ ├── boot-mode-selection.rst │ │ │ │ ├── firmware-image-format.rst │ │ │ │ ├── index.rst │ │ │ │ ├── serial-protocol.rst │ │ │ │ └── spi-flash-modes.rst │ │ │ ├── conf.py │ │ │ ├── contributing.rst │ │ │ ├── espefuse │ │ │ │ └── index.rst │ │ │ ├── espsecure │ │ │ │ └── index.rst │ │ │ ├── esptool │ │ │ │ ├── advanced-commands.rst │ │ │ │ ├── advanced-options.rst │ │ │ │ ├── basic-commands.rst │ │ │ │ ├── basic-options.rst │ │ │ │ ├── entering-bootloader.rst │ │ │ │ ├── flash-modes.rst │ │ │ │ ├── flasher-stub.rst │ │ │ │ ├── flashing-firmware.rst │ │ │ │ ├── index.rst │ │ │ │ ├── remote-serial-ports.rst │ │ │ │ ├── scripting.rst │ │ │ │ └── serial-connection.rst │ │ │ ├── index.rst │ │ │ ├── installation.rst │ │ │ └── troubleshooting.rst │ │ ├── requirements.txt │ │ └── utils.sh │ ├── esp_rfc2217_server.py │ ├── espefuse.py │ ├── espressif │ │ ├── __init__.py │ │ └── efuse │ │ │ ├── __init__.py │ │ │ ├── base_fields.py │ │ │ ├── base_operations.py │ │ │ ├── emulate_efuse_controller_base.py │ │ │ ├── esp32 │ │ │ ├── __init__.py │ │ │ ├── emulate_efuse_controller.py │ │ │ ├── fields.py │ │ │ ├── mem_definition.py │ │ │ └── operations.py │ │ │ ├── esp32c3 │ │ │ ├── __init__.py │ │ │ ├── emulate_efuse_controller.py │ │ │ ├── fields.py │ │ │ ├── mem_definition.py │ │ │ └── operations.py │ │ │ ├── esp32h2beta1 │ │ │ ├── __init__.py │ │ │ ├── emulate_efuse_controller.py │ │ │ ├── fields.py │ │ │ ├── mem_definition.py │ │ │ └── operations.py │ │ │ ├── esp32s2 │ │ │ ├── __init__.py │ │ │ ├── emulate_efuse_controller.py │ │ │ ├── fields.py │ │ │ ├── mem_definition.py │ │ │ └── operations.py │ │ │ ├── esp32s3 │ │ │ ├── __init__.py │ │ │ ├── emulate_efuse_controller.py │ │ │ ├── fields.py │ │ │ ├── mem_definition.py │ │ │ └── operations.py │ │ │ ├── esp32s3beta2 │ │ │ ├── __init__.py │ │ │ ├── emulate_efuse_controller.py │ │ │ ├── fields.py │ │ │ ├── mem_definition.py │ │ │ └── operations.py │ │ │ ├── mem_definition_base.py │ │ │ └── util.py │ ├── espsecure.py │ ├── esptool.py │ ├── flasher_stub │ │ ├── Makefile │ │ ├── README.md │ │ ├── compare_stubs.py │ │ ├── esptool_test_stub.py │ │ ├── include │ │ │ ├── miniz.h │ │ │ ├── rom_functions.h │ │ │ ├── slip.h │ │ │ ├── soc_support.h │ │ │ ├── stub_commands.h │ │ │ ├── stub_flasher.h │ │ │ ├── stub_io.h │ │ │ └── stub_write_flash.h │ │ ├── ld │ │ │ ├── rom_32.ld │ │ │ ├── rom_32c2.ld │ │ │ ├── rom_32c3.ld │ │ │ ├── rom_32c6_beta.ld │ │ │ ├── rom_32h2_beta_1.ld │ │ │ ├── rom_32h2_beta_2.ld │ │ │ ├── rom_32s2.ld │ │ │ ├── rom_32s3.ld │ │ │ ├── rom_32s3_beta_2.ld │ │ │ ├── rom_8266.ld │ │ │ ├── stub_32.ld │ │ │ ├── stub_32c2.ld │ │ │ ├── stub_32c3.ld │ │ │ ├── stub_32c6_beta.ld │ │ │ ├── stub_32h2_beta_1.ld │ │ │ ├── stub_32h2_beta_2.ld │ │ │ ├── stub_32s2.ld │ │ │ ├── stub_32s3.ld │ │ │ ├── stub_32s3_beta_2.ld │ │ │ └── stub_8266.ld │ │ ├── miniz.c │ │ ├── run_tests_with_stub.sh │ │ ├── slip.c │ │ ├── stub_commands.c │ │ ├── stub_flasher.c │ │ ├── stub_io.c │ │ ├── stub_write_flash.c │ │ └── wrap_stub.py │ ├── setup.cfg │ ├── setup.py │ └── test │ │ ├── .covconf │ │ ├── README.md │ │ ├── ci │ │ ├── multirun_with_pyenv.sh │ │ └── setup_ci_build_env.sh │ │ ├── ecdsa_secure_boot_signing_key2.pem │ │ ├── efuse_scripts │ │ ├── efuse_burn1.py │ │ ├── efuse_burn2.py │ │ ├── esp32 │ │ │ ├── config1.json │ │ │ ├── config2.json │ │ │ ├── test_efuse_script.py │ │ │ └── test_efuse_script2.py │ │ └── esp32xx │ │ │ ├── config1.json │ │ │ ├── config2.json │ │ │ ├── test_efuse_script.py │ │ │ └── test_efuse_script2.py │ │ ├── elf2image │ │ ├── esp32-app-cust-ver-info.elf │ │ ├── esp32-app-template.elf │ │ ├── esp32-bootloader.elf │ │ ├── esp32-too-many-sections.elf │ │ ├── esp32-too-many-sections │ │ │ └── Makefile │ │ ├── esp32-zephyr.elf │ │ ├── esp8266-nonossdkv12-example.elf │ │ ├── esp8266-nonossdkv20-at-v2.elf │ │ ├── esp8266-nonosssdk20-iotdemo.elf │ │ └── esp8266-openrtos-blink-v2.elf │ │ ├── images │ │ ├── aes_key.bin │ │ ├── bootloader_esp32.bin │ │ ├── bootloader_esp32c3.bin │ │ ├── bootloader_esp32s2.bin │ │ ├── bootloader_esp32s3.bin │ │ ├── bootloader_esp32s3beta2.bin │ │ ├── efuse │ │ │ ├── 128bit │ │ │ ├── 192bit │ │ │ ├── 192bit_1 │ │ │ ├── 192bit_2 │ │ │ ├── 224bit │ │ │ ├── 256bit │ │ │ ├── 256bit_1 │ │ │ ├── 256bit_1_256bit_2_combined │ │ │ └── 256bit_2 │ │ ├── esp8266_deepsleep.bin │ │ ├── esp8266_sdk │ │ │ ├── 4096_user1.bin │ │ │ ├── blank.bin │ │ │ ├── boot_v1.4(b1).bin │ │ │ └── esp_init_data_default.bin │ │ ├── fifty_kb.bin │ │ ├── helloworld-esp32_edit.bin │ │ ├── nodemcu-master-7-modules-2017-01-19-11-10-03-integer.bin │ │ ├── one_kb.bin │ │ ├── one_kb_all_ef.bin │ │ ├── one_mb.bin │ │ ├── onebyte.bin │ │ ├── partitions_singleapp.bin │ │ ├── ram_helloworld │ │ │ ├── helloworld-esp32.bin │ │ │ ├── helloworld-esp32_edit.bin │ │ │ ├── helloworld-esp8266.bin │ │ │ └── source │ │ │ │ ├── Makefile │ │ │ │ ├── ld │ │ │ │ ├── app_32.ld │ │ │ │ ├── app_32c3.ld │ │ │ │ ├── app_32s2.ld │ │ │ │ ├── app_32s3.ld │ │ │ │ └── app_8266.ld │ │ │ │ └── main.c │ │ ├── sector.bin │ │ ├── unaligned.bin │ │ └── zerolength.bin │ │ ├── secure_images │ │ ├── 256bit_iv.bin │ │ ├── 256bit_key.bin │ │ ├── 512bit_key.bin │ │ ├── bootloader-encrypted-aes-xts.bin │ │ ├── bootloader-encrypted-conf0.bin │ │ ├── bootloader-encrypted-conf3.bin │ │ ├── bootloader-encrypted-conf9.bin │ │ ├── bootloader-encrypted-confc.bin │ │ ├── bootloader-encrypted.bin │ │ ├── bootloader.bin │ │ ├── bootloader_digested.bin │ │ ├── bootloader_multi_signed_v2.bin │ │ ├── bootloader_signed.bin │ │ ├── bootloader_signed_v2.bin │ │ ├── bootloader_unsigned_v2.bin │ │ ├── digest_iv.bin │ │ ├── ecdsa_secure_boot_signing_key.pem │ │ ├── ecdsa_secure_boot_signing_key2.pem │ │ ├── ecdsa_secure_boot_signing_key_pkcs8.pem │ │ ├── ecdsa_secure_boot_signing_pubkey.pem │ │ ├── ecdsa_secure_boot_signing_pubkey2.pem │ │ ├── ef-flashencryption-key.bin │ │ ├── hello-world-signed-encrypted-aes-xts-256.bin │ │ ├── hello-world-signed-encrypted-aes-xts.bin │ │ ├── hello-world-signed-encrypted.bin │ │ ├── hello-world-signed.bin │ │ ├── rsa_public_key_digest.bin │ │ ├── rsa_secure_boot_signing_key.pem │ │ ├── rsa_secure_boot_signing_key2.pem │ │ ├── rsa_secure_boot_signing_key3.pem │ │ ├── rsa_secure_boot_signing_key4.pem │ │ ├── rsa_secure_boot_signing_pubkey.pem │ │ ├── rsa_secure_boot_signing_pubkey2.pem │ │ └── rsa_secure_boot_signing_pubkey4.pem │ │ ├── sitecustomize.py │ │ ├── test_espefuse.py │ │ ├── test_espefuse_host.py │ │ ├── test_espsecure.py │ │ ├── test_esptool.py │ │ ├── test_imagegen.py │ │ ├── test_merge_bin.py │ │ └── test_modules.py ├── icons │ ├── icon.icns │ ├── icon.ico │ ├── icon.iconset │ │ ├── icon_128x128.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_16x16.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_256x256.png │ │ ├── icon_256x256@2x.png │ │ ├── icon_32x32.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_512x512.png │ │ ├── icon_512x512@2x.png │ │ └── icon_64x64.png │ └── icon.png └── images │ ├── controller.svg │ ├── esp32-flash-tool.png │ ├── github-brands.svg │ ├── globe-solid.svg │ ├── info.svg │ ├── linkedin-brands.svg │ ├── logo.png │ └── settings.svg └── test ├── .eslintrc └── unit ├── index.js ├── karma.conf.js └── specs └── Home.spec.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "comments": false, 3 | "env": { 4 | "test": { 5 | "presets": [ 6 | ["env", { 7 | "targets": { "node": 8 } 8 | }], 9 | "stage-0" 10 | ], 11 | "plugins": ["istanbul"] 12 | }, 13 | "main": { 14 | "presets": [ 15 | ["env", { 16 | "targets": { "node": 8 } 17 | }], 18 | "stage-0" 19 | ] 20 | }, 21 | "renderer": { 22 | "presets": [ 23 | ["env", { 24 | "modules": false 25 | }], 26 | "stage-0" 27 | ] 28 | }, 29 | "web": { 30 | "presets": [ 31 | ["env", { 32 | "modules": false 33 | }], 34 | "stage-0" 35 | ] 36 | } 37 | }, 38 | "plugins": ["transform-runtime"] 39 | } 40 | -------------------------------------------------------------------------------- /.electron-vue/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | process.env.NODE_ENV = 'production' 4 | 5 | const { say } = require('cfonts') 6 | const chalk = require('chalk') 7 | const del = require('del') 8 | const { spawn } = require('child_process') 9 | const webpack = require('webpack') 10 | const Multispinner = require('multispinner') 11 | 12 | 13 | const mainConfig = require('./webpack.main.config') 14 | const rendererConfig = require('./webpack.renderer.config') 15 | const webConfig = require('./webpack.web.config') 16 | 17 | const doneLog = chalk.bgGreen.white(' DONE ') + ' ' 18 | const errorLog = chalk.bgRed.white(' ERROR ') + ' ' 19 | const okayLog = chalk.bgBlue.white(' OKAY ') + ' ' 20 | const isCI = process.env.CI || false 21 | 22 | if (process.env.BUILD_TARGET === 'clean') clean() 23 | else if (process.env.BUILD_TARGET === 'web') web() 24 | else build() 25 | 26 | function clean () { 27 | del.sync(['build/*', '!build/icons', '!build/icons/icon.*']) 28 | console.log(`\n${doneLog}\n`) 29 | process.exit() 30 | } 31 | 32 | function build () { 33 | greeting() 34 | 35 | del.sync(['dist/electron/*', '!.gitkeep']) 36 | 37 | const tasks = ['main', 'renderer'] 38 | const m = new Multispinner(tasks, { 39 | preText: 'building', 40 | postText: 'process' 41 | }) 42 | 43 | let results = '' 44 | 45 | m.on('success', () => { 46 | process.stdout.write('\x1B[2J\x1B[0f') 47 | console.log(`\n\n${results}`) 48 | console.log(`${okayLog}take it away ${chalk.yellow('`electron-builder`')}\n`) 49 | process.exit() 50 | }) 51 | 52 | pack(mainConfig).then(result => { 53 | results += result + '\n\n' 54 | m.success('main') 55 | }).catch(err => { 56 | m.error('main') 57 | console.log(`\n ${errorLog}failed to build main process`) 58 | console.error(`\n${err}\n`) 59 | process.exit(1) 60 | }) 61 | 62 | pack(rendererConfig).then(result => { 63 | results += result + '\n\n' 64 | m.success('renderer') 65 | }).catch(err => { 66 | m.error('renderer') 67 | console.log(`\n ${errorLog}failed to build renderer process`) 68 | console.error(`\n${err}\n`) 69 | process.exit(1) 70 | }) 71 | } 72 | 73 | function pack (config) { 74 | return new Promise((resolve, reject) => { 75 | config.mode = 'production' 76 | webpack(config, (err, stats) => { 77 | if (err) reject(err.stack || err) 78 | else if (stats.hasErrors()) { 79 | let err = '' 80 | 81 | stats.toString({ 82 | chunks: false, 83 | colors: true 84 | }) 85 | .split(/\r?\n/) 86 | .forEach(line => { 87 | err += ` ${line}\n` 88 | }) 89 | 90 | reject(err) 91 | } else { 92 | resolve(stats.toString({ 93 | chunks: false, 94 | colors: true 95 | })) 96 | } 97 | }) 98 | }) 99 | } 100 | 101 | function web () { 102 | del.sync(['dist/web/*', '!.gitkeep']) 103 | webConfig.mode = 'production' 104 | webpack(webConfig, (err, stats) => { 105 | if (err || stats.hasErrors()) console.log(err) 106 | 107 | console.log(stats.toString({ 108 | chunks: false, 109 | colors: true 110 | })) 111 | 112 | process.exit() 113 | }) 114 | } 115 | 116 | function greeting () { 117 | const cols = process.stdout.columns 118 | let text = '' 119 | 120 | if (cols > 85) text = 'lets-build' 121 | else if (cols > 60) text = 'lets-|build' 122 | else text = false 123 | 124 | if (text && !isCI) { 125 | say(text, { 126 | colors: ['yellow'], 127 | font: 'simple3d', 128 | space: false 129 | }) 130 | } else console.log(chalk.yellow.bold('\n lets-build')) 131 | console.log() 132 | } -------------------------------------------------------------------------------- /.electron-vue/dev-client.js: -------------------------------------------------------------------------------- 1 | const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 2 | 3 | hotClient.subscribe(event => { 4 | /** 5 | * Reload browser when HTMLWebpackPlugin emits a new index.html 6 | * 7 | * Currently disabled until jantimon/html-webpack-plugin#680 is resolved. 8 | * https://github.com/SimulatedGREG/electron-vue/issues/437 9 | * https://github.com/jantimon/html-webpack-plugin/issues/680 10 | */ 11 | // if (event.action === 'reload') { 12 | // window.location.reload() 13 | // } 14 | 15 | /** 16 | * Notify `mainWindow` when `main` process is compiling, 17 | * giving notice for an expected reload of the `electron` process 18 | */ 19 | if (event.action === 'compiling') { 20 | document.body.innerHTML += ` 21 | 34 | 35 |
36 | Compiling Main Process... 37 |
38 | ` 39 | } 40 | }) 41 | -------------------------------------------------------------------------------- /.electron-vue/webpack.main.config.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | process.env.BABEL_ENV = 'main' 4 | 5 | const path = require('path') 6 | const { dependencies } = require('../package.json') 7 | const webpack = require('webpack') 8 | 9 | const BabiliWebpackPlugin = require('babili-webpack-plugin') 10 | 11 | let mainConfig = { 12 | entry: { 13 | main: path.join(__dirname, '../src/main/index.js') 14 | }, 15 | externals: [ 16 | ...Object.keys(dependencies || {}) 17 | ], 18 | module: { 19 | rules: [ 20 | { 21 | test: /\.(js)$/, 22 | enforce: 'pre', 23 | exclude: /node_modules/, 24 | use: { 25 | loader: 'eslint-loader', 26 | options: { 27 | formatter: require('eslint-friendly-formatter') 28 | } 29 | } 30 | }, 31 | { 32 | test: /\.js$/, 33 | use: 'babel-loader', 34 | exclude: /node_modules/ 35 | }, 36 | { 37 | test: /\.node$/, 38 | use: 'node-loader' 39 | } 40 | ] 41 | }, 42 | node: { 43 | __dirname: process.env.NODE_ENV !== 'production', 44 | __filename: process.env.NODE_ENV !== 'production' 45 | }, 46 | output: { 47 | filename: '[name].js', 48 | libraryTarget: 'commonjs2', 49 | path: path.join(__dirname, '../dist/electron') 50 | }, 51 | plugins: [ 52 | new webpack.NoEmitOnErrorsPlugin() 53 | ], 54 | resolve: { 55 | extensions: ['.js', '.json', '.node'] 56 | }, 57 | target: 'electron-main' 58 | } 59 | 60 | /** 61 | * Adjust mainConfig for development settings 62 | */ 63 | if (process.env.NODE_ENV !== 'production') { 64 | mainConfig.plugins.push( 65 | new webpack.DefinePlugin({ 66 | '__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"` 67 | }) 68 | ) 69 | } 70 | 71 | /** 72 | * Adjust mainConfig for production settings 73 | */ 74 | if (process.env.NODE_ENV === 'production') { 75 | mainConfig.plugins.push( 76 | new BabiliWebpackPlugin(), 77 | new webpack.DefinePlugin({ 78 | 'process.env.NODE_ENV': '"production"' 79 | }) 80 | ) 81 | } 82 | 83 | module.exports = mainConfig 84 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | test/unit/coverage/** 2 | test/unit/*.js 3 | test/e2e/*.js 4 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: 'babel-eslint', 4 | parserOptions: { 5 | sourceType: 'module' 6 | }, 7 | env: { 8 | browser: true, 9 | node: true 10 | }, 11 | extends: 'standard', 12 | globals: { 13 | __static: true 14 | }, 15 | plugins: [ 16 | 'html' 17 | ], 18 | 'rules': { 19 | // allow paren-less arrow functions 20 | 'arrow-parens': 0, 21 | // allow async-await 22 | 'generator-star-spacing': 0, 23 | // allow debugger during development 24 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 25 | } 26 | } -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: weekly 7 | time: "20:00" 8 | open-pull-requests-limit: 10 9 | ignore: 10 | - dependency-name: chalk 11 | versions: 12 | - 4.1.0 13 | - dependency-name: date-fns 14 | versions: 15 | - 2.16.1 16 | - 2.17.0 17 | - dependency-name: eslint-plugin-promise 18 | versions: 19 | - 4.2.1 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | dist/electron/* 3 | dist/web/* 4 | release/* 5 | coverage 6 | node_modules/ 7 | npm-debug.log 8 | npm-debug.log.* 9 | thumbs.db 10 | !.gitkeep 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Hanh D. TRAN 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESP32 Flash Tool 2 | 3 | A desktop application for flashing production ESP32 firmware. App suports multiple platforms (Windows, MacOS, Linux) 4 | 5 | ![ESP32 Flash Tool](/esp32-flash-tool.png) 6 | 7 | ## Motivation 8 | 9 | Simplify settings, clean UI and focus on mass manufacturing process where development and manufacturing are separated steps. 10 | 11 | ## Dependencies install 12 | 13 | - Node v14.19.1 14 | - Python v2.7 15 | - ESP32 Flash Tool depends on pySerial version 3.0 or newer for serial communication with the target device. Hence, you should install `Python` before start run the app. 16 | 17 | To install pySerial manually by running something like: 18 | 19 | ```Shell 20 | $pip install pyserial 21 | or 22 | $easy_install pyserial 23 | or 24 | $apt-get install python-serial 25 | ``` 26 | 27 | depending on your platform. (The official pySerial installation instructions are [here](https://pyserial.readthedocs.org/en/latest/pyserial.html#installation)). 28 | 29 | ## How to build from source? 30 | 31 | ### Install dependencies 32 | 33 | ```Shell 34 | $npm install 35 | ``` 36 | 37 | ### Build app 38 | 39 | ```Shell 40 | $npm run build 41 | ``` 42 | 43 | ### Run app locally 44 | 45 | ```Shell 46 | $npm run dev 47 | ``` 48 | 49 | ### Package app 50 | 51 | ```Shell 52 | $npm run package 53 | ``` 54 | 55 | ## Firmware manufacturing process 56 | 57 | Imagine you have at least 5 steps from firmware development to flashing firmware into production board. The app would be used at **Step 5** in the process flowing: 58 | 59 | ![Firmware Manufacturing Process](/esp32-firmware-manufacturing-process.png) 60 | 61 | - Step 1: Develop & build firmware, you can use [ESP32-IDF](https://github.com/espressif/esp-idf) or [Andruino core for esp32](https://github.com/espressif/arduino-esp32) 62 | 63 | - Step 2: Build and get signed binary files 64 | 65 | - Step 3: Create factory data specific binary file by using command line tools such as [NVS Partition Generator Utility](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/storage/nvs_partition_gen.html#nvs-partition-generator-utility), [Manufacturing Utility](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/storage/mass_mfg.html) 66 | 67 | - Step 4: [Compress all binaries file into a single zip with `parititions.csv`](#create-a-single-compressed-file-for-esp32-flash-tool) specify binaries' offsets. 68 | 69 | - Step 5: **Flash to ESP32 board by ESP32 Flash Tool** 70 | 71 | ## Create a single compressed file for ESP32 Flash Tool 72 | 73 | ESP32 flash tool uses a single zipped file for flashing, just simply collect all required binaries, and create `partitions.csv` in the same folder then compress all into a zip file. 74 | 75 | ## `partitions.csv` file format 76 | 77 | ESP32 flash tool uses `partitions.csv` for identifying offsets of binary blobs. 78 | Sample of `partitions.csv` will be: 79 | 80 | ```CSV 81 | id,name,offset 82 | 1,bootloader.bin,0x1000 83 | 2,ota_data_initial.bin,0xd000 84 | 3,partitions.bin,0xf000 85 | 4,device-00001.bin,0x10000 86 | 5,app.bin,0x20000 87 | ``` 88 | 89 | --- 90 | -------------------------------------------------------------------------------- /build/entitlements.mac.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.files.user-selected.read-only 6 | 7 | com.apple.security.files.user-selected.read-write 8 | 9 | 10 | -------------------------------------------------------------------------------- /build/entitlements.mas.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.application-groups 8 | XXXXX.com.hanhdt.esp.flashtool 9 | com.apple.security.files.user-selected.read-only 10 | 11 | com.apple.security.files.user-selected.read-write 12 | 13 | 14 | -------------------------------------------------------------------------------- /electron-builder.yaml: -------------------------------------------------------------------------------- 1 | directories: 2 | output: release 3 | appId: com.hanhdt.esp.flashtool 4 | copyright: "Copyright © 2022 Hanh D. TRAN" 5 | asar: true 6 | asarUnpack: 7 | - dist/electron/static/esptool/**/* 8 | 9 | productName: ESP32FirmwareTool 10 | files: 11 | - dist/electron/**/* 12 | - embedded.provisionprofile 13 | 14 | # Mac OS configuration 15 | mac: 16 | category: public.app-category.utilities 17 | icon: static/icons/icon.icns 18 | target: 19 | - pkg 20 | - zip 21 | - dmg 22 | 23 | dmg: 24 | contents: 25 | - x: 410 26 | y: 220 27 | type: "link" 28 | path: "/Applications" 29 | - x: 130 30 | y: 220 31 | type: "file" 32 | 33 | # Windows configuration 34 | win: 35 | icon: static/icons/icon.ico 36 | target: 37 | - "zip" 38 | - "nsis" 39 | 40 | # Config for the windows installer 41 | nsis: 42 | oneClick: true 43 | perMachine: true 44 | 45 | # Linux configuration 46 | linux: 47 | icon: static/icons/icons 48 | target: 49 | - "AppImage" 50 | - "deb" 51 | maintainer: "Hanh D. TRAN " -------------------------------------------------------------------------------- /esp32-firmware-manufacturing-process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/esp32-firmware-manufacturing-process.png -------------------------------------------------------------------------------- /esp32-flash-tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/esp32-flash-tool.png -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "baseUrl": ".", 6 | "paths": { 7 | "@/*": ["./src/*"] 8 | } 9 | }, 10 | "exclude": ["node_modules", "dist", "release"], 11 | "include": [ 12 | "./src/**/*" 13 | ] 14 | } -------------------------------------------------------------------------------- /src/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ESP32 Flash Tool 8 | <% if (htmlWebpackPlugin.options.nodeModules) { %> 9 | 10 | 13 | <% } %> 14 | 15 | 16 |
17 | 18 | <% if (!process.browser) { %> 19 | 22 | <% } %> 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/copy_default_assets.js: -------------------------------------------------------------------------------- 1 | import { app } from 'electron' 2 | import fs from 'fs' 3 | import path from 'path' 4 | 5 | function defaultAppLogo () { 6 | const uploadDir = path.join(app.getPath('userData'), '/images/') 7 | // create folder if not existed! 8 | if (!fs.existsSync(uploadDir)) { 9 | fs.mkdirSync(uploadDir) 10 | } 11 | 12 | fs.copyFileSync(path.join(__static, '/images/', 'esp32-flash-tool.png'), 13 | path.join(uploadDir, 'esp32-flash-tool.png')) 14 | } 15 | 16 | function defaultHeaderIcons () { 17 | const uploadDir = path.join(app.getPath('userData'), '/images/') 18 | if (!fs.existsSync(uploadDir)) { // create folder if not existed! 19 | fs.mkdirSync(uploadDir) 20 | } 21 | fs.copyFileSync(path.join(__static, '/images/', 'controller.svg'), 22 | path.join(uploadDir, 'controller.svg')) 23 | fs.copyFileSync(path.join(__static, '/images/', 'settings.svg'), 24 | path.join(uploadDir, 'settings.svg')) 25 | } 26 | 27 | function defaultSettingIcons () { 28 | const uploadDir = path.join(app.getPath('userData'), '/images/') 29 | if (!fs.existsSync(uploadDir)) { // create folder if not existed! 30 | fs.mkdirSync(uploadDir) 31 | } 32 | fs.copyFileSync(path.join(__static, '/images/', 'globe-solid.svg'), 33 | path.join(uploadDir, 'globe-solid.svg')) 34 | fs.copyFileSync(path.join(__static, '/images/', 'github-brands.svg'), 35 | path.join(uploadDir, 'github-brands.svg')) 36 | fs.copyFileSync(path.join(__static, '/images/', 'linkedin-brands.svg'), 37 | path.join(uploadDir, 'linkedin-brands.svg')) 38 | } 39 | 40 | export default function copyDefaultAssets () { 41 | defaultAppLogo() 42 | defaultHeaderIcons() 43 | defaultSettingIcons() 44 | } 45 | -------------------------------------------------------------------------------- /src/main/flash_image.js: -------------------------------------------------------------------------------- 1 | import { PythonShell } from 'python-shell' 2 | import { app } from 'electron' 3 | import path from 'path' 4 | import * as uuid from 'uuid' 5 | 6 | export default function spiFlashImage (mainWindow, params) { 7 | let espToolPath = '' 8 | if (process.env.NODE_ENV === 'production') { 9 | espToolPath = path.join(app.getAppPath(), 'dist/electron/static/esptool/').replace('app.asar', 'app.asar.unpacked') 10 | } else { 11 | espToolPath = path.join(__static, 'esptool/') 12 | } 13 | 14 | const options = { 15 | mode: 'text', 16 | pythonPath: 'python', 17 | pythonOptions: ['-u'], // get print results in real-time 18 | scriptPath: espToolPath, 19 | args: [ 20 | '--chip', params.chip, 21 | '--port', params.port, 22 | '--baud', params.baudRate, 23 | '--before', params.before, 24 | '--after', params.after, 25 | 'write_flash', params.compress, 26 | '--flash_mode', params.flashMode, 27 | '--flash_freq', params.flashFreq, 28 | '--flash_size', params.flashSize, 29 | params.initialOTAIndex, params.initialOTADataBin, 30 | params.bootloaderIndex, params.bootloaderBin, 31 | params.partitionsTableIndex, params.partitionsBin, 32 | params.factorySerialIndex, params.factorySerialBin, 33 | params.appIndex, params.appBin 34 | ] 35 | } 36 | 37 | const pyShell = new PythonShell('esptool.py', options) 38 | 39 | pyShell.on('message', (message) => { 40 | const messageArray = message.split('\r') 41 | messageArray.forEach((messageItem) => { 42 | const msg = { id: uuid.v4(), data: messageItem } 43 | mainWindow.webContents.send('flashing-progress-updated', msg) 44 | }) 45 | }) 46 | 47 | pyShell.end((err, code, signal) => { 48 | if (err) { 49 | mainWindow.webContents.send('flashing-progress-completed', 1, null) 50 | throw err 51 | } 52 | mainWindow.webContents.send('flashing-progress-completed', code, signal) 53 | }) 54 | } 55 | -------------------------------------------------------------------------------- /src/main/index.dev.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Hanh D. TRAN. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * This file is used specifically and only for development. It installs 18 | * `electron-debug` & `vue-devtools`. There shouldn't be any need to 19 | * modify this file, but it can be used to extend your development 20 | * environment. 21 | */ 22 | 23 | /* eslint-disable */ 24 | 25 | // Install `electron-debug` with `devtron` 26 | require('electron-debug')({ showDevTools: true }) 27 | 28 | // Install `vue-devtools` 29 | require('electron').app.on('ready', () => { 30 | let installExtension = require('electron-devtools-installer') 31 | installExtension.default(installExtension.VUEJS_DEVTOOLS) 32 | .then(() => {}) 33 | .catch(err => { 34 | console.log('Unable to install `vue-devtools`: \n', err) 35 | }) 36 | }) 37 | 38 | // Require `main` process to boot app 39 | require('./index') -------------------------------------------------------------------------------- /src/main/scan_serial_ports.js: -------------------------------------------------------------------------------- 1 | const SerialPort = require('serialport') 2 | 3 | export default function scanSerialPorts (mainWindow) { 4 | SerialPort.list((err, ports) => { 5 | if (err) { 6 | mainWindow.webContents.send('ports-scanned', null) 7 | return 8 | } 9 | 10 | let validPorts = ports.filter((port) => { 11 | return port.manufacturer === 'FTDI' || port.manufacturer === 'Silicon Labs' 12 | }) 13 | mainWindow.webContents.send('ports-scanned', validPorts) 14 | }) 15 | } 16 | -------------------------------------------------------------------------------- /src/main/unzip_image.js: -------------------------------------------------------------------------------- 1 | import { app } from 'electron' 2 | import fs from 'fs' 3 | import path from 'path' 4 | const yauzl = require('yauzl') 5 | const csv = require('csv-parser') 6 | 7 | function processPartitionsFile (mainWindow, zipParams, path) { 8 | // Process partitions 9 | fs.createReadStream(path) 10 | .pipe(csv()) 11 | .on('data', (row) => { 12 | // console.log(row) 13 | processCompressedFile(mainWindow, { 14 | filePath: zipParams.filePath, 15 | options: { lazyEntries: false }, 16 | index: row.id, 17 | offset: row.offset, 18 | target: row.name 19 | }) 20 | }) 21 | .on('end', () => { 22 | console.log('Partitions CSV file successfully processed.') 23 | }) 24 | } 25 | 26 | function saveFile (mainWindow, zipParams, fileName, readStream) { 27 | const uploadDir = path.join(app.getPath('userData'), '/firmware/') 28 | // create folder if not existed! 29 | if (!fs.existsSync(uploadDir)) { 30 | fs.mkdirSync(uploadDir) 31 | } 32 | 33 | const dest = path.join(uploadDir, fileName) 34 | const file = fs.createWriteStream(dest) 35 | 36 | readStream.pipe(file) 37 | readStream.on('end', () => { 38 | if (fileName === 'partitions.csv') { 39 | processPartitionsFile(mainWindow, zipParams, dest) 40 | } else { 41 | mainWindow.webContents.send('bin-file-unzipped', 42 | parseInt(zipParams.index), zipParams.offset, fileName, dest) 43 | } 44 | }) 45 | } 46 | 47 | export default function processCompressedFile (mainWindow, zipParams) { 48 | yauzl.open(zipParams.filePath, zipParams.options, (err, zipFile) => { 49 | if (err) throw err 50 | 51 | zipFile.on('error', (err) => { 52 | throw err 53 | }) 54 | 55 | zipFile.on('entry', (entry) => { 56 | // console.log('File:', entry.fileName) 57 | zipFile.openReadStream(entry, (err, readStream) => { 58 | if (err) throw err 59 | 60 | if (zipParams.target === entry.fileName) { 61 | saveFile(mainWindow, zipParams, entry.fileName, readStream) 62 | } 63 | }) 64 | }) 65 | }) 66 | } 67 | -------------------------------------------------------------------------------- /src/renderer/assets/fonts/Avenir-Book.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/src/renderer/assets/fonts/Avenir-Book.woff -------------------------------------------------------------------------------- /src/renderer/assets/fonts/Avenir-Heavy.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/src/renderer/assets/fonts/Avenir-Heavy.woff -------------------------------------------------------------------------------- /src/renderer/assets/fonts/Avenir-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/src/renderer/assets/fonts/Avenir-Light.woff -------------------------------------------------------------------------------- /src/renderer/assets/fonts/Avenir-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/src/renderer/assets/fonts/Avenir-Medium.woff -------------------------------------------------------------------------------- /src/renderer/assets/fonts/Avenir-Roman.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/src/renderer/assets/fonts/Avenir-Roman.woff -------------------------------------------------------------------------------- /src/renderer/assets/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/src/renderer/assets/images/background.png -------------------------------------------------------------------------------- /src/renderer/components/AppFooter.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 35 | 36 | -------------------------------------------------------------------------------- /src/renderer/components/AppHeader.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /src/renderer/components/AppLayout.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 32 | 33 | 38 | -------------------------------------------------------------------------------- /src/renderer/components/AppNav.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 53 | 54 | -------------------------------------------------------------------------------- /src/renderer/components/BaseFile.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 63 | 64 | 72 | -------------------------------------------------------------------------------- /src/renderer/components/_globals.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import upperFirst from 'lodash/upperFirst' 3 | import camelCase from 'lodash/camelCase' 4 | 5 | const requireComponent = require.context( 6 | // Look for files in the current directory 7 | '.', 8 | // Do not look in subdirectories 9 | false, 10 | // Only include "Base" prefix .vue files 11 | /Base[\wA-Z]+\.vue$/ 12 | ) 13 | 14 | requireComponent.keys().forEach((fileName) => { 15 | const componentConfig = requireComponent(fileName) 16 | const componentName = upperFirst( 17 | camelCase( 18 | fileName 19 | // Remove the file extension from the end 20 | .replace(/\.\w+$/, '') 21 | ) 22 | ) 23 | // Globally register the component 24 | Vue.component(componentName, componentConfig.default || componentConfig) 25 | }) 26 | -------------------------------------------------------------------------------- /src/renderer/design/_colors.scss: -------------------------------------------------------------------------------- 1 | // THEMES 2 | $light: #f5f6fa; 3 | $dark: #343a40; 4 | 5 | // CONTENT 6 | $color-body-bg: #f9f7f5; 7 | $color-text: #444; 8 | $color-heading-text: #35495e; 9 | 10 | // LINKS 11 | $color-link-text: #39a275; 12 | $color-link-text-active: $color-text; 13 | 14 | // INPUTS 15 | $color-input-border: lighten($color-heading-text, 50%); 16 | 17 | // BUTTONS 18 | $color-button-bg: $color-link-text; 19 | $color-button-disabled-bg: darken(desaturate($color-button-bg, 20%), 10%); 20 | $color-button-text: white; -------------------------------------------------------------------------------- /src/renderer/design/_durations.scss: -------------------------------------------------------------------------------- 1 | $duration-animation-base: 300ms; -------------------------------------------------------------------------------- /src/renderer/design/_fonts.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Avenir'; 3 | font-weight: 300; 4 | src: local('Avenir-Light'), 5 | url('~@/assets/fonts/Avenir-Light.woff') format('woff'); 6 | } 7 | 8 | @font-face { 9 | font-family: 'Avenir'; 10 | font-weight: 400; 11 | src: local('Avenir-Book'), 12 | url('~@/assets/fonts/Avenir-Book.woff') format('woff'); 13 | } 14 | 15 | @font-face { 16 | font-family: 'Avenir'; 17 | font-weight: 500; 18 | src: local('Avenir-Roman'), 19 | url('~@/assets/fonts/Avenir-Roman.woff') format('woff'); 20 | } 21 | 22 | @font-face { 23 | font-family: 'Avenir'; 24 | font-weight: 500; 25 | src: local('Avenir-Medium'), 26 | url('~@/assets/fonts/Avenir-Medium.woff') format('woff'); 27 | } 28 | 29 | @font-face { 30 | font-family: 'Avenir'; 31 | font-weight: 900; 32 | src: local('Avenir-Heavy'), 33 | url('~@/assets/fonts/Avenir-Heavy.woff') format('woff'); 34 | } 35 | 36 | $system-default-font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', 37 | Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 38 | 'Segoe UI Symbol'; 39 | 40 | $heading-font-family: $system-default-font-family; 41 | $heading-font-weight: 900; 42 | 43 | $content-font-family: $system-default-font-family; 44 | $content-font-weight: 400; 45 | 46 | %font-heading { 47 | font-family: $heading-font-family; 48 | font-weight: $heading-font-weight; 49 | color: $color-heading-text; 50 | } 51 | 52 | %font-content { 53 | font-family: $content-font-family; 54 | font-weight: $content-font-weight; 55 | color: $color-text; 56 | } -------------------------------------------------------------------------------- /src/renderer/design/_layers.scss: -------------------------------------------------------------------------------- 1 | $layer-negative-z-index: -1; 2 | $layer-page-z-index: 1; 3 | $layer-dropdown-z-index: 2; 4 | $layer-modal-z-index: 3; 5 | $layer-popover-z-index: 4; 6 | $layer-tooltip-z-index: 5; -------------------------------------------------------------------------------- /src/renderer/design/_sizes.scss: -------------------------------------------------------------------------------- 1 | // GRID 2 | $size-grid-padding: 1.3rem; 3 | 4 | // CONTENT 5 | $size-content-width-max: 50rem; 6 | $size-content-width-min: 25rem; 7 | 8 | // INPUTS 9 | $size-input-padding-vertical: 0.75em; 10 | $size-input-padding-horizontal: 1em; 11 | $size-input-padding: $size-input-padding-vertical $size-input-padding-horizontal; 12 | $size-input-border: 1px; 13 | $size-input-border-radius: (1em + $size-input-padding-vertical * 2) / 10; 14 | 15 | // BUTTONS 16 | $size-button-padding-vertical: $size-grid-padding / 2; 17 | $size-button-padding-horizontal: $size-grid-padding / 1.5; 18 | $size-button-padding: $size-button-padding-vertical 19 | $size-button-padding-horizontal; -------------------------------------------------------------------------------- /src/renderer/design/index.scss: -------------------------------------------------------------------------------- 1 | @import 'colors'; 2 | @import 'durations'; 3 | @import 'fonts'; 4 | @import 'layers'; 5 | @import 'sizes'; 6 | @import 'typography'; 7 | 8 | :export { 9 | // Any values that need to be accessible from JavaScript 10 | // outside of a Vue component can be defined here, prefixed 11 | // with `global-` to avoid conflicts with classes. For 12 | // example: 13 | // 14 | // global-grid-padding: $size-grid-padding; 15 | // 16 | // Then in a JavaScript file, you can import this object 17 | // as you would normally with: 18 | // 19 | // import design from '@/design/index.scss' 20 | // 21 | // console.log(design['global-grid-padding']) 22 | } -------------------------------------------------------------------------------- /src/renderer/filters.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Add string new line 3 | * @param {*} value 4 | */ 5 | export function addStringNewLine (value) { 6 | return value + '\n' 7 | } 8 | -------------------------------------------------------------------------------- /src/renderer/i18n/en.js: -------------------------------------------------------------------------------- 1 | const EN = { 2 | app_title: 'ESP32 Firmware Tool', 3 | app_subtitle: '', 4 | settings_header: 'Settings', 5 | controller_header: 'Home', 6 | pref_basic_settings_title: 'Basic settings', 7 | pref_reset_title: 'Reset settings', 8 | pref_app_theme: 'App Theme', 9 | pref_reset_message_title: 'Do you want to restore default settings?', 10 | pref_reset_message_detail: 'Remove all current settings data.', 11 | pref_light_theme: 'Light', 12 | pref_dark_theme: 'Dark', 13 | pref_notify_reset_message: 'Do you want to restore default settings?', 14 | pref_notify_reset_details: 'Remove all current settings data.', 15 | contact_title: 'Contact me!', 16 | contact_headquater_address: 'Fushimi-ku, Kyoto 612-8331 Japan', 17 | contact_email: 'Email: tranduchanh.ms@gmail.com', 18 | contact_document: 'App Documentation', 19 | contact_app_version: 'Version' 20 | } 21 | 22 | export default EN 23 | -------------------------------------------------------------------------------- /src/renderer/i18n/ja.js: -------------------------------------------------------------------------------- 1 | const JA = { 2 | app_title: 'ESP32 Firmware Tool', 3 | app_subtitle: '', 4 | settings_header: '設定', 5 | controller_header: 'ホーム', 6 | pref_save_setting_successfully: '噴射時間を保存完了します。', 7 | pref_basic_settings_title: '一般', 8 | pref_reset_title: '設定をリセット', 9 | pref_app_theme: 'アプリケーションのテーマ', 10 | pref_reset_message_title: '初期設定に戻しますか?', 11 | pref_reset_message_detail: '設定データがすべて削除されます。', 12 | pref_light_theme: 'ホワイト', 13 | pref_dark_theme: 'ブラック', 14 | pref_notify_reset_message: '初期設定に戻しますか?', 15 | pref_notify_reset_details: '設定データがすべて削除されます。', 16 | contact_title: 'サポート', 17 | contact_headquater_address: '京都市伏見区', 18 | contact_email: 'Email: tranduchanh.ms@gmail.com', 19 | contact_tel: 'Tel: 080-6675-8773', 20 | contact_document: 'Documentation', 21 | contact_app_version: 'バージョン' 22 | } 23 | 24 | export default JA 25 | -------------------------------------------------------------------------------- /src/renderer/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2019 Hanh D. TRAN 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import Vue from 'vue' 17 | import ESPFirmwareApp from './ESPFirmwareApp.vue' 18 | import router from './plugins/router' 19 | import store from './plugins/store' 20 | import './plugins/bootstrap' 21 | import i18n from './plugins/i18n' 22 | import './components/_globals' 23 | import * as filters from './filters' 24 | 25 | if (!process.env.IS_WEB) Vue.use(require('vue-electron')) 26 | Vue.config.productionTip = false 27 | 28 | for (const key in filters) { 29 | Vue.filter(key, filters[key]) 30 | } 31 | 32 | /* eslint-disable no-new */ 33 | new Vue({ 34 | i18n, 35 | router, 36 | store, 37 | render: h => h(ESPFirmwareApp) 38 | }).$mount('#app') 39 | -------------------------------------------------------------------------------- /src/renderer/plugins/bootstrap.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import BootstrapVue from 'bootstrap-vue' 3 | 4 | Vue.use(BootstrapVue) 5 | -------------------------------------------------------------------------------- /src/renderer/plugins/i18n.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueI18n from 'vue-i18n' 3 | import EN from '../i18n/en' 4 | import JA from '../i18n/ja' 5 | import { remote } from 'electron' 6 | 7 | Vue.use(VueI18n) 8 | 9 | const messages = { 10 | en: EN, 11 | ja: JA 12 | } 13 | 14 | const i18n = new VueI18n({ 15 | locale: remote.app.getLocale() === 'ja' ? 'ja' : 'en', 16 | fallbackLocale: 'ja', 17 | messages 18 | }) 19 | 20 | export default i18n 21 | -------------------------------------------------------------------------------- /src/renderer/plugins/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Home from '../views/Home.vue' 4 | import Setting from '../views/Setting.vue' 5 | 6 | Vue.use(Router) 7 | 8 | export default new Router({ 9 | mode: 'history', 10 | base: process.env.BASE_URL, 11 | routes: [ 12 | { 13 | path: '', 14 | name: 'home', 15 | component: Home 16 | }, 17 | { 18 | path: '/setting', 19 | name: 'setting', 20 | component: Setting 21 | }, 22 | { path: '*', redirect: '/' } 23 | ] 24 | }) 25 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/.gitkeep -------------------------------------------------------------------------------- /static/esptool/.github/ISSUE_TEMPLATE/bug-report-no-hw.yml: -------------------------------------------------------------------------------- 1 | name: Bug report - no ESP chip involved 2 | description: Report bugs or crashes which don't use any attached hardware 3 | labels: ["bug"] 4 | body: 5 | - type: input 6 | id: os 7 | attributes: 8 | label: Operating System 9 | description: On which OS does this issue occur? 10 | placeholder: ex. macOS 12.1 and Xubuntu 20.04 11 | validations: 12 | required: true 13 | - type: dropdown 14 | id: version 15 | attributes: 16 | label: Version 17 | description: What version of esptool are you running? If possible, consider updating esptool. 18 | options: 19 | - latest master 20 | - v3.2 21 | - v3.1 22 | - v3.0 23 | - v2.8 24 | - other 25 | validations: 26 | required: true 27 | - type: input 28 | id: python 29 | attributes: 30 | label: Python Version 31 | description: Which Python version are you using? Run `python -V` to check this. 32 | placeholder: ex. Python 3.9.6 33 | validations: 34 | required: true 35 | - type: input 36 | id: command 37 | attributes: 38 | label: Full Esptool Command Line that Was Run 39 | description: Please input the full esptool command. 40 | placeholder: ex. `esptool.py elf2image esp32-bootloader.elf` 41 | - type: textarea 42 | id: output 43 | attributes: 44 | label: Esptool Output 45 | description: Provide the full output log. 46 | placeholder: Copy and paste all lines of output here. 47 | render: shell 48 | - type: textarea 49 | id: expected 50 | attributes: 51 | label: What is the Expected Behaviour? 52 | description: Please provide a clear and concise description of the expected behaviour. 53 | placeholder: ex. Print the version number. 54 | - type: textarea 55 | id: more-info 56 | attributes: 57 | label: More Information 58 | description: Do you have any other information from investigating this? 59 | placeholder: ex. I tried on my friend's Windows 10 PC and the command works there. 60 | - type: textarea 61 | id: other-remarks 62 | attributes: 63 | label: Other Steps to Reproduce 64 | description: Is there any other information you can think of which will help us reproduce this problem? 65 | placeholder: ex. Only crashes on first day of the month. 66 | -------------------------------------------------------------------------------- /static/esptool/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ESP8266 Forum 4 | url: https://bbs.espressif.com/ 5 | about: For questions about using esptool.py with ESP8266 6 | - name: ESP32 Forum 7 | url: https://esp32.com 8 | about: For questions about using esptool.py with ESP32 9 | 10 | -------------------------------------------------------------------------------- /static/esptool/.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for this project 3 | labels: ["enhancement"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | * We welcome any ideas or feature requests! It’s helpful if you can explain exactly why the feature would be useful. 9 | * There are usually some outstanding feature requests in the [existing issues list](https://github.com/espressif/esptool/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them. 10 | * If you would like to contribute, please read the [contributions guide](https://docs.espressif.com/projects/esptool/en/latest/contributing.html). 11 | - type: textarea 12 | id: problem-related 13 | attributes: 14 | label: Is your feature request related to a problem? 15 | description: Please provide a clear and concise description of what the problem is. 16 | placeholder: ex. I'm always frustrated when ... 17 | - type: textarea 18 | id: solution 19 | attributes: 20 | label: Describe the solution you'd like 21 | description: Please provide a clear and concise description of what you want to happen. 22 | placeholder: ex. When connecting to an Espressif chip ... 23 | - type: textarea 24 | id: alternatives 25 | attributes: 26 | label: Describe alternatives you've considered 27 | description: Please provide a clear and concise description of any alternative solutions or features you've considered. 28 | placeholder: ex. Choosing other approach wouldn't work, because ... 29 | - type: textarea 30 | id: context 31 | attributes: 32 | label: Additional context 33 | description: Please add any other context or screenshots about the feature request here. 34 | placeholder: ex. This would work only when ... 35 | -------------------------------------------------------------------------------- /static/esptool/.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | (Please delete any lines which don't apply) 2 | 3 | # Description of change 4 | 5 | # This change fixes the following bug(s): 6 | 7 | (Please put issue URLs or #number-of-issue here.) 8 | 9 | # I have tested this change with the following hardware & software combinations: 10 | 11 | (Operating system(s), development board name(s), ESP8266 and/or ESP32.) 12 | 13 | # I have run the esptool.py automated integration tests with this change and the above hardware. The results were: 14 | 15 | (Details here: https://github.com/espressif/esptool/blob/master/CONTRIBUTING.md#automated-integration-tests ) 16 | -------------------------------------------------------------------------------- /static/esptool/.github/workflows/issue_comment.yml: -------------------------------------------------------------------------------- 1 | name: Sync issue comments to JIRA 2 | 3 | # This workflow will be triggered when new issue comment is created (including PR comments) 4 | on: issue_comment 5 | 6 | jobs: 7 | sync_issue_comments_to_jira: 8 | name: Sync Issue Comments to Jira 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@master 12 | - name: Sync issue comments to JIRA 13 | uses: espressif/github-actions/sync_issues_to_jira@master 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | JIRA_PASS: ${{ secrets.JIRA_PASS }} 17 | JIRA_PROJECT: ESPTOOL 18 | JIRA_COMPONENT: GitHub 19 | JIRA_URL: ${{ secrets.JIRA_URL }} 20 | JIRA_USER: ${{ secrets.JIRA_USER }} 21 | -------------------------------------------------------------------------------- /static/esptool/.github/workflows/new_issues.yml: -------------------------------------------------------------------------------- 1 | name: Sync issues to Jira 2 | 3 | # This workflow will be triggered when a new issue is opened 4 | on: issues 5 | 6 | jobs: 7 | sync_issues_to_jira: 8 | name: Sync issues to Jira 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@master 12 | - name: Sync GitHub issues to Jira project 13 | uses: espressif/github-actions/sync_issues_to_jira@master 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | JIRA_PASS: ${{ secrets.JIRA_PASS }} 17 | JIRA_PROJECT: ESPTOOL 18 | JIRA_COMPONENT: GitHub 19 | JIRA_URL: ${{ secrets.JIRA_URL }} 20 | JIRA_USER: ${{ secrets.JIRA_USER }} 21 | -------------------------------------------------------------------------------- /static/esptool/.github/workflows/new_prs.yml: -------------------------------------------------------------------------------- 1 | name: Sync remaining PRs to Jira 2 | 3 | # This workflow will be triggered every hour, to sync remaining PRs (i.e. PRs with zero comment) to Jira project 4 | # Note that, PRs can also get synced when new PR comment is created 5 | on: 6 | schedule: 7 | - cron: "0 * * * *" 8 | 9 | jobs: 10 | sync_prs_to_jira: 11 | name: Sync PRs to Jira 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@master 15 | - name: Sync PRs to Jira project 16 | uses: espressif/github-actions/sync_issues_to_jira@master 17 | with: 18 | cron_job: true 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 21 | JIRA_PASS: ${{ secrets.JIRA_PASS }} 22 | JIRA_PROJECT: ESPTOOL 23 | JIRA_COMPONENT: GitHub 24 | JIRA_URL: ${{ secrets.JIRA_URL }} 25 | JIRA_USER: ${{ secrets.JIRA_USER }} 26 | -------------------------------------------------------------------------------- /static/esptool/.github/workflows/release_esptool_pypi.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload an esptool Python package when a release is created 2 | 3 | name: PyPI release 4 | 5 | on: 6 | release: 7 | types: [released] 8 | 9 | jobs: 10 | build_and_upload: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Set up Python 3.7 17 | uses: actions/setup-python@v2 18 | with: 19 | python-version: '3.7' 20 | - name: Install dependencies 21 | run: | 22 | python -m pip install --upgrade pip 23 | pip install setuptools twine 24 | - name: Build and upload esptool ${{ github.event.release.tag_name }} 25 | env: 26 | TWINE_USERNAME: __token__ 27 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 28 | run: | 29 | PUBLISHED_VERSION=$(curl https://pypi.org/pypi/esptool/json 2>/dev/null | jq -r '.info.version') 30 | CURRENT_VERSION=$(python setup.py --version 2>/dev/null) 31 | 32 | if [ "$PUBLISHED_VERSION" == "$CURRENT_VERSION" ]; then 33 | echo "Version ${PUBLISHED_VERSION} already published, skipping..." 34 | exit 1 35 | else 36 | echo "Packaging and publishing new esptool version: ${CURRENT_VERSION}" 37 | python setup.py sdist 38 | tar -ztvf dist/* 39 | twine upload dist/* 40 | fi 41 | -------------------------------------------------------------------------------- /static/esptool/.github/workflows/test_esptool.yml: -------------------------------------------------------------------------------- 1 | name: Test esptool 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test_esptool: 7 | runs-on: ubuntu-latest 8 | 9 | strategy: 10 | matrix: 11 | python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] 12 | 13 | steps: 14 | - name: Checkout ref commit 15 | uses: actions/checkout@v2 16 | 17 | - name: Set up Python ${{ matrix.python-version }} 18 | uses: actions/setup-python@v2 19 | with: 20 | python-version: ${{ matrix.python-version }} 21 | 22 | - name: Test python components (fast) 23 | run: | 24 | python setup.py build 25 | pip install -e .[dev] 26 | python test/test_imagegen.py 27 | python test/test_espsecure.py 28 | python test/test_merge_bin.py 29 | python test/test_modules.py 30 | 31 | - name: Lint with flake8 32 | run: python -m flake8 33 | 34 | - name: Check the installed versions can run 35 | run: | 36 | esptool.py --help 37 | espefuse.py --help 38 | espsecure.py --help 39 | 40 | - name: Build stub (Python 3.7 only) 41 | if: matrix.python-version == 3.7 42 | run: | 43 | export TOOLCHAIN_DIR=$HOME/toolchain 44 | 45 | export ESP8266_BINDIR=$TOOLCHAIN_DIR/xtensa-lx106-elf/bin 46 | export ESP32_BINDIR=$TOOLCHAIN_DIR/xtensa-esp32-elf/bin 47 | export ESP32S2_BINDIR=$TOOLCHAIN_DIR/xtensa-esp32s2-elf/bin 48 | export ESP32S3_BINDIR=$TOOLCHAIN_DIR/xtensa-esp32s3-elf/bin 49 | export ESP32C3_BINDIR=$TOOLCHAIN_DIR/riscv32-esp-elf/bin 50 | 51 | export PATH=$PATH:$ESP8266_BINDIR:$ESP32_BINDIR:$ESP32S2_BINDIR:$ESP32S3_BINDIR:$ESP32C3_BINDIR 52 | 53 | ./test/ci/setup_ci_build_env.sh 54 | make -C flasher_stub V=1 55 | cd flasher_stub && python ./compare_stubs.py 56 | -------------------------------------------------------------------------------- /static/esptool/.gitignore: -------------------------------------------------------------------------------- 1 | .pypirc 2 | *.pyc 3 | *~ 4 | GPATH 5 | GRTAGS 6 | GTAGS 7 | esptool.egg-info 8 | .eggs 9 | build 10 | dist 11 | local.mk 12 | 13 | .envrc 14 | report.xml 15 | 16 | docs/_build/ 17 | -------------------------------------------------------------------------------- /static/esptool/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md 2 | include LICENSE 3 | # sdist includes test/test*.py by default, but esptool.py tests 4 | # are so far only intended to run from the git repo itself 5 | prune test 6 | prune flasher_stub 7 | prune .github 8 | prune docs 9 | exclude .git* 10 | exclude MANIFEST* 11 | 12 | 13 | -------------------------------------------------------------------------------- /static/esptool/README.md: -------------------------------------------------------------------------------- 1 | # esptool.py 2 | 3 | A Python-based, open-source, platform-independent utility to communicate with the ROM bootloader in Espressif chips. 4 | 5 | [![Test esptool](https://github.com/espressif/esptool/actions/workflows/test_esptool.yml/badge.svg?branch=master)](https://github.com/espressif/esptool/actions/workflows/test_esptool.yml) [![Build esptool](https://github.com/espressif/esptool/actions/workflows/build_esptool.yml/badge.svg?branch=master)](https://github.com/espressif/esptool/actions/workflows/build_esptool.yml) 6 | 7 | ## Documentation 8 | 9 | Visit the [documentation](https://docs.espressif.com/projects/esptool/) or run `esptool.py -h`. 10 | 11 | ## Contribute 12 | 13 | If you're interested in contributing to esptool.py, please check the [contributions guide](https://docs.espressif.com/projects/esptool/en/latest/contributing.html). 14 | 15 | ## About 16 | 17 | esptool.py was initially created by Fredrik Ahlberg (@[themadinventor](https://github.com/themadinventor/)), and later maintained by Angus Gratton (@[projectgus](https://github.com/projectgus/)). It is now supported by Espressif Systems. It has also received improvements from many members of the community. 18 | 19 | ## License 20 | 21 | This document and the attached source code are released as Free Software under GNU General Public License Version 2 or later. See the accompanying [LICENSE file](https://github.com/espressif/esptool/blob/master/LICENSE) for a copy. 22 | -------------------------------------------------------------------------------- /static/esptool/build_tools/Sign-File.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param ( 3 | [Parameter()] 4 | [String] 5 | $Path 6 | ) 7 | 8 | 9 | function FindSignTool { 10 | $SignTool = "signtool.exe" 11 | if (Get-Command $SignTool -ErrorAction SilentlyContinue) { 12 | return $SignTool 13 | } 14 | $SignTool = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\x64\signtool.exe" 15 | if (Test-Path -Path $SignTool -PathType Leaf) { 16 | return $SignTool 17 | } 18 | $SignTool = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\x86\signtool.exe" 19 | if (Test-Path -Path $SignTool -PathType Leaf) { 20 | return $SignTool 21 | } 22 | "signtool.exe not found" 23 | Exit 1 24 | } 25 | 26 | function SignInstaller { 27 | param( 28 | [Parameter()] 29 | [String] 30 | $Path 31 | ) 32 | 33 | $SignTool = FindSignTool 34 | "Using: $SignTool" 35 | $CertificateFile = [system.io.path]::GetTempPath() + "certificate.pfx" 36 | 37 | if ($null -eq $env:CERTIFICATE) { 38 | "CERTIFICATE variable not set, unable to sign the file" 39 | Exit 1 40 | } 41 | 42 | if ("" -eq $env:CERTIFICATE) { 43 | "CERTIFICATE variable is empty, unable to sign the file" 44 | Exit 1 45 | } 46 | 47 | $SignParameters = @("sign", "/tr", 'http://timestamp.digicert.com', "/f", $CertificateFile) 48 | if ($env:CERTIFICATE_PASSWORD) { 49 | "CERTIFICATE_PASSWORD detected, using the password" 50 | $SignParameters += "/p" 51 | $SignParameters += $env:CERTIFICATE_PASSWORD 52 | } 53 | $SignParameters += $Path 54 | 55 | [byte[]]$CertificateBytes = [convert]::FromBase64String($env:CERTIFICATE) 56 | [IO.File]::WriteAllBytes($CertificateFile, $CertificateBytes) 57 | 58 | &$SignTool $SignParameters 59 | 60 | if (0 -eq $LASTEXITCODE) { 61 | Remove-Item $CertificateFile 62 | } else { 63 | Remove-Item $CertificateFile 64 | "Signing failed" 65 | Exit 1 66 | } 67 | 68 | } 69 | 70 | SignInstaller ${Path} 71 | -------------------------------------------------------------------------------- /static/esptool/build_tools/espressif.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/build_tools/espressif.ico -------------------------------------------------------------------------------- /static/esptool/docs/README.md: -------------------------------------------------------------------------------- 1 | # Documentation Source Folder 2 | 3 | This folder contains source files of **esptool documentation**. 4 | 5 | The sources do not render well in GitHub and some information is not visible at all. 6 | 7 | Use actual documentation generated within about 20 minutes on each commit: 8 | 9 | # Hosted Documentation 10 | 11 | * English: https://docs.espressif.com/projects/esptool/ 12 | 13 | The above URL is for the master branch latest version. Click the drop-down in the bottom left to choose a particular version. 14 | 15 | # Building Documentation 16 | 17 | The documentation is built using the python package `esp-docs`, which can be installed by running `pip install esp-docs`. Running `build-docs --help` will give a summary of available options. For more information see the `esp-docs` documentation at https://github.com/espressif/esp-docs/blob/master/README.md 18 | -------------------------------------------------------------------------------- /static/esptool/docs/_static/esptool_versions.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_VERSIONS = { 2 | DEFAULTS: { has_targets: false, 3 | supported_targets: [ "esp32" ] 4 | }, 5 | VERSIONS: [ ], 6 | IDF_TARGETS: [ 7 | { text: "ESP8266", value: "esp8266" }, 8 | { text: "ESP32", value: "esp32" }, 9 | { text: "ESP32-S2", value: "esp32s2" }, 10 | { text: "ESP32-S3", value: "esp32s3" }, 11 | { text: "ESP32-C3", value: "esp32c3" }, 12 | ] 13 | }; 14 | -------------------------------------------------------------------------------- /static/esptool/docs/conf_common.py: -------------------------------------------------------------------------------- 1 | from esp_docs.conf_docs import * # noqa: F403,F401 2 | 3 | languages = ['en'] 4 | idf_targets = ['esp8266', 'esp32', 'esp32s2', 'esp32s3', 'esp32c3'] 5 | 6 | # link roles config 7 | github_repo = 'espressif/esptool' 8 | 9 | # context used by sphinx_idf_theme 10 | html_context['github_user'] = 'espressif' 11 | html_context['github_repo'] = 'esptool' 12 | 13 | html_static_path = ['../_static'] 14 | 15 | # Conditional content 16 | extensions += ['esp_docs.esp_extensions.dummy_build_system'] 17 | 18 | ESP8266_DOCS = ['advanced-topics/firmware-image-format.rst', 19 | ] 20 | 21 | ESP32_DOCS = ['espefuse/index.rst', 22 | 'espsecure/index.rst', 23 | ] 24 | 25 | ESP32S2_DOCS = ['espefuse/index.rst', 26 | 'espsecure/index.rst', 27 | ] 28 | 29 | ESP32C3_DOCS = ESP32S2_DOCS 30 | 31 | ESP32S3_DOCS = ESP32S2_DOCS 32 | 33 | conditional_include_dict = {'esp8266': ESP8266_DOCS, 34 | 'esp32': ESP32_DOCS, 35 | 'esp32s2': ESP32S2_DOCS, 36 | 'esp32c3': ESP32C3_DOCS, 37 | 'esp32s3': ESP32S3_DOCS, 38 | } 39 | 40 | # Extra options required by sphinx_idf_theme 41 | project_slug = 'esptool' 42 | 43 | versions_url = './_static/esptool_versions.js' 44 | -------------------------------------------------------------------------------- /static/esptool/docs/en/about.rst: -------------------------------------------------------------------------------- 1 | About 2 | ===== 3 | 4 | Esptool was started by Fredrik Ahlberg (`themadinventor `_) as an unofficial community project. Later, it was maintained by Angus Gratton (`projectgus `_). It is now supported by `Espressif Systems `_. 5 | 6 | Esptool source code and this documentation are released as Free Software under GNU General Public License Version 2 or later. See `the LICENSE `_ for a copy. 7 | -------------------------------------------------------------------------------- /static/esptool/docs/en/advanced-topics/firmware-image-format.rst: -------------------------------------------------------------------------------- 1 | Firmware Image Format 2 | ===================== 3 | 4 | This is technical documentation for the firmware image format used by the ROM bootloader. These are the images created by ``esptool.py elf2image``. 5 | 6 | The firmware file consists of a header, a variable number of data segments and a footer. Multi-byte fields are little-endian. 7 | 8 | File Header 9 | ----------- 10 | 11 | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ 12 | | Byte | Description | 13 | +========+================================================================================================================================================================+ 14 | | 0 | Always ``0xE9`` | 15 | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ 16 | | 1 | Number of segments | 17 | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ 18 | | 2 | SPI Flash Interface (``0`` = QIO, ``1`` = QOUT, ``2`` = DIO, ``0x3`` = DOUT) | 19 | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ 20 | | 3 | High four bits: ``0`` = 512K, ``1`` = 256K, ``2`` = 1M, ``3`` = 2M, ``4`` = 4M, Low four bits: ``0`` = 40MHz, ``1``\ = 26MHz, ``2`` = 20MHz, ``0xf`` = 80MHz | 21 | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ 22 | | 4-7 | Entry point | 23 | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ 24 | | 8-n | Segments | 25 | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ 26 | 27 | esptool overrides the 2nd and 3rd (start from 0) bytes according to the SPI flash info provided through command line option, regardless of corresponding bytes from the input .bin file that will be written to address 0x00000. 28 | So you must provide SPI flash info when running ``esptool write_flash`` command. For example ``esptool write_flash -ff 80m -fm qio -fs 8m 0x00000 boot.bin 0x01000 user1.bin`` 29 | 30 | Segment 31 | ------- 32 | 33 | +---------+-----------------+ 34 | | Byte | Description | 35 | +=========+=================+ 36 | | 0-3 | Memory offset | 37 | +---------+-----------------+ 38 | | 4-7 | Segment size | 39 | +---------+-----------------+ 40 | | 8...n | Data | 41 | +---------+-----------------+ 42 | 43 | Footer 44 | ------ 45 | 46 | The file is padded with zeros until its size is one byte less than a multiple of 16 bytes. A last byte (thus making the file size a multiple of 16) is the checksum of the data of all segments. The checksum is defined as the xor-sum of all bytes and the byte ``0xEF``. 47 | -------------------------------------------------------------------------------- /static/esptool/docs/en/advanced-topics/index.rst: -------------------------------------------------------------------------------- 1 | Advanced Topics 2 | =============== 3 | 4 | This sections contains advanced topics and technical documentation useful if you're developing ``esptool`` or hacking system internals: 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | :esp8266:Firmware Image Format 10 | Serial Protocol 11 | SPI Flash Modes 12 | Boot Mode Selection 13 | -------------------------------------------------------------------------------- /static/esptool/docs/en/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # English Language RTD & Sphinx config file 4 | # 5 | # Uses ../conf_common.py for most non-language-specific settings. 6 | 7 | # Importing conf_common adds all the non-language-specific 8 | # parts to this conf module 9 | 10 | import datetime 11 | 12 | try: 13 | from conf_common import * # noqa: F403,F401 14 | except ImportError: 15 | import os 16 | import sys 17 | sys.path.insert(0, os.path.abspath('../')) 18 | from conf_common import * # noqa: F403,F401 19 | 20 | # General information about the project. 21 | project = u'esptool' 22 | copyright = u'2016 - {}, Espressif Systems (Shanghai) Co., Ltd'.format(datetime.datetime.now().year) 23 | 24 | # The language for content autogenerated by Sphinx. Refer to documentation 25 | # for a list of supported languages. 26 | language = 'en' 27 | -------------------------------------------------------------------------------- /static/esptool/docs/en/contributing.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../../CONTRIBUTING.rst 2 | -------------------------------------------------------------------------------- /static/esptool/docs/en/espsecure/index.rst: -------------------------------------------------------------------------------- 1 | .. _espsecure: 2 | 3 | espsecure.py 4 | ============ 5 | 6 | ``espsecure.py`` is a tool for manipulating data that relates to the secure boot and flash encryption features of ESP32 and later Espressif chips. 7 | 8 | For more details, see the ESP-IDF documentation which explains this tool and how to use it to enable the relevant features: 9 | 10 | * `Secure Boot `_ 11 | * `Flash Encryption `_ 12 | -------------------------------------------------------------------------------- /static/esptool/docs/en/esptool/basic-options.rst: -------------------------------------------------------------------------------- 1 | .. _options: 2 | 3 | Basic Options 4 | ============= 5 | 6 | These are the basic/fundamental esptool options needed to define the communication with an ESP target. For advanced configuration options, see the :ref:`advanced-options` page. 7 | 8 | .. _serial-port: 9 | 10 | Serial Port 11 | ----------- 12 | 13 | * The serial port is selected using the ``-p`` option, like ``-p /dev/ttyUSB0`` (Linux and macOS) or ``-p COM1`` (Windows). 14 | * A default serial port can be specified by setting the ``ESPTOOL_PORT`` environment variable. 15 | * If no ``-p`` option or ``ESPTOOL_PORT`` value is specified, ``esptool.py`` will enumerate all connected serial ports and try each one until it finds an Espressif device connected. 16 | 17 | .. note:: 18 | 19 | Windows and macOS may require drivers to be installed for a particular USB/serial adapter, before a serial port is available. Consult the documentation for your particular device. 20 | On macOS, you can also consult `System Information `__'s list of USB devices to identify the manufacturer or device ID when the adapter is plugged in. 21 | On Windows, you can use `Windows Update or Device Manager `__ to find a driver. 22 | 23 | If using Cygwin or WSL on Windows, you have to convert the Windows-style name into a Unix-style path (``COM1`` -> ``/dev/ttyS0``, and so on). (This is not necessary if using ESP-IDF with the supplied Windows MSYS2 environment, 24 | this environment uses a native Windows Python which accepts COM ports as-is.) 25 | 26 | In Linux, the current user may not have access to serial ports and a "Permission Denied" error will appear. On most Linux distributions, the solution is to add the user to the ``dialout`` group with a command like ``sudo usermod -a -G dialout ``. 27 | Check your Linux distribution's documentation for more information. 28 | 29 | Baud Rate 30 | --------- 31 | 32 | The default esptool baud rate is 115200bps. Different rates may be set using ``-b 921600`` (or another baud rate of your choice). A default baud rate can also be specified using the ``ESPTOOL_BAUD`` environment variable. This can speed up ``write_flash`` and ``read_flash`` operations. 33 | 34 | The baud rate is limited to 115200 when esptool establishes the initial connection, higher speeds are only used for data transfers. 35 | 36 | Most hardware configurations will work with ``-b 230400``, some with ``-b 460800``, ``-b 921600`` and/or ``-b 1500000`` or higher. 37 | 38 | .. only:: esp8266 39 | 40 | If you have connectivity problems then you can also set baud rates below 115200. You can also choose 74880, which is the :ref:`usual baud rate used by the ESP8266 ` to output :ref:`boot-log-esp8266` information. 41 | 42 | .. only:: not esp8266 43 | 44 | If you have connectivity problems then you can also set baud rates below 115200. 45 | -------------------------------------------------------------------------------- /static/esptool/docs/en/esptool/entering-bootloader.rst: -------------------------------------------------------------------------------- 1 | .. _entering-the-bootloader: 2 | 3 | Entering the Bootloader 4 | ======================= 5 | 6 | Espressif chips have to be reset in a certain way in order to launch the serial bootloader, only then can ``esptool.py`` communicate with the ESP chip. 7 | 8 | On some development boards (including NodeMCU, WeMOS, HUZZAH Feather, Core Board, ESP32-WROVER-KIT), esptool can :ref:`automatically trigger a reset into the serial bootloader ` - in which case you don't need to read this section. 9 | 10 | For everyone else, three things must happen to enter the serial bootloader (firmware download mode) - a reset, required pins set correctly, and a correct strapping pin pulled low. For more information, see the detailed :ref:`Boot Mode Selection` guide. 11 | 12 | Boot Mode 13 | --------- 14 | 15 | Espressif chips choose the boot mode each time they reset. A reset event can happen in one of several ways: 16 | 17 | .. list:: 18 | 19 | * Power applied to chip. 20 | :esp8266: * The nRESET pin was low and is pulled high. 21 | * The CH_PD/EN pin ("enable") pin was low and is pulled high. 22 | 23 | .. only:: esp8266 24 | 25 | On {IDF_TARGET_NAME}, both the nRESET and CH_PD pins must be pulled high for the chip to start operating. 26 | -------------------------------------------------------------------------------- /static/esptool/docs/en/esptool/flasher-stub.rst: -------------------------------------------------------------------------------- 1 | .. _stub: 2 | 3 | Flasher Stub 4 | ============ 5 | 6 | ``esptool.py`` is a serial flasher utility. It communicates with the ROM bootloader in `Espressif SoCs `_ in order to load user applications or read chip data via serial port. 7 | 8 | The ROM bootloader is burned into the ESP chip during manufacturing and cannot be updated. A new version is issued only when a new chip revision is released. 9 | 10 | ``esptool.py`` works around the limitations imposed by a fixed ROM bootloader by implementing a flasher stub (also known as "stub loader" or just "stub"). It is a small application used as a temporary substitute or extension for the ROM. 11 | 12 | When ``esptool.py`` connects to a chip, it first uploads the flasher stub, which basically replaces the original bootloader. All following operations are then handled by the stub. 13 | 14 | Benefits 15 | -------- 16 | 17 | The flasher stub behaves the same as the original bootloader, but uses more heavily optimized UART routines. 18 | 19 | The main benefit is improved performance of flashing and some other operations (like reading flash). Additionally, there are a few commands which are only available when using the stub loader (such as :ref:`erase_flash and erase_region `). It also allows to work around any bugs in ROM bootloaders. 20 | 21 | Disabling the Stub Loader 22 | ------------------------- 23 | 24 | There might be cases where it is necessary to disable the stub loader (e.g. debugging). To do that, run ``esptool.py`` with the ``--no-stub`` argument. All operations will then be handled by the original ROM bootloader. See the related :ref:`advanced options page `. 25 | -------------------------------------------------------------------------------- /static/esptool/docs/en/esptool/index.rst: -------------------------------------------------------------------------------- 1 | .. _esptool: 2 | 3 | esptool.py 4 | ========== 5 | 6 | Use ``esptool.py -h`` to see a summary of all available commands and command line options. 7 | 8 | To see all options for a particular command, append ``-h`` to the command name. ie ``esptool.py write_flash -h``. 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | 13 | Basic Options 14 | Basic Commands 15 | Advanced Options 16 | Advanced Commands 17 | Flasher Stub 18 | Flash Modes 19 | Entering the Bootloader 20 | Serial Connection 21 | Remote Serial Ports 22 | Flashing Firmware 23 | Scripting 24 | 25 | .. only:: not esp8266 26 | 27 | Instructions for other tools bundled with esptool: 28 | 29 | * :ref:`espefuse` 30 | * :ref:`espsecure` 31 | -------------------------------------------------------------------------------- /static/esptool/docs/en/esptool/remote-serial-ports.rst: -------------------------------------------------------------------------------- 1 | Remote Serial Ports 2 | =================== 3 | 4 | It is possible to connect to any networked remote serial port that supports `RFC2217 `__ (Telnet) protocol. To do this, specify the serial port to esptool as ``rfc2217://:``. For example: 5 | 6 | :: 7 | 8 | esptool.py --port rfc2217://192.168.1.77:4000 flash_id 9 | 10 | Custom baud rates and DTR/RTS automatic resetting are supported over the RFC2217 protocol, the same as for a local serial port. 11 | 12 | Pyserial Example Servers 13 | ------------------------ 14 | 15 | PySerial (which is a dependency of esptool) includes two RFC2217 example programs - `a single-port example `__ and a `multi-port example `__. 16 | These example servers can run on any OS that supports pyserial, and are the simplest way to connect to an Espressif SoC over the network. 17 | 18 | There is an issue with `automatic resetting due to network latency `__. In order to work around this issue, a modified version of the single-port server example called ``esp_rfc2217_server.py`` is provided with esptool. 19 | 20 | On server: 21 | 22 | :: 23 | 24 | esp_rfc2217_server.py -p 4000 /dev/ttyUSB1 25 | 26 | On client: 27 | 28 | :: 29 | 30 | esptool.py --port rfc2217://ADDRESS_OF_SERVER:4000?ign_set_control flash_id 31 | 32 | 33 | Raw Sockets 34 | ----------- 35 | 36 | For servers or hardware network/serial adapters which don't support the full RFC2217, it is also possible to specify ``--port socket://:`` syntax for a simple "raw TCP socket" protocol. 37 | 38 | These raw sockets don't support setting the baud rate or automatic resetting into the bootloader. If using this mode, don't pass the ``--baud`` option to esptool. You need to set the baud rate manually on the server, and manually reset the chip into the bootloader mode (or use some other signalling/control method to tell the server to do so). 39 | 40 | Here's a very basic example using the common Linux/OSX command line "netcat" and "stty" commands: 41 | 42 | On server: 43 | 44 | :: 45 | 46 | stty -F /dev/ttyUSB1 230400 # set baud rate 47 | nc -p 4000 -lk < /dev/ttyUSB1 > /dev/ttyUSB1 48 | 49 | On client: 50 | 51 | :: 52 | 53 | esptool.py -p socket://localhost:4000 flash_id 54 | 55 | .. note:: 56 | 57 | Using RFC2217 is strongly recommended where possible. 58 | 59 | More Details 60 | ------------ 61 | 62 | All of the remote serial port support comes via pyserial. Read more `here `__. (Please keep in mind that the link points to documentation for the most recent pyserial version. You may have an older version.) 63 | -------------------------------------------------------------------------------- /static/esptool/docs/en/esptool/scripting.rst: -------------------------------------------------------------------------------- 1 | .. _scripting: 2 | 3 | Embedding into Custom Scripts 4 | ============================= 5 | 6 | ``esptool.py``, ``espefuse.py``, and ``espsecure.py`` can easily be integrated into Python applications or called from other Python scripts. 7 | 8 | While it currently does have a poor Python API, something which `#208 `_ will address, it allows for passing CLI arguments to ``esptool.main()``. This workaround makes integration very straightforward as you can pass exactly the same arguments as you would on the CLI: 9 | 10 | .. code-block:: python 11 | 12 | command = ['--baud', '460800', 'read_flash', '0', '0x200000', 'flash_contents.bin'] 13 | print('Using command %s' % ' '.join(command)) 14 | esptool.main(command) 15 | -------------------------------------------------------------------------------- /static/esptool/docs/en/esptool/serial-connection.rst: -------------------------------------------------------------------------------- 1 | {IDF_TARGET_BAUD_RATE:default="115200", esp8266="74880 "} 2 | 3 | Serial Connection 4 | ================= 5 | 6 | The ROM serial bootloader of Espressif chips uses a 3.3V UART serial connection. Many development boards make the serial connections for you onboard. 7 | 8 | However, if you are wiring the chip yourself to a USB/Serial adapter or similar then the following connections must be made: 9 | 10 | +---------------------+-------------------+ 11 | | ESP Chip Pin | Serial Port Pin | 12 | +=====================+===================+ 13 | | TX | RX (receive) | 14 | +---------------------+-------------------+ 15 | | RX | TX (transmit) | 16 | +---------------------+-------------------+ 17 | | Ground | Ground | 18 | +---------------------+-------------------+ 19 | 20 | Note that TX (transmit) on the ESP chip is connected to RX (receive) on the serial port connection, and vice versa. 21 | 22 | Do not connect the chip to 5V TTL serial adapters, and especially not to "standard" RS-232 adapters! 3.3V serial only!  23 | 24 | .. _serial-port-settings: 25 | 26 | Serial Port Settings 27 | -------------------- 28 | 29 | When communicating with the {IDF_TARGET_NAME} ROM serial bootloader, the following serial port settings are recommended: 30 | 31 | +---------------------+-------------------+  32 | | Baud rate | {IDF_TARGET_BAUD_RATE} | 33 | +---------------------+-------------------+ 34 | | Data bits | 8 | 35 | +---------------------+-------------------+ 36 | | Stop bits | 1 | 37 | +---------------------+-------------------+ 38 | | Parity | None | 39 | +---------------------+-------------------+ 40 | | Flow control | None | 41 | +---------------------+-------------------+ 42 | 43 | .. only:: esp8266 44 | 45 | .. note:: 46 | 47 | Baud rate {IDF_TARGET_BAUD_RATE} is what the {IDF_TARGET_NAME} bootloader uses. The apps on top of the Espressif SDK (e.g. Arduino sketch) talk at 115200 if not specified otherwise. 48 | -------------------------------------------------------------------------------- /static/esptool/docs/en/index.rst: -------------------------------------------------------------------------------- 1 | Esptool Documentation 2 | ===================== 3 | 4 | This is the documentation for esptool - a Python-based, open source, platform independent utility to communicate with the ROM bootloader in `Espressif SoCs `_. 5 | 6 | esptool, espefuse and espsecure are a complete toolset for working with Espressif chips. They can do a number of things, for example: 7 | 8 | * Read, write, erase, and verify binary data stored in flash. 9 | * Read chip features and other related data such as MAC address or flash chip ID. 10 | * Read and write the one-time-programmable efuses. 11 | * Prepare binary executable images ready for flashing. 12 | * Analyze, assemble, and merge binary images. 13 | 14 | This document describes using esptool with the {IDF_TARGET_NAME} SoC. To switch to a different SoC target, choose target from the dropdown in the upper left. 15 | 16 | Quick Start 17 | ----------- 18 | 19 | Getting started is easy: 20 | 21 | 1) Install esptool: 22 | 23 | :: 24 | 25 | $ pip install esptool 26 | 27 | For detailed instructions, see :ref:`installation`. 28 | 29 | 30 | 2) Connect an Espressif chip to your computer. 31 | 32 | 3) Run esptool commands: 33 | 34 | :: 35 | 36 | $ esptool -p PORT flash_id 37 | 38 | Replace ``PORT`` with the name of used serial port. If connection fails, see :ref:`troubleshooting`. 39 | 40 | More Information 41 | ---------------- 42 | 43 | .. toctree:: 44 | :maxdepth: 1 45 | 46 | Installation 47 | Esptool 48 | :not esp8266:Espefuse 49 | :not esp8266:Espsecure 50 | Advanced Topics 51 | Troubleshooting 52 | Contribute 53 | About 54 | -------------------------------------------------------------------------------- /static/esptool/docs/en/installation.rst: -------------------------------------------------------------------------------- 1 | .. _installation: 2 | 3 | Installation and Dependencies 4 | ============================= 5 | 6 | You will need `either Python 2.7 or Python 3.4 or newer `_ installed on your system. 7 | 8 | The latest stable esptool release can be installed from `PyPI `_ via pip: 9 | 10 | :: 11 | 12 | $ pip install esptool 13 | 14 | With some Python installations this may not work and you’ll receive an error, try ``python -m pip install esptool`` or ``pip3 install esptool``, or consult your `Python installation manual `_ for information about how to access pip. 15 | 16 | `Setuptools `_ is also a requirement which is not available on all systems by default. You can install it by a package manager of your operating system, or by ``pip install setuptools``. 17 | 18 | After installing, you will have ``esptool.py`` installed into the default Python executables directory and you should be able to run it with the command ``esptool.py`` or ``python -m esptool``. Please note that probably only ``python -m esptool`` will work for Pythons installed from Windows Store. 19 | 20 | .. note:: 21 | 22 | If you actually plan to do development work with esptool itself, see :ref:`development-setup` for more information. 23 | -------------------------------------------------------------------------------- /static/esptool/docs/requirements.txt: -------------------------------------------------------------------------------- 1 | esp-docs==0.2.0 -------------------------------------------------------------------------------- /static/esptool/docs/utils.sh: -------------------------------------------------------------------------------- 1 | # Bash helper functions for adding SSH keys 2 | 3 | function add_ssh_keys() { 4 | local key_string="${1}" 5 | mkdir -p ~/.ssh 6 | chmod 700 ~/.ssh 7 | echo -n "${key_string}" >~/.ssh/id_rsa_base64 8 | base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 >~/.ssh/id_rsa 9 | chmod 600 ~/.ssh/id_rsa 10 | } 11 | 12 | function add_doc_server_ssh_keys() { 13 | local key_string="${1}" 14 | local server_url="${2}" 15 | local server_user="${3}" 16 | add_ssh_keys "${key_string}" 17 | echo -e "Host ${server_url}\n\tStrictHostKeyChecking no\n\tUser ${server_user}\n" >>~/.ssh/config 18 | } 19 | -------------------------------------------------------------------------------- /static/esptool/espressif/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/espressif/__init__.py -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/espressif/efuse/__init__.py -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32/__init__.py: -------------------------------------------------------------------------------- 1 | from . import operations 2 | from .emulate_efuse_controller import EmulateEfuseController 3 | from .fields import EspEfuses 4 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32c3/__init__.py: -------------------------------------------------------------------------------- 1 | from . import operations 2 | from .emulate_efuse_controller import EmulateEfuseController 3 | from .fields import EspEfuses 4 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32c3/emulate_efuse_controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file describes eFuses controller for ESP32-C3 chip 3 | # 4 | # SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD 5 | # 6 | # SPDX-License-Identifier: GPL-2.0-or-later 7 | 8 | from __future__ import division, print_function 9 | 10 | import reedsolo 11 | 12 | from .mem_definition import EfuseDefineBlocks, EfuseDefineFields, EfuseDefineRegisters 13 | from ..emulate_efuse_controller_base import EmulateEfuseControllerBase, FatalError 14 | 15 | 16 | class EmulateEfuseController(EmulateEfuseControllerBase): 17 | """ The class for virtual ESP32 operation. Using for HOST_TEST. 18 | """ 19 | CHIP_NAME = "ESP32-C3" 20 | mem = None 21 | debug = False 22 | Blocks = EfuseDefineBlocks 23 | Fields = EfuseDefineFields 24 | REGS = EfuseDefineRegisters 25 | 26 | def __init__(self, efuse_file=None, debug=False): 27 | super(EmulateEfuseController, self).__init__(efuse_file, debug) 28 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 29 | 30 | """ esptool method start >>""" 31 | 32 | def get_chip_description(self): 33 | return "" 34 | 35 | def get_crystal_freq(self): 36 | return 40 # MHz (common for all chips) 37 | 38 | """ << esptool method end """ 39 | 40 | def handle_writing_event(self, addr, value): 41 | if addr == self.REGS.EFUSE_CMD_REG: 42 | if value & self.REGS.EFUSE_PGM_CMD: 43 | self.copy_blocks_wr_regs_to_rd_regs(updated_block=(value >> 2) & 0xF) 44 | self.clean_blocks_wr_regs() 45 | self.check_rd_protection_area() 46 | self.write_reg(addr, 0) 47 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 48 | elif value == self.REGS.EFUSE_READ_CMD: 49 | self.write_reg(addr, 0) 50 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 51 | self.save_to_file() 52 | 53 | def get_bitlen_of_block(self, blk, wr=False): 54 | if blk.id == 0: 55 | if wr: 56 | return 32 * 8 57 | else: 58 | return 32 * blk.len 59 | else: 60 | if wr: 61 | rs_coding = 32 * 3 62 | return 32 * 8 + rs_coding 63 | else: 64 | return 32 * blk.len 65 | 66 | def handle_coding_scheme(self, blk, data): 67 | if blk.id != 0: 68 | # CODING_SCHEME RS applied only for all blocks except BLK0. 69 | coded_bytes = 12 70 | data.pos = coded_bytes * 8 71 | plain_data = data.readlist('32*uint:8')[::-1] 72 | # takes 32 bytes 73 | # apply RS encoding 74 | rs = reedsolo.RSCodec(coded_bytes) 75 | # 32 byte of data + 12 bytes RS 76 | calc_encoded_data = list(rs.encode([x for x in plain_data])) 77 | data.pos = 0 78 | if calc_encoded_data != data.readlist('44*uint:8')[::-1]: 79 | raise FatalError("Error in coding scheme data") 80 | data = data[coded_bytes * 8:] 81 | if blk.len < 8: 82 | data = data[(8 - blk.len) * 32:] 83 | return data 84 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32h2beta1/__init__.py: -------------------------------------------------------------------------------- 1 | from . import operations 2 | from .emulate_efuse_controller import EmulateEfuseController 3 | from .fields import EspEfuses 4 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32h2beta1/emulate_efuse_controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file describes eFuses controller for ESP32-H2 chip 3 | # 4 | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD 5 | # 6 | # SPDX-License-Identifier: GPL-2.0-or-later 7 | 8 | from __future__ import division, print_function 9 | 10 | import reedsolo 11 | 12 | from .mem_definition import EfuseDefineBlocks, EfuseDefineFields, EfuseDefineRegisters 13 | from ..emulate_efuse_controller_base import EmulateEfuseControllerBase, FatalError 14 | 15 | 16 | class EmulateEfuseController(EmulateEfuseControllerBase): 17 | """ The class for virtual ESP32 operation. Using for HOST_TEST. 18 | """ 19 | CHIP_NAME = "ESP32-H2(beta1)" 20 | mem = None 21 | debug = False 22 | Blocks = EfuseDefineBlocks 23 | Fields = EfuseDefineFields 24 | REGS = EfuseDefineRegisters 25 | 26 | def __init__(self, efuse_file=None, debug=False): 27 | super(EmulateEfuseController, self).__init__(efuse_file, debug) 28 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 29 | 30 | """ esptool method start >>""" 31 | 32 | def get_chip_description(self): 33 | return "" 34 | 35 | def get_crystal_freq(self): 36 | return 32 # MHz (common for all chips) 37 | 38 | """ << esptool method end """ 39 | 40 | def handle_writing_event(self, addr, value): 41 | if addr == self.REGS.EFUSE_CMD_REG: 42 | if value & self.REGS.EFUSE_PGM_CMD: 43 | self.copy_blocks_wr_regs_to_rd_regs(updated_block=(value >> 2) & 0xF) 44 | self.clean_blocks_wr_regs() 45 | self.check_rd_protection_area() 46 | self.write_reg(addr, 0) 47 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 48 | elif value == self.REGS.EFUSE_READ_CMD: 49 | self.write_reg(addr, 0) 50 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 51 | self.save_to_file() 52 | 53 | def get_bitlen_of_block(self, blk, wr=False): 54 | if blk.id == 0: 55 | if wr: 56 | return 32 * 8 57 | else: 58 | return 32 * blk.len 59 | else: 60 | if wr: 61 | rs_coding = 32 * 3 62 | return 32 * 8 + rs_coding 63 | else: 64 | return 32 * blk.len 65 | 66 | def handle_coding_scheme(self, blk, data): 67 | if blk.id != 0: 68 | # CODING_SCHEME RS applied only for all blocks except BLK0. 69 | coded_bytes = 12 70 | data.pos = coded_bytes * 8 71 | plain_data = data.readlist('32*uint:8')[::-1] 72 | # takes 32 bytes 73 | # apply RS encoding 74 | rs = reedsolo.RSCodec(coded_bytes) 75 | # 32 byte of data + 12 bytes RS 76 | calc_encoded_data = list(rs.encode([x for x in plain_data])) 77 | data.pos = 0 78 | if calc_encoded_data != data.readlist('44*uint:8')[::-1]: 79 | raise FatalError("Error in coding scheme data") 80 | data = data[coded_bytes * 8:] 81 | if blk.len < 8: 82 | data = data[(8 - blk.len) * 32:] 83 | return data 84 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32s2/__init__.py: -------------------------------------------------------------------------------- 1 | from . import operations 2 | from .emulate_efuse_controller import EmulateEfuseController 3 | from .fields import EspEfuses 4 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32s2/emulate_efuse_controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file describes eFuses controller for ESP32-S2 chip 3 | # 4 | # SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD 5 | # 6 | # SPDX-License-Identifier: GPL-2.0-or-later 7 | 8 | from __future__ import division, print_function 9 | 10 | import reedsolo 11 | 12 | from .mem_definition import EfuseDefineBlocks, EfuseDefineFields, EfuseDefineRegisters 13 | from ..emulate_efuse_controller_base import EmulateEfuseControllerBase, FatalError 14 | 15 | 16 | class EmulateEfuseController(EmulateEfuseControllerBase): 17 | """ The class for virtual ESP32 operation. Using for HOST_TEST. 18 | """ 19 | CHIP_NAME = "ESP32-S2" 20 | mem = None 21 | debug = False 22 | Blocks = EfuseDefineBlocks 23 | Fields = EfuseDefineFields 24 | REGS = EfuseDefineRegisters 25 | 26 | def __init__(self, efuse_file=None, debug=False): 27 | super(EmulateEfuseController, self).__init__(efuse_file, debug) 28 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 29 | 30 | """ esptool method start >>""" 31 | 32 | def get_chip_description(self): 33 | return "" 34 | 35 | def get_crystal_freq(self): 36 | return 40 # MHz (common for all chips) 37 | 38 | """ << esptool method end """ 39 | 40 | def handle_writing_event(self, addr, value): 41 | if addr == self.REGS.EFUSE_CMD_REG: 42 | if value & self.REGS.EFUSE_PGM_CMD: 43 | self.copy_blocks_wr_regs_to_rd_regs(updated_block=(value >> 2) & 0xF) 44 | self.clean_blocks_wr_regs() 45 | self.check_rd_protection_area() 46 | self.write_reg(addr, 0) 47 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 48 | elif value == self.REGS.EFUSE_READ_CMD: 49 | self.write_reg(addr, 0) 50 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 51 | self.save_to_file() 52 | 53 | def get_bitlen_of_block(self, blk, wr=False): 54 | if blk.id == 0: 55 | if wr: 56 | return 32 * 8 57 | else: 58 | return 32 * blk.len 59 | else: 60 | if wr: 61 | rs_coding = 32 * 3 62 | return 32 * 8 + rs_coding 63 | else: 64 | return 32 * blk.len 65 | 66 | def handle_coding_scheme(self, blk, data): 67 | if blk.id != 0: 68 | # CODING_SCHEME RS applied only for all blocks except BLK0. 69 | coded_bytes = 12 70 | data.pos = coded_bytes * 8 71 | plain_data = data.readlist('32*uint:8')[::-1] 72 | # takes 32 bytes 73 | # apply RS encoding 74 | rs = reedsolo.RSCodec(coded_bytes) 75 | # 32 byte of data + 12 bytes RS 76 | calc_encoded_data = list(rs.encode([x for x in plain_data])) 77 | data.pos = 0 78 | if calc_encoded_data != data.readlist('44*uint:8')[::-1]: 79 | raise FatalError("Error in coding scheme data") 80 | data = data[coded_bytes * 8:] 81 | if blk.len < 8: 82 | data = data[(8 - blk.len) * 32:] 83 | return data 84 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32s3/__init__.py: -------------------------------------------------------------------------------- 1 | from . import operations 2 | from .emulate_efuse_controller import EmulateEfuseController 3 | from .fields import EspEfuses 4 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32s3/emulate_efuse_controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file describes eFuses controller for ESP32-S3 chip 3 | # 4 | # SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD 5 | # 6 | # SPDX-License-Identifier: GPL-2.0-or-later 7 | 8 | from __future__ import division, print_function 9 | 10 | import reedsolo 11 | 12 | from .mem_definition import EfuseDefineBlocks, EfuseDefineFields, EfuseDefineRegisters 13 | from ..emulate_efuse_controller_base import EmulateEfuseControllerBase, FatalError 14 | 15 | 16 | class EmulateEfuseController(EmulateEfuseControllerBase): 17 | """ The class for virtual ESP32-S3 operation. Using for HOST_TEST. 18 | """ 19 | CHIP_NAME = "ESP32-S3" 20 | mem = None 21 | debug = False 22 | Blocks = EfuseDefineBlocks 23 | Fields = EfuseDefineFields 24 | REGS = EfuseDefineRegisters 25 | 26 | def __init__(self, efuse_file=None, debug=False): 27 | super(EmulateEfuseController, self).__init__(efuse_file, debug) 28 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 29 | 30 | """ esptool method start >>""" 31 | 32 | def get_chip_description(self): 33 | return "" 34 | 35 | def get_crystal_freq(self): 36 | return 40 # MHz (common for all chips) 37 | 38 | """ << esptool method end """ 39 | 40 | def handle_writing_event(self, addr, value): 41 | if addr == self.REGS.EFUSE_CMD_REG: 42 | if value & self.REGS.EFUSE_PGM_CMD: 43 | self.copy_blocks_wr_regs_to_rd_regs(updated_block=(value >> 2) & 0xF) 44 | self.clean_blocks_wr_regs() 45 | self.check_rd_protection_area() 46 | self.write_reg(addr, 0) 47 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 48 | elif value == self.REGS.EFUSE_READ_CMD: 49 | self.write_reg(addr, 0) 50 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 51 | self.save_to_file() 52 | 53 | def get_bitlen_of_block(self, blk, wr=False): 54 | if blk.id == 0: 55 | if wr: 56 | return 32 * 8 57 | else: 58 | return 32 * blk.len 59 | else: 60 | if wr: 61 | rs_coding = 32 * 3 62 | return 32 * 8 + rs_coding 63 | else: 64 | return 32 * blk.len 65 | 66 | def handle_coding_scheme(self, blk, data): 67 | if blk.id != 0: 68 | # CODING_SCHEME RS applied only for all blocks except BLK0. 69 | coded_bytes = 12 70 | data.pos = coded_bytes * 8 71 | plain_data = data.readlist('32*uint:8')[::-1] 72 | # takes 32 bytes 73 | # apply RS encoding 74 | rs = reedsolo.RSCodec(coded_bytes) 75 | # 32 byte of data + 12 bytes RS 76 | calc_encoded_data = list(rs.encode([x for x in plain_data])) 77 | data.pos = 0 78 | if calc_encoded_data != data.readlist('44*uint:8')[::-1]: 79 | raise FatalError("Error in coding scheme data") 80 | data = data[coded_bytes * 8:] 81 | if blk.len < 8: 82 | data = data[(8 - blk.len) * 32:] 83 | return data 84 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32s3beta2/__init__.py: -------------------------------------------------------------------------------- 1 | from . import operations 2 | from .emulate_efuse_controller import EmulateEfuseController 3 | from .fields import EspEfuses 4 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/esp32s3beta2/emulate_efuse_controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file describes eFuses controller for ESP32-S3(beta2) chip 3 | # 4 | # SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD 5 | # 6 | # SPDX-License-Identifier: GPL-2.0-or-later 7 | 8 | from __future__ import division, print_function 9 | 10 | import reedsolo 11 | 12 | from .mem_definition import EfuseDefineBlocks, EfuseDefineFields, EfuseDefineRegisters 13 | from ..emulate_efuse_controller_base import EmulateEfuseControllerBase, FatalError 14 | 15 | 16 | class EmulateEfuseController(EmulateEfuseControllerBase): 17 | """ The class for virtual ESP32-S3(beta2) operation. Using for HOST_TEST. 18 | """ 19 | CHIP_NAME = "ESP32-S3(beta2)" 20 | mem = None 21 | debug = False 22 | Blocks = EfuseDefineBlocks 23 | Fields = EfuseDefineFields 24 | REGS = EfuseDefineRegisters 25 | 26 | def __init__(self, efuse_file=None, debug=False): 27 | super(EmulateEfuseController, self).__init__(efuse_file, debug) 28 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 29 | 30 | """ esptool method start >>""" 31 | 32 | def get_chip_description(self): 33 | return "" 34 | 35 | def get_crystal_freq(self): 36 | return 40 # MHz (common for all chips) 37 | 38 | """ << esptool method end """ 39 | 40 | def handle_writing_event(self, addr, value): 41 | if addr == self.REGS.EFUSE_CMD_REG: 42 | if value & self.REGS.EFUSE_PGM_CMD: 43 | self.copy_blocks_wr_regs_to_rd_regs(updated_block=(value >> 2) & 0xF) 44 | self.clean_blocks_wr_regs() 45 | self.check_rd_protection_area() 46 | self.write_reg(addr, 0) 47 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 48 | elif value == self.REGS.EFUSE_READ_CMD: 49 | self.write_reg(addr, 0) 50 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 51 | self.save_to_file() 52 | 53 | def get_bitlen_of_block(self, blk, wr=False): 54 | if blk.id == 0: 55 | if wr: 56 | return 32 * 8 57 | else: 58 | return 32 * blk.len 59 | else: 60 | if wr: 61 | rs_coding = 32 * 3 62 | return 32 * 8 + rs_coding 63 | else: 64 | return 32 * blk.len 65 | 66 | def handle_coding_scheme(self, blk, data): 67 | if blk.id != 0: 68 | # CODING_SCHEME RS applied only for all blocks except BLK0. 69 | coded_bytes = 12 70 | data.pos = coded_bytes * 8 71 | plain_data = data.readlist('32*uint:8')[::-1] 72 | # takes 32 bytes 73 | # apply RS encoding 74 | rs = reedsolo.RSCodec(coded_bytes) 75 | # 32 byte of data + 12 bytes RS 76 | calc_encoded_data = list(rs.encode([x for x in plain_data])) 77 | data.pos = 0 78 | if calc_encoded_data != data.readlist('44*uint:8')[::-1]: 79 | raise FatalError("Error in coding scheme data") 80 | data = data[coded_bytes * 8:] 81 | if blk.len < 8: 82 | data = data[(8 - blk.len) * 32:] 83 | return data 84 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/mem_definition_base.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file describes eFuses fields and registers for ESP32 chip 3 | # 4 | # SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD 5 | # 6 | # SPDX-License-Identifier: GPL-2.0-or-later 7 | 8 | from __future__ import division, print_function 9 | 10 | from collections import namedtuple 11 | 12 | 13 | class EfuseRegistersBase(object): 14 | # Coding Scheme values 15 | CODING_SCHEME_NONE = 0 16 | CODING_SCHEME_34 = 1 17 | CODING_SCHEME_REPEAT = 2 18 | CODING_SCHEME_NONE_RECOVERY = 3 19 | CODING_SCHEME_RS = 4 20 | 21 | EFUSE_BURN_TIMEOUT = 0.250 # seconds 22 | 23 | 24 | class EfuseBlocksBase(object): 25 | 26 | BLOCKS = None 27 | NamedtupleBlock = namedtuple('Block', 'name alias id rd_addr wr_addr write_disable_bit read_disable_bit len key_purpose') 28 | 29 | @staticmethod 30 | def get(tuple_block): 31 | return EfuseBlocksBase.NamedtupleBlock._make(tuple_block) 32 | 33 | def get_blocks_for_keys(self): 34 | list_of_names = [] 35 | for block in self.BLOCKS: 36 | blk = self.get(block) 37 | if blk.id > 0: 38 | if blk.name: 39 | list_of_names.append(blk.name) 40 | if blk.alias: 41 | for alias in blk.alias: 42 | list_of_names.append(alias) 43 | return list_of_names 44 | 45 | 46 | class EfuseFieldsBase(object): 47 | 48 | NamedtupleField = namedtuple('Efuse', 'name category block word pos type write_disable_bit read_disable_bit class_type description dictionary') 49 | 50 | @staticmethod 51 | def get(tuple_field): 52 | return EfuseFieldsBase.NamedtupleField._make(tuple_field) 53 | -------------------------------------------------------------------------------- /static/esptool/espressif/efuse/util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file consists of the common useful functions for eFuse 3 | # 4 | # SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD 5 | # 6 | # SPDX-License-Identifier: GPL-2.0-or-later 7 | 8 | from __future__ import division, print_function 9 | 10 | import esptool 11 | 12 | 13 | def hexify(bitstring, separator=""): 14 | try: 15 | as_bytes = tuple(ord(b) for b in bitstring) 16 | except TypeError: # python 3, items in bitstring already ints 17 | as_bytes = tuple(b for b in bitstring) 18 | return separator.join(("%02x" % b) for b in as_bytes) 19 | 20 | 21 | def popcnt(b): 22 | """ Return number of "1" bits set in 'b' """ 23 | return len([x for x in bin(b) if x == "1"]) 24 | 25 | 26 | def check_duplicate_name_in_list(name_list): 27 | duples_name = [name for i, name in enumerate(name_list) if name in name_list[:i]] 28 | if duples_name != []: 29 | raise esptool.FatalError("Found repeated {} in the name list".format(duples_name)) 30 | 31 | 32 | class SdkConfig(object): 33 | def __init__(self, path_to_file): 34 | self.sdkconfig = dict() 35 | if path_to_file is None: 36 | return 37 | with open(path_to_file, 'r') as file: 38 | for line in file.readlines(): 39 | if line.startswith("#"): 40 | continue 41 | config = line.strip().split('=', 1) 42 | if len(config) == 2: 43 | self.sdkconfig[config[0]] = True if config[1] == 'y' else config[1].strip('"') 44 | 45 | def __getitem__(self, config_name): 46 | try: 47 | return self.sdkconfig[config_name] 48 | except KeyError: 49 | return False 50 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/README.md: -------------------------------------------------------------------------------- 1 | This is the source of the software flasher stub. 2 | 3 | esptool.py loads the flasher stub into memory and executes it to: 4 | 5 | * Add features that the Espressif chips bootloader ROMs do not have. 6 | 7 | * Add features to the ESP8266 bootloader ROM which are only in the ROM of newer chips. 8 | 9 | * Improve flashing performance over the ROM bootloaders. 10 | 11 | * Work around bugs in the ESP8266 ROM bootloader. 12 | 13 | Thanks to [Cesanta](http://cesanta.com/) who provided the original ESP8266 stub loader upon which this loader is based. 14 | 15 | # To Use 16 | 17 | The stub loader is already automatically integrated into esptool.py. You don't need to do anything special to use it. 18 | 19 | # To Build 20 | 21 | If you want to build the stub to test modifications or updates, here's how: 22 | 23 | * You will need an ESP8266 gcc toolchain (xtensa-lx106-elf-) and toolchains for ESP32 and later chips (xtensa-esp32-elf-, riscv32-esp-elf-) on your PATH. 24 | 25 | * Set the environment variables SDK_PATH to the path to an ESP8266 IoT NON-OS SDK directory (last stub was built with SDK v1.5.1). 26 | 27 | * Set the environment variable IDF_PATH to the path to an ESP-IDF directory. 28 | 29 | * Set any other environment variables you'd like to override in the Makefile. 30 | 31 | * To build type `make` 32 | 33 | Activating an ESP-IDF environment takes care of most of these steps (only the ESP8266 gcc toolchain has to be manually added to PATH). 34 | 35 | # To Test 36 | 37 | To test the built stub, you can run `make embed`, which will update the stubs in `esptool.py` to the newly compiled ones. Or there are some convenience wrappers to make testing quicker to iterate on: 38 | 39 | * Running `esptool_test_stub.py` is the same as running `esptool.py`, only it uses the just-compiled stubs from the build directory. 40 | 41 | * Running `run_tests_with_stub.py` is the same as running `test/test_esptool.py`, only it uses the just-compiled stubs from the build directory. 42 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/esptool_test_stub.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Trivial wrapper program to run esptool.py using the just-compiled 4 | # flasher stub in the build/ subdirectory 5 | # 6 | # For use when developing new flasher_stubs, not important otherwise. 7 | # 8 | # Copyright (C) 2014-2016 Fredrik Ahlberg, Angus Gratton, other contributors as noted. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it under 11 | # the terms of the GNU General Public License as published by the Free Software 12 | # Foundation; either version 2 of the License, or (at your option) any later version. 13 | # 14 | from __future__ import division, print_function 15 | 16 | import os.path 17 | import sys 18 | 19 | THIS_DIR = os.path.dirname(sys.argv[0]) 20 | 21 | sys.path.append("..") 22 | import esptool # noqa: E402 23 | 24 | 25 | # Python hackiness: evaluate the snippet in the context of the esptool module, so it 26 | # edits the esptool's global variables 27 | exec(open("%s/build/stub_flasher_snippet.py" % THIS_DIR).read(), esptool.__dict__, esptool.__dict__) 28 | 29 | 30 | if __name__ == "__main__": 31 | try: 32 | esptool.main() 33 | except esptool.FatalError as e: 34 | print('\nA fatal error occurred: %s' % e) 35 | sys.exit(2) 36 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/include/slip.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016 Cesanta Software Limited 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD 7 | */ 8 | 9 | #ifndef SLIP_H_ 10 | #define SLIP_H_ 11 | 12 | #include 13 | 14 | /* Send the SLIP frame begin/end delimiter. */ 15 | void SLIP_send_frame_delimiter(void); 16 | 17 | /* Send a single character of SLIP frame data, escaped as per SLIP escaping. */ 18 | void SLIP_send_frame_data(char ch); 19 | 20 | /* Send some SLIP frame data, escaped as per SLIP escaping. */ 21 | void SLIP_send_frame_data_buf(const void *buf, uint32_t size); 22 | 23 | /* Send a full SLIP frame, with specified contents. */ 24 | void SLIP_send(const void *pkt, uint32_t size); 25 | 26 | typedef enum { 27 | SLIP_NO_FRAME, 28 | SLIP_FRAME, 29 | SLIP_FRAME_ESCAPING 30 | } slip_state_t; 31 | 32 | int16_t SLIP_recv_byte(char byte, slip_state_t *state); 33 | 34 | #define SLIP_FINISHED_FRAME -2 35 | #define SLIP_NO_BYTE -1 36 | 37 | /* Receive a SLIP frame, with specified contents. */ 38 | uint32_t SLIP_recv(void *pkt, uint32_t max_len); 39 | 40 | #endif /* SLIP_H_ */ 41 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/include/stub_commands.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | /* Flasher command handlers, called from stub_flasher.c 8 | 9 | Commands related to writing flash are in stub_write_flash_xxx. 10 | */ 11 | #pragma once 12 | #include "stub_flasher.h" 13 | #include "rom_functions.h" 14 | #include 15 | 16 | int handle_flash_erase(uint32_t addr, uint32_t len); 17 | 18 | void handle_flash_read(uint32_t addr, uint32_t len, uint32_t block_size, uint32_t max_in_flight); 19 | 20 | int handle_flash_get_md5sum(uint32_t addr, uint32_t len); 21 | 22 | int handle_flash_read_chip_id(); 23 | 24 | esp_command_error handle_spi_set_params(uint32_t *args, int *status); 25 | 26 | esp_command_error handle_spi_attach(uint32_t hspi_config_arg); 27 | 28 | esp_command_error handle_mem_begin(uint32_t size, uint32_t offset); 29 | 30 | esp_command_error handle_mem_data(void *data, uint32_t length); 31 | 32 | esp_command_error handle_mem_finish(void); 33 | 34 | typedef struct { 35 | uint32_t addr; 36 | uint32_t value; 37 | uint32_t mask; 38 | uint32_t delay_us; 39 | } write_reg_args_t; 40 | 41 | esp_command_error handle_write_reg(const write_reg_args_t *cmd_buf, uint32_t num_commands); 42 | 43 | /* Enabling 32-bit flash memory addressing for ESP32S3 */ 44 | #if defined(ESP32S3) 45 | esp_rom_spiflash_result_t SPIRead4B(int spi_num, SpiFlashRdMode mode, uint32_t flash_addr, uint8_t* buf, int len); 46 | #endif // ESP32S3 47 | 48 | /* Get security info command only on ESP32S2 and later */ 49 | #if ESP32S2_OR_LATER && !ESP32H2BETA2 // TODO: ESPTOOL-350 50 | esp_command_error handle_get_security_info(void); 51 | #endif // ESP32S2_OR_LATER 52 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/include/stub_flasher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016 Cesanta Software Limited 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD 7 | */ 8 | 9 | #ifndef STUB_FLASHER_H_ 10 | #define STUB_FLASHER_H_ 11 | 12 | #include 13 | 14 | /* Maximum write block size, used for various buffers. */ 15 | #define MAX_WRITE_BLOCK 0x4000 16 | 17 | /* Flash geometry constants */ 18 | #define FLASH_SECTOR_SIZE 4096 19 | #define FLASH_BLOCK_SIZE 65536 20 | #define FLASH_PAGE_SIZE 256 21 | #define FLASH_STATUS_MASK 0xFFFF 22 | #define SECTORS_PER_BLOCK (FLASH_BLOCK_SIZE / FLASH_SECTOR_SIZE) 23 | 24 | /* 32-bit addressing is supported only by ESP32S3 */ 25 | #if defined(ESP32S3) 26 | #define FLASH_MAX_SIZE 64*1024*1024 27 | #else 28 | #define FLASH_MAX_SIZE 16*1024*1024 29 | #endif 30 | 31 | /* Full set of protocol commands */ 32 | typedef enum { 33 | /* Commands supported by the ESP8266 & ESP32 bootloaders */ 34 | ESP_FLASH_BEGIN = 0x02, 35 | ESP_FLASH_DATA = 0x03, 36 | ESP_FLASH_END = 0x04, 37 | ESP_MEM_BEGIN = 0x05, 38 | ESP_MEM_END = 0x06, 39 | ESP_MEM_DATA = 0x07, 40 | ESP_SYNC = 0x08, 41 | ESP_WRITE_REG = 0x09, 42 | ESP_READ_REG = 0x0a, 43 | 44 | /* Commands supported by the ESP32 bootloader */ 45 | ESP_SPI_SET_PARAMS = 0x0b, 46 | ESP_PIN_READ = 0x0c, /* ??? */ 47 | ESP_SPI_ATTACH = 0x0d, 48 | ESP_SPI_READ = 0x0e, 49 | ESP_SET_BAUD = 0x0f, 50 | ESP_FLASH_DEFLATED_BEGIN = 0x10, 51 | ESP_FLASH_DEFLATED_DATA = 0x11, 52 | ESP_FLASH_DEFLATED_END = 0x12, 53 | ESP_FLASH_VERIFY_MD5 = 0x13, 54 | 55 | /* Commands supported by the ESP32S2 and later bootloaders */ 56 | ESP_GET_SECURITY_INFO = 0x14, 57 | 58 | /* Stub-only commands */ 59 | ESP_ERASE_FLASH = 0xD0, 60 | ESP_ERASE_REGION = 0xD1, 61 | ESP_READ_FLASH = 0xD2, 62 | ESP_RUN_USER_CODE = 0xD3, 63 | 64 | /* Flash encryption debug mode supported command */ 65 | ESP_FLASH_ENCRYPT_DATA = 0xD4, 66 | } esp_command; 67 | 68 | /* Command request header */ 69 | typedef struct __attribute__((packed)) { 70 | uint8_t zero; 71 | uint8_t op; /* maps to esp_command enum */ 72 | uint16_t data_len; 73 | int32_t checksum; 74 | uint8_t data_buf[32]; /* actually variable length, determined by data_len */ 75 | } esp_command_req_t; 76 | 77 | /* Command response header */ 78 | typedef struct __attribute__((packed)) { 79 | uint8_t resp; /* should be '1' */ 80 | uint8_t op_ret; /* Should match 'op' */ 81 | uint16_t len_ret; /* Length of result data (can be ignored as SLIP framing helps) */ 82 | int32_t value; /* 32-bit response used by some commands */ 83 | } esp_command_response_t; 84 | 85 | 86 | /* command response has some (optional) data after it, then 2 (or 4 on ESP32 ROM) 87 | bytes of status. 88 | */ 89 | typedef struct __attribute__((packed)) { 90 | uint8_t error; /* non-zero = failed */ 91 | uint8_t status; /* status of a failure */ 92 | } esp_command_data_status_t; 93 | 94 | /* Error codes */ 95 | typedef enum { 96 | ESP_OK = 0, 97 | 98 | ESP_BAD_DATA_LEN = 0xC0, 99 | ESP_BAD_DATA_CHECKSUM = 0xC1, 100 | ESP_BAD_BLOCKSIZE = 0xC2, 101 | ESP_INVALID_COMMAND = 0xC3, 102 | ESP_FAILED_SPI_OP = 0xC4, 103 | ESP_FAILED_SPI_UNLOCK = 0xC5, 104 | ESP_NOT_IN_FLASH_MODE = 0xC6, 105 | ESP_INFLATE_ERROR = 0xC7, 106 | ESP_NOT_ENOUGH_DATA = 0xC8, 107 | ESP_TOO_MUCH_DATA = 0xC9, 108 | 109 | ESP_CMD_NOT_IMPLEMENTED = 0xFF, 110 | } esp_command_error; 111 | 112 | #endif /* STUB_FLASHER_H_ */ 113 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/include/stub_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016 Cesanta Software Limited 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD 7 | */ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | /* Call to initialize the I/O (either UART or USB CDC at this point). 15 | * The argument is a callback function which will handle received characters, 16 | * when asynchronous (interrupt-driven) RX is used. 17 | * It will be called in an interrupt context. 18 | */ 19 | void stub_io_init(void(*rx_cb_func)(char)); 20 | 21 | /* Enable or disable asynchronous (interrupt-driven) RX, for UART or USB. 22 | * Currently needed only for the read_flash command. 23 | */ 24 | void stub_rx_async_enable(bool enable); 25 | 26 | /* Wrapper for either uart_tx_one_char or the USB CDC output function. 27 | * (uart_tx_one_char in ROM can also handle USB CDC, but it is really 28 | * slow because it flushes the FIFO after every byte). 29 | */ 30 | void stub_tx_one_char(char c); 31 | 32 | /* A blocking (polling) function to receive one character. 33 | * Should only be used when async (interrupt-driven) RX is disabled. 34 | * Currently only needed for the read_flash command. 35 | */ 36 | char stub_rx_one_char(void); 37 | 38 | /* Returns after making sure that all output has been sent to the host */ 39 | void stub_tx_flush(void); 40 | 41 | /* Updates the baud rate divider based on the current baud rate (from host perspective) 42 | * and the requested baud rate. 43 | * No-op for USB CDC. 44 | */ 45 | void stub_io_set_baudrate(uint32_t current_baud, uint32_t new_baud); 46 | 47 | /* To be called periodically while waiting for a command. 48 | * No-op for UART, handles DTR/RTS reset for USB CDC. 49 | */ 50 | void stub_io_idle_hook(void); 51 | 52 | 53 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/include/stub_write_flash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | /* Flasher commands related to writing flash */ 8 | #pragma once 9 | #include "stub_flasher.h" 10 | #include 11 | #include "rom_functions.h" 12 | 13 | bool is_in_flash_mode(void); 14 | 15 | esp_command_error get_flash_error(void); 16 | 17 | esp_command_error handle_flash_begin(uint32_t total_size, uint32_t offset); 18 | 19 | esp_command_error handle_flash_deflated_begin(uint32_t uncompressed_size, uint32_t compressed_size, uint32_t offset); 20 | 21 | void handle_flash_data(void *data_buf, uint32_t length); 22 | 23 | #if !ESP8266 24 | void handle_flash_encrypt_data(void *data_buf, uint32_t length); 25 | #endif 26 | 27 | void handle_flash_deflated_data(void *data_buf, uint32_t length); 28 | 29 | /* same command used for deflated or non-deflated mode */ 30 | esp_command_error handle_flash_end(void); 31 | 32 | /* Enabling 32-bit flash memory addressing for ESP32S3 */ 33 | #if defined(ESP32S3) 34 | esp_rom_spiflash_result_t page_program_internal(int spi_num, SpiFlashRdMode mode, uint32_t spi_addr, uint8_t* addr_source, uint32_t byte_length); 35 | 36 | esp_rom_spiflash_result_t SPIWrite4B(int spi_num, SpiFlashRdMode mode, uint32_t target, uint8_t *src_addr, int32_t len); 37 | #endif // ESP32S3 38 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/ld/stub_32.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Cesanta Software Limited 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | /* Note: stub is deliberately loaded close to the very top 19 | of available RAM, to reduce change of colliding with anything 20 | else... */ 21 | MEMORY { 22 | iram : org = 0x400BE000, len = 0x1000 23 | dram : org = 0x3ffcc000, len = 0x14000 24 | } 25 | 26 | ENTRY(stub_main) 27 | 28 | SECTIONS { 29 | .text : ALIGN(4) { 30 | *(.literal) 31 | *(.text .text.*) 32 | } > iram 33 | 34 | .bss : ALIGN(4) { 35 | _bss_start = ABSOLUTE(.); 36 | *(.bss) 37 | _bss_end = ABSOLUTE(.); 38 | } > dram 39 | 40 | .data : ALIGN(4) { 41 | *(.data) 42 | *(.rodata .rodata.*) 43 | } > dram 44 | } 45 | 46 | INCLUDE "rom_32.ld" 47 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/ld/stub_32c2.ld: -------------------------------------------------------------------------------- 1 | MEMORY { 2 | iram : org = 0x40380000, len = 0x4000 3 | dram : org = 0x3FCA4000, len = 0x18000 4 | } 5 | 6 | ENTRY(stub_main) 7 | 8 | SECTIONS { 9 | .text : ALIGN(4) { 10 | *(.literal) 11 | *(.text .text.*) 12 | } > iram 13 | 14 | .bss : ALIGN(4) { 15 | _bss_start = ABSOLUTE(.); 16 | *(.bss) 17 | _bss_end = ABSOLUTE(.); 18 | } > dram 19 | 20 | .data : ALIGN(4) { 21 | *(.data) 22 | *(.rodata .rodata.*) 23 | } > dram 24 | } 25 | 26 | INCLUDE "rom_32c2.ld" 27 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/ld/stub_32c3.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | MEMORY { 8 | iram : org = 0x40380000, len = 0x4000 9 | dram : org = 0x3FC84000, len = 0x18000 10 | } 11 | 12 | ENTRY(stub_main) 13 | 14 | SECTIONS { 15 | .text : ALIGN(4) { 16 | *(.literal) 17 | *(.text .text.*) 18 | } > iram 19 | 20 | .bss : ALIGN(4) { 21 | _bss_start = ABSOLUTE(.); 22 | *(.bss) 23 | _bss_end = ABSOLUTE(.); 24 | } > dram 25 | 26 | .data : ALIGN(4) { 27 | *(.data) 28 | *(.rodata .rodata.*) 29 | } > dram 30 | } 31 | 32 | INCLUDE "rom_32c3.ld" 33 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/ld/stub_32c6_beta.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | MEMORY { 8 | iram : org = 0x40380000, len = 0x4000 9 | dram : org = 0x3FC84000, len = 0x18000 10 | } 11 | 12 | ENTRY(stub_main) 13 | 14 | SECTIONS { 15 | .text : ALIGN(4) { 16 | *(.literal) 17 | *(.text .text.*) 18 | } > iram 19 | 20 | .bss : ALIGN(4) { 21 | _bss_start = ABSOLUTE(.); 22 | *(.bss) 23 | _bss_end = ABSOLUTE(.); 24 | } > dram 25 | 26 | .data : ALIGN(4) { 27 | *(.data) 28 | *(.rodata .rodata.*) 29 | } > dram 30 | } 31 | 32 | INCLUDE "rom_32c6_beta.ld" 33 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/ld/stub_32h2_beta_1.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | MEMORY { 8 | iram : org = 0x40380000, len = 0x4000 9 | dram : org = 0x3FC84000, len = 0x18000 10 | } 11 | 12 | ENTRY(stub_main) 13 | 14 | SECTIONS { 15 | .text : ALIGN(4) { 16 | *(.literal) 17 | *(.text .text.*) 18 | } > iram 19 | 20 | .bss : ALIGN(4) { 21 | _bss_start = ABSOLUTE(.); 22 | *(.bss) 23 | _bss_end = ABSOLUTE(.); 24 | } > dram 25 | 26 | .data : ALIGN(4) { 27 | *(.data) 28 | *(.rodata .rodata.*) 29 | } > dram 30 | } 31 | 32 | INCLUDE "rom_32h2_beta_1.ld" 33 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/ld/stub_32h2_beta_2.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | MEMORY { 8 | iram : org = 0x40380000, len = 0x4000 9 | dram : org = 0x3FC84000, len = 0x18000 10 | } 11 | 12 | ENTRY(stub_main) 13 | 14 | SECTIONS { 15 | .text : ALIGN(4) { 16 | *(.literal) 17 | *(.text .text.*) 18 | } > iram 19 | 20 | .bss : ALIGN(4) { 21 | _bss_start = ABSOLUTE(.); 22 | *(.bss) 23 | _bss_end = ABSOLUTE(.); 24 | } > dram 25 | 26 | .data : ALIGN(4) { 27 | *(.data) 28 | *(.rodata .rodata.*) 29 | } > dram 30 | } 31 | 32 | INCLUDE "rom_32h2_beta_2.ld" 33 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/ld/stub_32s2.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | MEMORY { 8 | iram : org = 0x40028000, len = 0x18000 9 | dram : org = 0x3FFD0000, len = 0x28000 10 | } 11 | 12 | ENTRY(stub_main) 13 | 14 | SECTIONS { 15 | .text : ALIGN(4) { 16 | *(.literal) 17 | *(.text .text.*) 18 | } > iram 19 | 20 | .bss : ALIGN(4) { 21 | _bss_start = ABSOLUTE(.); 22 | *(.bss) 23 | _bss_end = ABSOLUTE(.); 24 | } > dram 25 | 26 | .data : ALIGN(4) { 27 | *(.data) 28 | *(.rodata .rodata.*) 29 | } > dram 30 | } 31 | 32 | INCLUDE "rom_32s2.ld" 33 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/ld/stub_32s3.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | MEMORY { 8 | iram : org = 0x40378000, len = 0x18000 9 | dram : org = 0x3FCA0000, len = 0x28000 10 | } 11 | 12 | ENTRY(stub_main) 13 | 14 | SECTIONS { 15 | .text : ALIGN(4) { 16 | *(.literal) 17 | *(.text .text.*) 18 | } > iram 19 | 20 | .bss : ALIGN(4) { 21 | _bss_start = ABSOLUTE(.); 22 | *(.bss) 23 | _bss_end = ABSOLUTE(.); 24 | } > dram 25 | 26 | .data : ALIGN(4) { 27 | *(.data) 28 | *(.rodata .rodata.*) 29 | } > dram 30 | } 31 | 32 | INCLUDE "rom_32s3.ld" 33 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/ld/stub_32s3_beta_2.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | MEMORY { 8 | iram : org = 0x40378000, len = 0x18000 9 | dram : org = 0x3FCA0000, len = 0x28000 10 | } 11 | 12 | ENTRY(stub_main) 13 | 14 | SECTIONS { 15 | .text : ALIGN(4) { 16 | *(.literal) 17 | *(.text .text.*) 18 | } > iram 19 | 20 | .bss : ALIGN(4) { 21 | _bss_start = ABSOLUTE(.); 22 | *(.bss) 23 | _bss_end = ABSOLUTE(.); 24 | } > dram 25 | 26 | .data : ALIGN(4) { 27 | *(.data) 28 | *(.rodata .rodata.*) 29 | } > dram 30 | } 31 | 32 | INCLUDE "rom_32s3_beta_2.ld" 33 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/ld/stub_8266.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Cesanta Software Limited 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | /* Note: stub is deliberately loaded close to the very top 19 | of available RAM, to reduce change of colliding with anything 20 | else... */ 21 | MEMORY { 22 | iram : org = 0x4010D000, len = 0x2100 23 | dram : org = 0x3FFE8100, len = 0x13f00 24 | } 25 | 26 | ENTRY(stub_main_8266) 27 | 28 | SECTIONS { 29 | .text : ALIGN(4) { 30 | *(.literal) 31 | *(.text .text.*) 32 | } > iram 33 | 34 | .bss : ALIGN(4) { 35 | _bss_start = ABSOLUTE(.); 36 | *(.bss) 37 | _bss_end = ABSOLUTE(.); 38 | } > dram 39 | 40 | .data : ALIGN(4) { 41 | *(.data) 42 | *(.rodata .rodata.*) 43 | } > dram 44 | } 45 | 46 | INCLUDE "rom_8266.ld" 47 | 48 | PROVIDE(SPIFlashModeConfig = 0x40004568); 49 | PROVIDE(SPIParamCfg = 0x40004c2c); 50 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/run_tests_with_stub.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Run test/test_esptool.py using the newly compiled stub, for quick tests 4 | # 5 | # Usage same as test/test_esptool.py 6 | [ -z $PYTHON ] && PYTHON=python 7 | 8 | THISDIR=`realpath -m $(dirname $0)` 9 | 10 | export ESPTOOL_PY="${THISDIR}/esptool_test_stub.py" 11 | ${PYTHON} ${THISDIR}/../test/test_esptool.py $@ 12 | -------------------------------------------------------------------------------- /static/esptool/flasher_stub/slip.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016 Cesanta Software Limited 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD 7 | */ 8 | 9 | #include 10 | #include "slip.h" 11 | #include "stub_io.h" 12 | 13 | void SLIP_send_frame_delimiter(void) { 14 | stub_tx_one_char('\xc0'); 15 | } 16 | 17 | void SLIP_send_frame_data(char ch) { 18 | if(ch == '\xc0') { 19 | stub_tx_one_char('\xdb'); 20 | stub_tx_one_char('\xdc'); 21 | } else if (ch == '\xdb') { 22 | stub_tx_one_char('\xdb'); 23 | stub_tx_one_char('\xdd'); 24 | } else { 25 | stub_tx_one_char(ch); 26 | } 27 | } 28 | 29 | void SLIP_send_frame_data_buf(const void *buf, uint32_t size) { 30 | const uint8_t *buf_c = (const uint8_t *)buf; 31 | for(int i = 0; i < size; i++) { 32 | SLIP_send_frame_data(buf_c[i]); 33 | } 34 | } 35 | 36 | void SLIP_send(const void *pkt, uint32_t size) { 37 | SLIP_send_frame_delimiter(); 38 | SLIP_send_frame_data_buf(pkt, size); 39 | SLIP_send_frame_delimiter(); 40 | } 41 | 42 | int16_t SLIP_recv_byte(char byte, slip_state_t *state) 43 | { 44 | if (byte == '\xc0') { 45 | if (*state == SLIP_NO_FRAME) { 46 | *state = SLIP_FRAME; 47 | return SLIP_NO_BYTE; 48 | } else { 49 | *state = SLIP_NO_FRAME; 50 | return SLIP_FINISHED_FRAME; 51 | } 52 | } 53 | 54 | switch(*state) { 55 | case SLIP_NO_FRAME: 56 | return SLIP_NO_BYTE; 57 | case SLIP_FRAME: 58 | if (byte == '\xdb') { 59 | *state = SLIP_FRAME_ESCAPING; 60 | return SLIP_NO_BYTE; 61 | } 62 | return byte; 63 | case SLIP_FRAME_ESCAPING: 64 | if (byte == '\xdc') { 65 | *state = SLIP_FRAME; 66 | return '\xc0'; 67 | } 68 | if (byte == '\xdd') { 69 | *state = SLIP_FRAME; 70 | return '\xdb'; 71 | } 72 | return SLIP_NO_BYTE; /* actually a framing error */ 73 | } 74 | return SLIP_NO_BYTE; /* actually a framing error */ 75 | } 76 | 77 | /* This function is needed for the synchornous I/O case, 78 | * which is only flash_read command at the moment. 79 | */ 80 | uint32_t SLIP_recv(void *pkt, uint32_t max_len) { 81 | uint32_t len = 0; 82 | slip_state_t state = SLIP_NO_FRAME; 83 | uint8_t *p = (uint8_t *) pkt; 84 | 85 | int16_t r; 86 | do { 87 | r = SLIP_recv_byte(stub_rx_one_char(), &state); 88 | if(r >= 0 && len < max_len) { 89 | p[len++] = (uint8_t)r; 90 | } 91 | } while(r != SLIP_FINISHED_FRAME); 92 | 93 | return len; 94 | } 95 | -------------------------------------------------------------------------------- /static/esptool/setup.cfg: -------------------------------------------------------------------------------- 1 | [flake8] 2 | exclude = ecdsa,.git,__pycache__,.eggs,build 3 | max-line-length = 160 4 | ignore = 5 | # multiple spaces before operator - used for visual indent of constants in some files 6 | E221, 7 | 8 | # various future imports we don't need: absolute_import, with_statement, unicode_literals, generator_stop 9 | # nested_scopes, generators, annotations 10 | # 11 | # See https://pypi.org/project/flake8-future-import/ for list 12 | FI11, FI12, FI14, FI15, FI16, FI17, FI18, 13 | 14 | # future imports we do need: division, print_function 15 | FI50, FI53, 16 | per-file-ignores = 17 | # tests often manipulate sys.path before importing the main tools, so ignore import order violations 18 | test/*.py: E402, 19 | 20 | # multiple spaces after ',' - used for visual layout of eFuse data 21 | espressif/efuse/*/mem_definition.py: E241, 22 | espressif/efuse/*/fields.py: E241, 23 | 24 | # don't require future imports or check for unused imports in __init__.py files 25 | __init__.py: FI10, FI13, F401 26 | test/sitecustomize.py: FI10, FI13 27 | docs/conf_common.py: FI10, FI13, F405 28 | docs/en/conf.py: FI10, FI13 29 | -------------------------------------------------------------------------------- /static/esptool/test/.covconf: -------------------------------------------------------------------------------- 1 | [run] 2 | parallel = true 3 | -------------------------------------------------------------------------------- /static/esptool/test/README.md: -------------------------------------------------------------------------------- 1 | # esptool.py test cases README 2 | 3 | # test_elf2image.py 4 | 5 | Exists to catch unexpected changes in elf2image or image_info output. Does not require an ESP8266 to verify. 6 | 7 | ## About Tests 8 | 9 | Test method is fairly lo-fi: 10 | 11 | Directory test/elf2image/ contains subdirectories esp8266-v1, esp8266-v2 and esp32. These contain test cases. 12 | 13 | Each test case is a .elf file, which is stored alongside one or more .bin files representing the output of elf2image, and one .txt file representing the output of image_info when reading back the binary. 14 | 15 | Default run of test_elf2image.py will re-run elf2image & image_info on all these images. Suitable --chip and --version args are supplied, determined by the directory name. 16 | 17 | The test runner verifies that nothing in the output of either command has changed. 18 | 19 | ## Dealing With Output Changes 20 | 21 | If changes are detected, we can check if valid images are still being produced. If the changes turn out to be OK, running "test_elf2image.py --regen" will regenerate all of the .bin and .txt files for the test cases. 22 | 23 | (--regen can also be used to evaluate test failures, by looking at git diff output.) 24 | 25 | -------------------------------------------------------------------------------- /static/esptool/test/ci/multirun_with_pyenv.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # 3 | # Tool for running scripts with several versions of Python by the use of pyenv (versions must be installed before in 4 | # the docker image) 5 | # 6 | # Examples: 7 | # ./multirun_with_pyenv.sh ./exec.sh # Run ./exec.h with ALL installed versions of Python 8 | # ./multirun_with_pyenv.sh ./exec.sh arg1 arg2 # Run ./exec.h with arguments (and ALL installed versions of Python) 9 | # ./multirun_with_pyenv.sh -p 2.7.15 ./exec.sh # Run ./exec.h with Python 2.7.15 (-p must be the first argument) 10 | # ./multirun_with_pyenv.sh -p 3.4.8,2.7.15 ./exec.sh # Run ./exec.h with Python 3.4.8 and 2.7.15 (versions must be 11 | # # separated by coma and be without a space) 12 | 13 | PY_VERSIONS="" 14 | 15 | { source /opt/pyenv/activate; } || { echo 'Pyenv activation has failed!' ; exit 1; } 16 | 17 | if [ "$1" = "-p" ]; then 18 | if [ "$#" -ge 2 ]; then 19 | IFS=',' read -a PY_VERSIONS <<< "$2" 20 | shift #remove -p 21 | shift #remove argument after -p 22 | else 23 | echo 'No value (Python version) is given for argument -p!' 24 | exit 1 25 | fi 26 | else 27 | PY_VERSIONS=$(pyenv versions --bare) 28 | fi 29 | 30 | if [ "$#" -lt 1 ]; then 31 | echo 'No executable was passed to the runner!' 32 | exit 1 33 | fi 34 | 35 | for ver in ${PY_VERSIONS[@]} 36 | do 37 | echo 'Switching to Python' $ver 38 | $(pyenv global $ver) || exit 1 39 | echo 'Running' $@ 40 | $@ || { 41 | echo 'Run failed! Switching back to the system version of the Python interpreter.'; 42 | pyenv global system; 43 | exit 1; 44 | } 45 | done 46 | 47 | echo 'Switching back to the system version of Python' 48 | # if the global python is not installed the script will log a warning and finish with zero return code 49 | { pyenv global system; } || { echo 'Restoring the system version of the Python interpreter has failed!' ;} 50 | -------------------------------------------------------------------------------- /static/esptool/test/ci/setup_ci_build_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -exuo pipefail 4 | 5 | ESP8266_TOOLCHAIN_URL="https://dl.espressif.com/dl/xtensa-lx106-elf-linux64-1.22.0-92-g8facf4c-5.2.0.tar.gz" 6 | ESP32_TOOLCHAIN_URL="https://dl.espressif.com/dl/xtensa-esp32-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz" 7 | ESP32S2_TOOLCHAIN_URL="https://dl.espressif.com/dl/xtensa-esp32s2-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz" 8 | ESP32S3_TOOLCHAIN_URL="https://dl.espressif.com/dl/xtensa-esp32s3-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz" 9 | ESP32C3_TOOLCHAIN_URL="https://dl.espressif.com/dl/toolchains/preview/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-linux-amd64.tar.gz" 10 | 11 | # Setup shell script to download & configure ESP8266 & ESP32 toolchains 12 | # for building the flasher stub program 13 | 14 | mkdir -p ${TOOLCHAIN_DIR} 15 | cd ${TOOLCHAIN_DIR} 16 | 17 | if ! [ -d ${ESP8266_BINDIR} ]; then 18 | wget --continue --no-verbose "${ESP8266_TOOLCHAIN_URL}" 19 | tar zxf $(basename ${ESP8266_TOOLCHAIN_URL}) 20 | fi 21 | 22 | if ! [ -d ${ESP32_BINDIR} ]; then 23 | # gitlab CI image may already have this file 24 | wget --continue --no-verbose "${ESP32_TOOLCHAIN_URL}" 25 | tar zxf $(basename ${ESP32_TOOLCHAIN_URL}) 26 | fi 27 | 28 | if ! [ -d ${ESP32S2_BINDIR} ]; then 29 | # gitlab CI image may already have this file 30 | wget --continue --no-verbose "${ESP32S2_TOOLCHAIN_URL}" 31 | tar zxf $(basename ${ESP32S2_TOOLCHAIN_URL}) 32 | fi 33 | 34 | if ! [ -d ${ESP32S3_BINDIR} ]; then 35 | # gitlab CI image may already have this file 36 | wget --continue --no-verbose "${ESP32S3_TOOLCHAIN_URL}" 37 | tar zxf $(basename ${ESP32S3_TOOLCHAIN_URL}) 38 | fi 39 | 40 | if ! [ -d ${ESP32C3_BINDIR} ]; then 41 | # gitlab CI image may already have this file 42 | wget --continue --no-verbose "${ESP32C3_TOOLCHAIN_URL}" 43 | tar zxf $(basename ${ESP32C3_TOOLCHAIN_URL}) 44 | fi 45 | -------------------------------------------------------------------------------- /static/esptool/test/ecdsa_secure_boot_signing_key2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIINRYjKaXM0dQJn4FLwoHYj3ovmpRee7UWv8ksQ9IS2toAoGCCqGSM49 3 | AwEHoUQDQgAEYWCmqAxxAmbr8cZk4AjTYkQJ0pCZOsESk2bPAe6lrzHrFKKR2t2W 4 | ge+cNvXU2dYswEdgWr/fdnyAbHHEVEBSrA== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /static/esptool/test/efuse_scripts/efuse_burn1.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | import json 7 | 8 | config = json.load(args.configfiles[0]) 9 | 10 | 11 | assert args.index == 10, 'Index should be 10' 12 | 13 | for cmd in config['burn_efuses1']: 14 | cmd = cmd.format(index=args.index) 15 | print(cmd) 16 | espefuse(esp, efuses, args, cmd) 17 | 18 | assert args.index == 10, 'Index should be 10' 19 | -------------------------------------------------------------------------------- /static/esptool/test/efuse_scripts/efuse_burn2.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | import json 7 | 8 | config = json.load(args.configfiles[0]) 9 | 10 | 11 | assert args.index == 28, 'Should be index from the first script = 28' 12 | 13 | for cmd in config['burn_efuses2']: 14 | cmd = cmd.format(index=args.index) 15 | print(cmd) 16 | espefuse(esp, efuses, args, cmd) 17 | 18 | assert args.index == 28, 'Should be index from the first script = 28' 19 | -------------------------------------------------------------------------------- /static/esptool/test/efuse_scripts/esp32/config1.json: -------------------------------------------------------------------------------- 1 | { 2 | "burn_efuses1": [ 3 | "burn_bit BLOCK3 0 1 2 3 4 5 6 7 8 9 {index}", 4 | "burn_bit BLOCK3 29 30 31" 5 | ] 6 | } -------------------------------------------------------------------------------- /static/esptool/test/efuse_scripts/esp32/config2.json: -------------------------------------------------------------------------------- 1 | { 2 | "burn_efuses2": [ 3 | "burn_bit BLOCK3 11 12 13 14 15 16 17 18 19", 4 | "burn_bit BLOCK3 20 21 22 23 24 25 26 27 {index}", 5 | "execute_scripts efuse_scripts/efuse_burn1.py --index 10 --configfiles efuse_scripts/esp32/config1.json", 6 | "burn_bit BLOCK2 {index}" 7 | ] 8 | } -------------------------------------------------------------------------------- /static/esptool/test/efuse_scripts/esp32/test_efuse_script.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | espefuse(esp, efuses, args, "burn_efuse JTAG_DISABLE 1 DISABLE_SDIO_HOST 1 CONSOLE_DEBUG_DISABLE 1") 3 | espefuse(esp, efuses, args, "burn_key flash_encryption ../../images/efuse/256bit --no-protect-key") 4 | espefuse(esp, efuses, args, "burn_key_digest ../../secure_images/rsa_secure_boot_signing_key.pem") 5 | espefuse(esp, efuses, args, "burn_bit BLOCK3 64 66 69 72 78 82 83 90") 6 | espefuse(esp, efuses, args, "burn_custom_mac AA:BB:CC:DD:EE:88") 7 | 8 | efuses.burn_all() 9 | 10 | espefuse(esp, efuses, args, "summary") 11 | espefuse(esp, efuses, args, "adc_info") 12 | espefuse(esp, efuses, args, "get_custom_mac") 13 | 14 | 15 | # Checks written eFuses 16 | if efuses["JTAG_DISABLE"].get() != 1: 17 | raise esptool.FatalError("JTAG_DISABLE was not set") 18 | if efuses["DISABLE_SDIO_HOST"].get() != 1: 19 | raise esptool.FatalError("DISABLE_SDIO_HOST was not set") 20 | if efuses["CONSOLE_DEBUG_DISABLE"].get() != 1: 21 | raise esptool.FatalError("CONSOLE_DEBUG_DISABLE was not set") 22 | 23 | 24 | if efuses["BLOCK1"].get_meaning() != "bf be bd bc bb ba b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 af ae ad ac ab aa a9 a8 a7 a6 a5 a4 a3 a2 a1 a0": 25 | raise esptool.FatalError("BLOCK1 was not set correctly") 26 | 27 | if not efuses["BLOCK1"].is_readable() or not efuses["BLOCK1"].is_writeable(): 28 | raise esptool.FatalError("BLOCK1 should be readable and writeable") 29 | 30 | 31 | if efuses["BLOCK2"].get_meaning() != "cb 27 91 a3 71 b0 c0 32 2b f7 37 04 78 ba 09 62 22 4c ab 1c f2 28 78 79 e4 29 67 3e 7d a8 44 63": 32 | raise esptool.FatalError("BLOCK2 was not set correctly") 33 | 34 | if not efuses["BLOCK2"].is_readable() or efuses["BLOCK2"].is_writeable(): 35 | raise esptool.FatalError("BLOCK2 should not be readable and not writeable") 36 | 37 | 38 | if efuses["BLOCK3"].get_meaning() != "69 aa bb cc dd ee 88 00 25 41 0c 04 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00": 39 | raise esptool.FatalError("BLOCK3 was not set correctly") 40 | 41 | if efuses["CUSTOM_MAC"].get_meaning() != "aa:bb:cc:dd:ee:88 (CRC 0x69 OK)": 42 | raise esptool.FatalError("CUSTOM_MAC was not set correctly") 43 | 44 | 45 | espefuse(esp, efuses, args, "read_protect_efuse BLOCK1") 46 | espefuse(esp, efuses, args, "write_protect_efuse BLOCK1") 47 | efuses.burn_all() 48 | if efuses["BLOCK1"].is_readable() or efuses["BLOCK1"].is_writeable(): 49 | raise esptool.FatalError("BLOCK_KEY0 should be not readable and not writeable") 50 | -------------------------------------------------------------------------------- /static/esptool/test/efuse_scripts/esp32/test_efuse_script2.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | espefuse(esp, efuses, args, "burn_efuse JTAG_DISABLE 1 DISABLE_SDIO_HOST 1 CONSOLE_DEBUG_DISABLE 1") 3 | if efuses["JTAG_DISABLE"].get() != 0: 4 | raise esptool.FatalError("Burn should be at the end") 5 | 6 | espefuse(esp, efuses, args, "burn_key flash_encryption ../../images/efuse/256bit --no-protect-key") 7 | if efuses["BLOCK1"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00": 8 | raise esptool.FatalError("Burn should be at the end") 9 | if not efuses["BLOCK1"].is_readable() or not efuses["BLOCK1"].is_writeable(): 10 | raise esptool.FatalError("Burn should be at the end") 11 | 12 | espefuse(esp, efuses, args, "burn_key_digest ../../secure_images/rsa_secure_boot_signing_key.pem") 13 | if efuses["BLOCK2"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00": 14 | raise esptool.FatalError("Burn should be at the end") 15 | if not efuses["BLOCK2"].is_readable() or not efuses["BLOCK2"].is_writeable(): 16 | raise esptool.FatalError("Burn should be at the end") 17 | 18 | espefuse(esp, efuses, args, "burn_bit BLOCK3 64 66 69 72 78 82 83 90") 19 | espefuse(esp, efuses, args, "burn_custom_mac AA:BB:CC:DD:EE:88") 20 | 21 | if efuses["BLOCK3"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00": 22 | raise esptool.FatalError("Burn should be at the end") 23 | -------------------------------------------------------------------------------- /static/esptool/test/efuse_scripts/esp32xx/config1.json: -------------------------------------------------------------------------------- 1 | { 2 | "burn_efuses1": [ 3 | "burn_bit BLOCK_KEY4 0 1 2 3 4 5 6 7 8 9 {index}", 4 | "burn_bit BLOCK_KEY4 29 30 31" 5 | ] 6 | } -------------------------------------------------------------------------------- /static/esptool/test/efuse_scripts/esp32xx/config2.json: -------------------------------------------------------------------------------- 1 | { 2 | "burn_efuses2": [ 3 | "burn_bit BLOCK_KEY4 11 12 13 14 15 16 17 18 19", 4 | "burn_bit BLOCK_KEY4 20 21 22 23 24 25 26 27 {index}", 5 | "execute_scripts efuse_scripts/efuse_burn1.py --index 10 --configfiles efuse_scripts/esp32xx/config1.json", 6 | "burn_bit BLOCK_KEY3 {index}" 7 | ] 8 | } -------------------------------------------------------------------------------- /static/esptool/test/efuse_scripts/esp32xx/test_efuse_script.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | espefuse(esp, efuses, args, 'burn_efuse DIS_FORCE_DOWNLOAD 1 DIS_CAN 1 DIS_USB_DOWNLOAD_MODE 1') 3 | espefuse(esp, efuses, args, 'burn_bit BLOCK_USR_DATA 64 66 69 72 78 82 83 90') 4 | espefuse(esp, efuses, args, 'read_protect_efuse BLOCK_SYS_DATA2') 5 | espefuse(esp, efuses, args, 'write_protect_efuse BLOCK_SYS_DATA2') 6 | espefuse(esp, efuses, args, 'burn_block_data BLOCK_KEY5 ../../images/efuse/256bit') 7 | espefuse(esp, efuses, args, 'burn_key BLOCK_KEY0 ../../images/efuse/256bit XTS_AES_256_KEY_1 --no-read-protect') 8 | espefuse(esp, efuses, args, 'burn_key_digest BLOCK_KEY1 ../../secure_images/rsa_secure_boot_signing_key.pem SECURE_BOOT_DIGEST0') 9 | 10 | efuses.burn_all() 11 | 12 | espefuse(esp, efuses, args, 'summary') 13 | espefuse(esp, efuses, args, 'adc_info') 14 | 15 | 16 | # Checks written eFuses 17 | if efuses["DIS_FORCE_DOWNLOAD"].get() != 1: 18 | raise esptool.FatalError("DIS_FORCE_DOWNLOAD was not set") 19 | if efuses["DIS_CAN"].get() != 1: 20 | raise esptool.FatalError("DIS_CAN was not set") 21 | if efuses["DIS_USB_DOWNLOAD_MODE"].get() != 1: 22 | raise esptool.FatalError("DIS_USB_DOWNLOAD_MODE was not set") 23 | 24 | if efuses["BLOCK_USR_DATA"].get_meaning() != "00 00 00 00 00 00 00 00 25 41 0c 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00": 25 | raise esptool.FatalError("BLOCK_USR_DATA was not set correctly") 26 | 27 | 28 | if efuses["BLOCK_SYS_DATA2"].is_readable() or efuses["BLOCK_SYS_DATA2"].is_writeable(): 29 | raise esptool.FatalError("BLOCK_SYS_DATA2 should be read and write protected") 30 | 31 | 32 | if efuses["BLOCK_KEY5"].get_meaning() != "a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf": 33 | raise esptool.FatalError("BLOCK_KEY5 was not set correctly") 34 | 35 | 36 | if efuses["BLOCK_KEY0"].get_meaning() != "bf be bd bc bb ba b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 af ae ad ac ab aa a9 a8 a7 a6 a5 a4 a3 a2 a1 a0": 37 | raise esptool.FatalError("BLOCK_KEY0 was not set correctly") 38 | 39 | if not efuses["BLOCK_KEY0"].is_readable() or efuses["BLOCK_KEY0"].is_writeable(): 40 | raise esptool.FatalError("BLOCK_KEY0 should be readable and not writable") 41 | 42 | if efuses["KEY_PURPOSE_0"].get_meaning() != "XTS_AES_256_KEY_1": 43 | raise esptool.FatalError("KEY_PURPOSE_0 was not set XTS_AES_256_KEY_1") 44 | 45 | if efuses["KEY_PURPOSE_0"].is_writeable(): 46 | raise esptool.FatalError("KEY_PURPOSE_0 should be write-protected") 47 | 48 | 49 | if efuses["BLOCK_KEY1"].get_meaning() != "cb 27 91 a3 71 b0 c0 32 2b f7 37 04 78 ba 09 62 22 4c ab 1c f2 28 78 79 e4 29 67 3e 7d a8 44 63": 50 | raise esptool.FatalError("BLOCK_KEY1 was not set correctly") 51 | 52 | if efuses["KEY_PURPOSE_1"].get_meaning() != "SECURE_BOOT_DIGEST0": 53 | raise esptool.FatalError("KEY_PURPOSE_1 was not set SECURE_BOOT_DIGEST0") 54 | 55 | if efuses["KEY_PURPOSE_1"].is_writeable(): 56 | raise esptool.FatalError("KEY_PURPOSE_1 should be write-protected") 57 | 58 | if not efuses["BLOCK_KEY1"].is_readable() or efuses["BLOCK_KEY1"].is_writeable(): 59 | raise esptool.FatalError("BLOCK_KEY1 should be readable and not writable") 60 | 61 | 62 | espefuse(esp, efuses, args, 'burn_key BLOCK_KEY0 ../../images/efuse/256bit XTS_AES_256_KEY_1') 63 | efuses.burn_all() 64 | if efuses["BLOCK_KEY0"].is_readable() or efuses["BLOCK_KEY0"].is_writeable(): 65 | raise esptool.FatalError("BLOCK_KEY0 should be not readable and not writeable") 66 | -------------------------------------------------------------------------------- /static/esptool/test/efuse_scripts/esp32xx/test_efuse_script2.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | espefuse(esp, efuses, args, 'burn_efuse DIS_FORCE_DOWNLOAD 1 DIS_CAN 1 DIS_USB_DOWNLOAD_MODE 1') 3 | if efuses["DIS_FORCE_DOWNLOAD"].get() != 0: 4 | raise esptool.FatalError("Burn should be at the end") 5 | 6 | espefuse(esp, efuses, args, 'burn_bit BLOCK_USR_DATA 64 66 69 72 78 82 83 90') 7 | if efuses["BLOCK_USR_DATA"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00": 8 | raise esptool.FatalError("Burn should be at the end") 9 | 10 | espefuse(esp, efuses, args, 'read_protect_efuse BLOCK_SYS_DATA2') 11 | espefuse(esp, efuses, args, 'write_protect_efuse BLOCK_SYS_DATA2') 12 | if not efuses["BLOCK_SYS_DATA2"].is_readable() or not efuses["BLOCK_SYS_DATA2"].is_writeable(): 13 | raise esptool.FatalError("Burn should be at the end") 14 | 15 | espefuse(esp, efuses, args, 'burn_block_data BLOCK_KEY5 ../../images/efuse/256bit') 16 | if efuses["BLOCK_KEY5"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00": 17 | raise esptool.FatalError("Burn should be at the end") 18 | 19 | espefuse(esp, efuses, args, 'burn_key BLOCK_KEY0 ../../images/efuse/256bit XTS_AES_256_KEY_1 --no-read-protect') 20 | if efuses["BLOCK_KEY0"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00": 21 | raise esptool.FatalError("Burn should be at the end") 22 | if not efuses["BLOCK_KEY0"].is_readable() or not efuses["BLOCK_KEY0"].is_writeable(): 23 | raise esptool.FatalError("Burn should be at the end") 24 | 25 | espefuse(esp, efuses, args, 'burn_key_digest BLOCK_KEY1 ../../secure_images/rsa_secure_boot_signing_key.pem SECURE_BOOT_DIGEST0') 26 | if efuses["BLOCK_KEY1"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00": 27 | raise esptool.FatalError("Burn should be at the end") 28 | if not efuses["BLOCK_KEY1"].is_readable() or not efuses["BLOCK_KEY1"].is_writeable(): 29 | raise esptool.FatalError("Burn should be at the end") 30 | -------------------------------------------------------------------------------- /static/esptool/test/elf2image/esp32-app-cust-ver-info.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/elf2image/esp32-app-cust-ver-info.elf -------------------------------------------------------------------------------- /static/esptool/test/elf2image/esp32-app-template.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/elf2image/esp32-app-template.elf -------------------------------------------------------------------------------- /static/esptool/test/elf2image/esp32-bootloader.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/elf2image/esp32-bootloader.elf -------------------------------------------------------------------------------- /static/esptool/test/elf2image/esp32-too-many-sections.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/elf2image/esp32-too-many-sections.elf -------------------------------------------------------------------------------- /static/esptool/test/elf2image/esp32-too-many-sections/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for generating and compiling an Xtensa-ESP32 ELF file that has a lot 2 | # (too many) sections. 3 | # 4 | # To generate the C file and compile it, simply use the following command: 5 | # make 6 | 7 | # Adjustable parameters 8 | BASH=/bin/bash 9 | SECTIONS_COUNT=350 10 | 11 | # Do not touch the following variables 12 | CC=xtensa-esp32-elf-gcc 13 | CFLAGS=-W -std=c99 14 | LDFLAGS=-nostdlib -ffunction-sections -fdata-sections 15 | OBJ=esp32-too-many-sections.o 16 | BIN=esp32-too-many-sections.elf 17 | SRC=esp32-too-many-sections.c 18 | 19 | # The following command will generate the C file to compile. 20 | # This is the simplest way to have a working and easily maintainable 21 | # C file as it is almost only way out repetitions. 22 | define generate_c_code = 23 | # Generate the constants, one per section. 24 | # Is it necessary to align the sections on an 16-byte bounds in order 25 | # to prevent esptool to merge them while generating the binary. 26 | # Indeed, by aligning them, there will be padding between them. 27 | echo "Generating $(SRC) ..." 28 | echo "// This has file been automatically generated, please check Makefile for\ 29 | more information." > $(SRC); \ 30 | for i in {1..$(SECTIONS_COUNT)}; \ 31 | do \ 32 | echo "const int number$$i __attribute__ ((section (\".NUM$$i\"), aligned((16)))) = $$i;" >> $(SRC) ;\ 33 | done; 34 | echo -e "\n" >> $(SRC) ; \ 35 | echo "int _start(void) {" >> $(SRC) ; \ 36 | echo " volatile long int res =" >> $(SRC) ; \ 37 | for i in {1..$(SECTIONS_COUNT)}; \ 38 | do \ 39 | echo " (unsigned int) number$$i +" >> $(SRC) ;\ 40 | done; 41 | # Adding 0 at the end it simpler than making a special case for the last 42 | # loop iteration 43 | echo " 0;" >> $(SRC) ; 44 | echo " return res;" >> $(SRC) ; 45 | echo "}" >> $(SRC) ; 46 | endef 47 | 48 | .PHONY: all clean generate-src 49 | 50 | all: $(BIN) 51 | 52 | $(BIN): $(OBJ) 53 | $(CC) -o $@ $^ $(LDFLAGS) 54 | 55 | # By default, make uses sh as script langage, use bash to generate the C file 56 | $(SRC): SHELL:=$(BASH) 57 | $(SRC): 58 | @$(generate_c_code) 59 | 60 | %.o: %.c 61 | $(CC) -c -o $@ $^ $(CFLAGS) 62 | 63 | clean: 64 | rm -f $(SRC) $(BIN) $(OBJ) 65 | -------------------------------------------------------------------------------- /static/esptool/test/elf2image/esp32-zephyr.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/elf2image/esp32-zephyr.elf -------------------------------------------------------------------------------- /static/esptool/test/elf2image/esp8266-nonossdkv12-example.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/elf2image/esp8266-nonossdkv12-example.elf -------------------------------------------------------------------------------- /static/esptool/test/elf2image/esp8266-nonossdkv20-at-v2.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/elf2image/esp8266-nonossdkv20-at-v2.elf -------------------------------------------------------------------------------- /static/esptool/test/elf2image/esp8266-nonosssdk20-iotdemo.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/elf2image/esp8266-nonosssdk20-iotdemo.elf -------------------------------------------------------------------------------- /static/esptool/test/elf2image/esp8266-openrtos-blink-v2.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/elf2image/esp8266-openrtos-blink-v2.elf -------------------------------------------------------------------------------- /static/esptool/test/images/aes_key.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/esptool/test/images/bootloader_esp32.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/bootloader_esp32.bin -------------------------------------------------------------------------------- /static/esptool/test/images/bootloader_esp32c3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/bootloader_esp32c3.bin -------------------------------------------------------------------------------- /static/esptool/test/images/bootloader_esp32s2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/bootloader_esp32s2.bin -------------------------------------------------------------------------------- /static/esptool/test/images/bootloader_esp32s3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/bootloader_esp32s3.bin -------------------------------------------------------------------------------- /static/esptool/test/images/bootloader_esp32s3beta2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/bootloader_esp32s3beta2.bin -------------------------------------------------------------------------------- /static/esptool/test/images/efuse/128bit: -------------------------------------------------------------------------------- 1 |  2 |  -------------------------------------------------------------------------------- /static/esptool/test/images/efuse/192bit: -------------------------------------------------------------------------------- 1 |   -------------------------------------------------------------------------------- /static/esptool/test/images/efuse/192bit_1: -------------------------------------------------------------------------------- 1 |  2 | ! -------------------------------------------------------------------------------- /static/esptool/test/images/efuse/192bit_2: -------------------------------------------------------------------------------- 1 | " 2 | " -------------------------------------------------------------------------------- /static/esptool/test/images/efuse/224bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/efuse/224bit -------------------------------------------------------------------------------- /static/esptool/test/images/efuse/256bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/efuse/256bit -------------------------------------------------------------------------------- /static/esptool/test/images/efuse/256bit_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/efuse/256bit_1 -------------------------------------------------------------------------------- /static/esptool/test/images/efuse/256bit_1_256bit_2_combined: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/efuse/256bit_1_256bit_2_combined -------------------------------------------------------------------------------- /static/esptool/test/images/efuse/256bit_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/efuse/256bit_2 -------------------------------------------------------------------------------- /static/esptool/test/images/esp8266_deepsleep.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/esp8266_deepsleep.bin -------------------------------------------------------------------------------- /static/esptool/test/images/esp8266_sdk/4096_user1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/esp8266_sdk/4096_user1.bin -------------------------------------------------------------------------------- /static/esptool/test/images/esp8266_sdk/blank.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/esp8266_sdk/blank.bin -------------------------------------------------------------------------------- /static/esptool/test/images/esp8266_sdk/boot_v1.4(b1).bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/esp8266_sdk/boot_v1.4(b1).bin -------------------------------------------------------------------------------- /static/esptool/test/images/esp8266_sdk/esp_init_data_default.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/esp8266_sdk/esp_init_data_default.bin -------------------------------------------------------------------------------- /static/esptool/test/images/fifty_kb.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/fifty_kb.bin -------------------------------------------------------------------------------- /static/esptool/test/images/helloworld-esp32_edit.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/helloworld-esp32_edit.bin -------------------------------------------------------------------------------- /static/esptool/test/images/nodemcu-master-7-modules-2017-01-19-11-10-03-integer.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/nodemcu-master-7-modules-2017-01-19-11-10-03-integer.bin -------------------------------------------------------------------------------- /static/esptool/test/images/one_kb.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/one_kb.bin -------------------------------------------------------------------------------- /static/esptool/test/images/one_kb_all_ef.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/one_kb_all_ef.bin -------------------------------------------------------------------------------- /static/esptool/test/images/one_mb.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/one_mb.bin -------------------------------------------------------------------------------- /static/esptool/test/images/onebyte.bin: -------------------------------------------------------------------------------- 1 | a -------------------------------------------------------------------------------- /static/esptool/test/images/partitions_singleapp.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/partitions_singleapp.bin -------------------------------------------------------------------------------- /static/esptool/test/images/ram_helloworld/helloworld-esp32.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/ram_helloworld/helloworld-esp32.bin -------------------------------------------------------------------------------- /static/esptool/test/images/ram_helloworld/helloworld-esp32_edit.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/ram_helloworld/helloworld-esp32_edit.bin -------------------------------------------------------------------------------- /static/esptool/test/images/ram_helloworld/helloworld-esp8266.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/ram_helloworld/helloworld-esp8266.bin -------------------------------------------------------------------------------- /static/esptool/test/images/ram_helloworld/source/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile to compile the helloworld app for esptool tests 2 | 3 | # Prefix for each cross compiler (can include a directory path) 4 | # These can be overriden via environment variables or on the make command line 5 | CROSS_8266 ?= xtensa-lx106-elf- 6 | CROSS_32 ?= xtensa-esp32-elf- 7 | CROSS_32S2 ?= xtensa-esp32s2-elf- 8 | CROSS_32S3 ?= xtensa-esp32s3-elf- 9 | CROSS_32C3 ?= riscv32-esp-elf- 10 | 11 | # Pass V=1 to see the commands being executed by make 12 | ifneq ("$(V)","1") 13 | Q = @ 14 | endif 15 | 16 | APP = hello_world 17 | SRCS = main.c 18 | 19 | BUILD_DIR = build 20 | 21 | APP_ELF_8266 = $(BUILD_DIR)/$(APP)_8266.elf 22 | APP_ELF_32 = $(BUILD_DIR)/$(APP)_32.elf 23 | APP_ELF_32S2 = $(BUILD_DIR)/$(APP)_32s2.elf 24 | APP_ELF_32S3_BETA_2 = $(BUILD_DIR)/$(APP)_32s3beta2.elf 25 | APP_ELF_32S3 = $(BUILD_DIR)/$(APP)_32s3.elf 26 | APP_ELF_32C3 = $(BUILD_DIR)/$(APP)_32c3.elf 27 | 28 | .PHONY: all clean 29 | 30 | all: $(APP_ELF_8266) $(APP_ELF_32) $(APP_ELF_32S2) 31 | 32 | $(BUILD_DIR): 33 | $(Q) mkdir $@ 34 | 35 | CFLAGS = -std=c99 -Wall -Werror -Os \ 36 | -mtext-section-literals -mlongcalls -nostdlib -fno-builtin -flto \ 37 | -Wl,-static -g -ffunction-sections -Wl,--gc-sections -Iinclude -Lld 38 | CFLAGS_ESP32C3 = -std=c99 -Wall -Werror -Os \ 39 | -march=rv32imc -msmall-data-limit=0 \ 40 | -nostdlib -fno-builtin -flto \ 41 | -Wl,-static -g -ffunction-sections -Wl,--gc-sections -Iinclude -Lld 42 | LDLIBS = -lgcc 43 | 44 | $(APP_ELF_8266): $(SRCS) $(SRCS_8266) $(BUILD_DIR) ld/app_8266.ld | Makefile 45 | @echo " CC(8266) $^ -> $@" 46 | $(Q) $(CROSS_8266)gcc $(CFLAGS) -DESP8266=1 -Tapp_8266.ld -Wl,-Map=$(@:.elf=.map) -o $@ $(filter %.c, $^) $(LDLIBS) 47 | 48 | $(APP_ELF_32): $(SRCS) $(BUILD_DIR) ld/app_32.ld | Makefile 49 | @echo " CC(32) $^ -> $@" 50 | $(Q) $(CROSS_32)gcc $(CFLAGS) -DESP32=1 -Tapp_32.ld -Wl,-Map=$(@:.elf=.map) -o $@ $(filter %.c, $^) $(LDLIBS) 51 | 52 | $(APP_ELF_32S2): $(SRCS) $(BUILD_DIR) ld/app_32s2.ld 53 | @echo " CC(32S2) $^ -> $@" 54 | $(Q) $(CROSS_32S2)gcc $(CFLAGS) -DESP32S2=1 -Tapp_32s2.ld -Wl,-Map=$(@:.elf=.map) -o $@ $(filter %.c, $^) $(LDLIBS) 55 | 56 | $(APP_ELF_32S3_BETA_2): $(SRCS) $(BUILD_DIR) ld/app_32s3_beta_2.ld 57 | @echo " CC(32S3) $^ -> $@" 58 | $(Q) $(CROSS_32S3)gcc $(CFLAGS) -DESP32S3=1 -Tapp_32s3.ld -Wl,-Map=$(@:.elf=.map) -o $@ $(filter %.c, $^) $(LDLIBS) 59 | 60 | $(APP_ELF_32S3): $(SRCS) $(BUILD_DIR) ld/app_32s3.ld 61 | @echo " CC(32S3) $^ -> $@" 62 | $(Q) $(CROSS_32S3)gcc $(CFLAGS) -DESP32S3=1 -Tapp_32s3.ld -Wl,-Map=$(@:.elf=.map) -o $@ $(filter %.c, $^) $(LDLIBS) 63 | 64 | $(APP_ELF_32C3): $(SRCS) $(BUILD_DIR) ld/app_32c3.ld 65 | @echo " CC(32C3) $^ -> $@" 66 | $(Q) $(CROSS_32C3)gcc $(CFLAGS_ESP32C3) -DESP32C3=1 -Tapp_32c3.ld -Wl,-Map=$(@:.elf=.map) -o $@ $(filter %.c, $^) $(LDLIBS) 67 | 68 | clean: 69 | $(Q) rm -rf $(BUILD_DIR) 70 | -------------------------------------------------------------------------------- /static/esptool/test/images/ram_helloworld/source/ld/app_32.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Cesanta Software Limited 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | MEMORY { 19 | iram : org = 0x4008c000, len = 0x1000 20 | dram : org = 0x3ffc0000, len = 0xc000 21 | } 22 | 23 | ENTRY(ram_main) 24 | 25 | SECTIONS { 26 | .text : ALIGN(4) { 27 | *(.literal) 28 | *(.text .text.*) 29 | } > iram 30 | 31 | .bss : ALIGN(4) { 32 | _bss_start = ABSOLUTE(.); 33 | *(.bss) 34 | _bss_end = ABSOLUTE(.); 35 | } > dram 36 | 37 | .data : ALIGN(4) { 38 | *(.data) 39 | *(.rodata .rodata.*) 40 | } > dram 41 | } 42 | 43 | INCLUDE "../../../../flasher_stub/ld/rom_32.ld" 44 | -------------------------------------------------------------------------------- /static/esptool/test/images/ram_helloworld/source/ld/app_32c3.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | MEMORY { 8 | iram : org = 0x4037C000, len = 0x4000 9 | dram : org = 0x3FC80000, len = 0x4000 10 | } 11 | 12 | ENTRY(ram_main) 13 | 14 | SECTIONS { 15 | .text : ALIGN(4) { 16 | *(.literal) 17 | *(.text .text.*) 18 | } > iram 19 | 20 | .bss : ALIGN(4) { 21 | _bss_start = ABSOLUTE(.); 22 | *(.bss) 23 | _bss_end = ABSOLUTE(.); 24 | } > dram 25 | 26 | .data : ALIGN(4) { 27 | *(.data) 28 | *(.rodata .rodata.*) 29 | } > dram 30 | } 31 | 32 | INCLUDE "../../../../flasher_stub/ld/rom_32c3.ld" 33 | -------------------------------------------------------------------------------- /static/esptool/test/images/ram_helloworld/source/ld/app_32s2.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | MEMORY { 8 | iram : org = 0x40020000, len = 0x8000 9 | dram : org = 0x3FFC8000, len = 0x8000 10 | } 11 | 12 | ENTRY(ram_main) 13 | 14 | SECTIONS { 15 | .text : ALIGN(4) { 16 | *(.literal) 17 | *(.text .text.*) 18 | } > iram 19 | 20 | .bss : ALIGN(4) { 21 | _bss_start = ABSOLUTE(.); 22 | *(.bss) 23 | _bss_end = ABSOLUTE(.); 24 | } > dram 25 | 26 | .data : ALIGN(4) { 27 | *(.data) 28 | *(.rodata .rodata.*) 29 | } > dram 30 | } 31 | 32 | INCLUDE "../../../../flasher_stub/ld/rom_32s2.ld" 33 | -------------------------------------------------------------------------------- /static/esptool/test/images/ram_helloworld/source/ld/app_32s3.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | MEMORY { 8 | iram : org = 0x40378000, len = 0x18000 9 | dram : org = 0x3FCA0000, len = 0x28000 10 | } 11 | 12 | ENTRY(ram_main) 13 | 14 | SECTIONS { 15 | .text : ALIGN(4) { 16 | *(.literal) 17 | *(.text .text.*) 18 | } > iram 19 | 20 | .bss : ALIGN(4) { 21 | _bss_start = ABSOLUTE(.); 22 | *(.bss) 23 | _bss_end = ABSOLUTE(.); 24 | } > dram 25 | 26 | .data : ALIGN(4) { 27 | *(.data) 28 | *(.rodata .rodata.*) 29 | } > dram 30 | } 31 | 32 | INCLUDE "../../../../flasher_stub/ld/rom_32s3.ld" 33 | -------------------------------------------------------------------------------- /static/esptool/test/images/ram_helloworld/source/ld/app_8266.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Cesanta Software Limited 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | MEMORY { 19 | iram : org = 0x40108000, len = 0x2000 20 | dram : org = 0x3FFE8000, len = 0x100 21 | } 22 | 23 | ENTRY(ram_main) 24 | 25 | SECTIONS { 26 | .text : ALIGN(4) { 27 | *(.literal) 28 | *(.text .text.*) 29 | } > iram 30 | 31 | .bss : ALIGN(4) { 32 | _bss_start = ABSOLUTE(.); 33 | *(.bss) 34 | _bss_end = ABSOLUTE(.); 35 | } > dram 36 | 37 | .data : ALIGN(4) { 38 | *(.data) 39 | *(.rodata .rodata.*) 40 | } > dram 41 | } 42 | 43 | INCLUDE "../../../../flasher_stub/ld/rom_8266.ld" 44 | 45 | PROVIDE(SPIFlashModeConfig = 0x40004568); 46 | PROVIDE(SPIParamCfg = 0x40004c2c); 47 | -------------------------------------------------------------------------------- /static/esptool/test/images/ram_helloworld/source/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void ets_printf(const char *s); // not the correct prototype, but should be enough! 4 | 5 | void __attribute__((noreturn)) ram_main() 6 | { 7 | while (1) { 8 | ets_printf("Hello world!\n"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /static/esptool/test/images/sector.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/sector.bin -------------------------------------------------------------------------------- /static/esptool/test/images/unaligned.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/unaligned.bin -------------------------------------------------------------------------------- /static/esptool/test/images/zerolength.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/images/zerolength.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/256bit_iv.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/256bit_iv.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/256bit_key.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/256bit_key.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/512bit_key.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/512bit_key.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader-encrypted-aes-xts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader-encrypted-aes-xts.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader-encrypted-conf0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader-encrypted-conf0.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader-encrypted-conf3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader-encrypted-conf3.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader-encrypted-conf9.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader-encrypted-conf9.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader-encrypted-confc.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader-encrypted-confc.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader-encrypted.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader-encrypted.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader_digested.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader_digested.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader_multi_signed_v2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader_multi_signed_v2.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader_signed.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader_signed.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader_signed_v2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader_signed_v2.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/bootloader_unsigned_v2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/bootloader_unsigned_v2.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/digest_iv.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/digest_iv.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/ecdsa_secure_boot_signing_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIOI40eSC7ch6PxDSIclIGFCjfhCoXfHVqbbDn8XdY0GVoAoGCCqGSM49 3 | AwEHoUQDQgAENM762z/ushk+c0XOIYpi8wLSWuF5COnU0VAQnt3spTSX6l3bpwfu 4 | ppsemDdwy+aKbdgeyMYDxFbROLOPTRbYJw== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/ecdsa_secure_boot_signing_key2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIP9iY7XY8g3qSaUkKwTbq6HEq/AwenIxrssLqXGTS0z3oAoGCCqGSM49 3 | AwEHoUQDQgAEG+Ah4OAejTBYKQNvJkEOP9AifgulBMr4E9f+OqRU1Uno9Efi1kMc 4 | fzwZyx0A4mib0HfLUg9JNh8dNrUxLeVb4Q== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/ecdsa_secure_boot_signing_key_pkcs8.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg4jjR5ILtyHo/ENIh 3 | yUgYUKN+EKhd8dWptsOfxd1jQZWhRANCAAQ0zvrbP+6yGT5zRc4himLzAtJa4XkI 4 | 6dTRUBCe3eylNJfqXdunB+6mmx6YN3DL5opt2B7IxgPEVtE4s49NFtgn 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/ecdsa_secure_boot_signing_pubkey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENM762z/ushk+c0XOIYpi8wLSWuF5 3 | COnU0VAQnt3spTSX6l3bpwfuppsemDdwy+aKbdgeyMYDxFbROLOPTRbYJw== 4 | -----END PUBLIC KEY----- 5 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/ecdsa_secure_boot_signing_pubkey2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEG+Ah4OAejTBYKQNvJkEOP9Aifgul 3 | BMr4E9f+OqRU1Uno9Efi1kMcfzwZyx0A4mib0HfLUg9JNh8dNrUxLeVb4Q== 4 | -----END PUBLIC KEY----- 5 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/ef-flashencryption-key.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/ef-flashencryption-key.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/hello-world-signed-encrypted-aes-xts-256.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/hello-world-signed-encrypted-aes-xts-256.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/hello-world-signed-encrypted-aes-xts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/hello-world-signed-encrypted-aes-xts.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/hello-world-signed-encrypted.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/hello-world-signed-encrypted.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/hello-world-signed.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/hello-world-signed.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/rsa_public_key_digest.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/esptool/test/secure_images/rsa_public_key_digest.bin -------------------------------------------------------------------------------- /static/esptool/test/secure_images/rsa_secure_boot_signing_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | 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 39 | -----END RSA PRIVATE KEY----- 40 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/rsa_secure_boot_signing_key2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | 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 39 | -----END RSA PRIVATE KEY----- 40 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/rsa_secure_boot_signing_key3.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIG5AIBAAKCAYEA2D8HZ1c2UQUdAAD3PdQ9Qr+geVjcDLtLmlt7FVaxKi0OUq0g 3 | fZyr1jGMLOzuhAWADeAEF5cIsNtlTuGupRIjj+5S/Nzbl4jxkXUIcIxpMPDu8RqI 4 | ttVl1N2wXp51o/0BSNZSyOy+xD4vsGsXKk2DJgsOMJp20129y6lPzHGvPG3Xzmwq 5 | xjZSM0DrX4x4tNAyiAD1BlLWx9zJsC1CvSlVW3KV9dtbtqGVk+JfefYCXCbWjxK1 6 | VcU0e0rR6apwyQ7HkWOTnBcyv+Qbb/X9Hmh9CQij8C8X9WwXtkV0vQPhnetSn63v 7 | Sf2IZ3FS+QuGj6YKsNObLsMBwTczU4pQXMN1+LRmCJdNqRTZVDiLxpB81YYgB8SV 8 | qlbeqgedPZH7FdkfnbNMCti/pgqIrdZOrwWraCAY2F1N0X5IRjjMY7kJie0BXh/c 9 | RSR3qxR20qfi97IauCRffEg38h/t1++YNKGAlM8Nsr7rMr+zfvYygSZ0aV9P1CqN 10 | o3FE0wMnaMt+DLMjAgMBAAECggGBAIAzFauRS5VKx7+J0wnnuo3I11U5dfNiUlbn 11 | Zxfmdk+/uF8RXlK5wDHS2/yCVoEUVa9kIGjv1GotF2llaElacJTSwIZCVTkIKdaH 12 | IILA61flbnKnvWdPKfjBmN7vaGTZCJrq3Ndba1kiWNlpE6mznE3AfiAYYtu6FlwY 13 | O0PEHhRgNnGdNNqft6nFEgVqXOEtENgKYTjngYepgDSfEJLeX0lArGC+NCgYsXmj 14 | 2eCPFSUWrVrSx4hayltRpxK1RfocdOLcMtxLZag4yZzmrhKw90OI4wP0zjTyGGNh 15 | 6tKtgDT0d38Wdo2yu8o1t+PYO51dCTqKkcHV+IdK7Wm6B9j0L3LQMT3DPZ6tkrOd 16 | W4F1shc2wOAPen/iutX9rrYzmp8VbzmbkXuC3Dn6BSAAzGJTvuL1QFgdYGAuRZSC 17 | D0tM45MnnT6KhpLQRmVjYH9RzPFyCbKFgBNsDZ3qks3BR/iyPYjaaYKuM/XEP70L 18 | TH9HJtXXWtORx9gJovnWDJq6gRCfuQKBwQDvHzqt88NMahqmkGg+r41MoPgCptEF 19 | 58pNpNbB88hx36jHJEwBNPOH+nNjksF1YJOtt8Cs25H7N4kb92rWPQulK9/D8b5G 20 | 9wzun1AtsSn9l3VAUJ2l/dxzozHJFmEe+qkcSjOy/oapTzAp9Z3ZGb6caGAUe4v/ 21 | 7piMjAtVMX3OR/OBYgFB3f2hlDBenDN6c0FrUs7wq0MjzP9uq/19YGYdI8fnlL+O 22 | stsnPvnxltExyr1sXIPpZL+KBjWHYG2T6qUCgcEA54JzMMOZfbMd+J4ngh6kw4Nw 23 | ui+YcvHBb86t1GxYHqizg8cfH1FEDamiRtT8VXE7Nrb2NhSRhS4ojI/FB2k686xX 24 | cox11qdXCkF3pLK7jjP+zW71IO3SVs5xvdrrDMN/utCRMmsddbCeSQabiGOBltBt 25 | orwZHJyRwp/+HuN7ayIdu+dkNJaBKyb7kMBud82cQ1eopEFATV0vfprnKtzHWO6W 26 | 47/8Svxyz8/hOHo3V9NLT7SAzaDI6t1ro5SQFeQnAoHBAO3O+BOxvsPLLhACw7m7 27 | 62GPILe6YVxnJdnMGsyu/uTJE1hhr7jviVbtbD5V4FI0pwn4GgWPJIJbu971U+oW 28 | sfMlTBfZ3mtDHThfdmTKscEDFNfOlMpVSx4x6bxbpmEh1ndNEFduLExLddH09HPJ 29 | 17hDUXJtYFE6X7o/OLIUU1KIWhKNfkScWraL4wLkg4m/AAuVQjs1h8MeB9Zv89zx 30 | tvw57oBQfaWUGMHSLs7mN8w2Heabp5DA4oCJJkkpTDD0BQKBwG5ZKZrGwPS/WbvV 31 | drN488QVdLfqU9oGDdPDSewEsIP8mYRodxcwXyW8A5OLlbMMQ9MypmzkpPA8LivB 32 | o4KC0AyxywTYmpp0LPLAfczNPMTtV7iH+ON3OFkUEfcS0BLHZKyhGXRUxjgAtZHN 33 | SnlaJLzEIF3/FmEi5/9Cz5fdikhofI/CHWtLicoNzL8UWhNUt/UJZWLVj1bQ4gCQ 34 | yTsO/R4Qq29nZVRAvGD9jzaiWprMJguZ2AMrblk0rUfNWlh05QKBwCbTwxpcNYLA 35 | 5YzBEOkk1C/GalbdYRH8arTtvRYxiU/HQtXsnJVd7i0U1PauaNElyYlIjJebs8il 36 | VajOFYokdQTTFhc8D0o4JxekEvewgC1wICuTuykzmVCbTNPLgEChdHQ+Nj9aLBYD 37 | P1jFVDd38ZVuyIIZ+slAjg3rS2Slx+U2K9t9tPZaejyq4JB5CixVhmxVzMvBBTYX 38 | Fdva4fARA8g0t3xYR7aIyceplCgmPPwBL9RJTXX8BmKQEX3mAIY8hA== 39 | -----END RSA PRIVATE KEY----- 40 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/rsa_secure_boot_signing_key4.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | 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 39 | -----END RSA PRIVATE KEY----- 40 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/rsa_secure_boot_signing_pubkey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAtvnS7JPl5hGfA0Iks2lQ 3 | m/L+eiw7pcAArH2IKGqryKdGCtiwuOLjZkUpNR/dZhSr/7JGvjUw+2elLY7D1XXX 4 | w3pufjVH7AePmo4EXUS4U1g6xDuctj3hj3cOarpKo2+dEYrAwY13Bx28tOW0z2uK 5 | xQhNX3zHP9ssiTsLQ+6E+MjEvKjYcvAFtadXYtYTUZWhxuh8W2vnhOiR3zyJQL98 6 | 4iAl08G/T+HI/3JX3vGSFEnOP/ypqz7wQEMJwOEjVpsgaStf5N1JbSOSKp7r/aOM 7 | LQHnYHkfjWSNkX1v0QJfXl7iwtB8XVxRPftY4fdANrGTpQnUOogVo4q6mI80qJ5O 8 | uWfI+gdkxvMVnbmnNp1HtTslPGfBbF+XfQG23xEFvnYTUVvmmNX5QuHY2Vy6KpSS 9 | tQmf4FGZXjQdGzxavFfQjdiBOhxi5DEixcFpwlS1VcHRWb1G2yp15q3ukWrEkh9X 10 | 4vV6h05fmdvxOk9QhHTr0XCIzC4GmaUBM/UYvzGjlfwrAgMBAAE= 11 | -----END PUBLIC KEY----- 12 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/rsa_secure_boot_signing_pubkey2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAsM8ZHltWA8BfpCH1+xrm 3 | unmRCnzxZMjYsl069V7zkZlzKNHm7n76Q0+Jqb4g0uDzY3YD3hQAZTyCYxYjcgVm 4 | 4PQDSedkpWjkovKDJrvUIb3YzCGfoOOdj1vaJhGAH9COpJJJgvJG5fgvor7ERxFt 5 | q6/kTR2Dmipkc0CwrZi1CsBomcHKfUAEfuWY2hd2F4tmyN3Q/jObRUpk3XjPzFJP 6 | QDgnjgkxYHtUq9psalCqR8hjAx+pQHyGOMLNYSK0RwqslbvXy0dheLjlUPg84Z/g 7 | a4eYqboRy8wsiG+vRRgl4oYxIxg36WqurwaRu+8nUCO3zqQDff3yaN/lGlYfJojQ 8 | ihNto8opB5rTdRW/Obs0qE6nSf1WQMfG6ercRoMHx2alRgr1GRFe8QCm+nQsWnY7 9 | DOIy5U3usmQH9kjOBSYvHHvDbXvgyYRA3EHicWjh4akhtlbFosZeBZbK6NrsuKC8 10 | gc0UIpd8OcXmEudUEg34ezoLOs0gd4LI7hMt1c9UKofpAgMBAAE= 11 | -----END PUBLIC KEY----- 12 | -------------------------------------------------------------------------------- /static/esptool/test/secure_images/rsa_secure_boot_signing_pubkey4.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEApY+yGcE5s0hecfgMuIiv 3 | 5s4wr4Xkx+DPWs3r2fdZeUulpKtoh5QZ5QG2OFivx1ASBA4bN4NjuCzO+M83OLrC 4 | U8nCr4J1WLejOgJHabrvlAqYrRt6WF9ZQaw0feVasC13b96PgC80GgU6KhiLhJla 5 | hQLFC7F/Cyh14j5P31SCb3isSlIP6VN/PK73RETWwV+Ie3zxIrMeF2mpumLrW4U5 6 | YBt8PNQ1eAWmlUYD1iMGXZeZ9u/DRuhHGxTR4KCSov5/F14+Rb3L0eajYAQcyypU 7 | tDHLc7m62EAICqK2uHl3QX9+xnXnj2cfYUhDiQ1S6WJyVo9RTCx8qCYMVPt4c1DU 8 | rG+1dWKXFS5rQuQ9FaDNlE7sH1+QoBmyWRO9esIVOPFVXHa0E7VCVQQFpH833yCV 9 | JrqCiCCtlVaUDpvXbZWftJHgAXPWE9uecAMUjB+7qW5SXYfbiQsZPi9cnEZTyRs8 10 | jcQwA+1DDhY8SpzRe3+36ooJQ5WJDeCps/3y4STSgs1dAgMBAAE= 11 | -----END PUBLIC KEY----- 12 | -------------------------------------------------------------------------------- /static/esptool/test/sitecustomize.py: -------------------------------------------------------------------------------- 1 | import coverage 2 | coverage.process_startup() 3 | 4 | # This file exists to perform arbitrary site-specific customizations. 5 | # This script is executed before every Python process to start coverage measurement. 6 | -------------------------------------------------------------------------------- /static/esptool/test/test_modules.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Tests for regressions in python modules used by esptool.py, espefuse.py, and espsecure.py 4 | from __future__ import division, print_function 5 | 6 | import unittest 7 | 8 | import reedsolo 9 | 10 | 11 | class ReedSoloTests(unittest.TestCase): 12 | def test_reed_solomon_encoding(self): 13 | pairs = [("a0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf", "0404992ae0b12cb0ef0d4fd3"), 14 | ("11a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbd11bf", "e001803c2130884c190d57d5"), 15 | ("22a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbd22bf", "6c32056dd3fcc33fa6193773"), 16 | ("0a1a2a3a4a5a6a7a8a9aaabacadaeafa0b1b2b3b4b5b6b7b8b9babbbcbdbebfb", "08149eef461af628943c2661"), 17 | ("b3f455fb0b275123dec0e73c4becca19246bf2b103df401844a3bdcd3fd01a95", "500409183fa1b8e680568da7"), 18 | ("435777773fb1e36f7d6b5f1e99afaa7a57f16be0ed36bc057c7dae6a266d1504", "815d3007153d797bd6630d0e"), 19 | ("20a126c10f50ee871f43cfcfe4e62a492e3f729a6c48348a58863f3a482a69fe", "36150928f41dcacf396c0893"), 20 | ("a8d5fbda18d75605c422d2b10ac7f73283a5c9609d6b8c90ffaa96b84f133582", "a4f21330282242c9e20b6acf"), 21 | ("4296abb9a44432c8656d5605feffc25d71941fd0abf0ff0d61a01a19315a264c", "1bb4c3afd14b9023b33a2f15"), 22 | ("206e4f83f8173635d7d554d96b84586fbc3a4280b4403cba5834d3dc8e99a682", "1b7edac989c569cb08f9efd9"), 23 | ("57e8dc1b37c6b53a428fc6d7242114eaf3d80b0447bb642703120a257cf7ec52", "5ee82f785f3d5e19df92635b"), 24 | ("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "13a36292597404257375e0aa"), 25 | ("f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0", "f66cb1ba3ee5d164a19668a0"), 26 | ("abad1deaabad1deaabad1deaabad1deaabad1deaabad1deaabad1deaabad1dea", "1171924a9b34c16878e182a5"), 27 | ("abad1deadeadbeefabadbabecafebabe11223344556677889900aabbccddeeff", "7601266085196663727c6522"), 28 | ("0000000000000000000000000000000000000000000000000000000000000000", "000000000000000000000000"), 29 | ("1000000000000000000000000000000000000000000000000000000000000000", "b6f06eae2266cc0bfca685ca"), 30 | ("0001000100010001000a000b000c000d000e000f000100010001000100010001", "6dc2afb4820bb002d9263544"), 31 | ("0000000000000000000000000000000000000000000000000000000000000001", "44774376dc1f07545c7fd561"), 32 | ] # Pregenerated pairs consisting of 32 bytes of data + 12 bytes of RS ECC (FPGA verified) 33 | 34 | rs = reedsolo.RSCodec(12) # 12 ECC symbols 35 | 36 | for pair in pairs: 37 | bin_base = bytearray.fromhex(pair[0]) 38 | encoded_data = rs.encode([x for x in bin_base]) # Encode the original 32 bytes of data 39 | self.assertEqual(encoded_data, bytearray.fromhex(pair[0] + pair[1])) 40 | 41 | 42 | if __name__ == '__main__': 43 | print("Running python modules tests...") 44 | unittest.main(buffer=True) 45 | -------------------------------------------------------------------------------- /static/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.icns -------------------------------------------------------------------------------- /static/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.ico -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_128x128.png -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_16x16.png -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_256x256.png -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_32x32.png -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_512x512.png -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /static/icons/icon.iconset/icon_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.iconset/icon_64x64.png -------------------------------------------------------------------------------- /static/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/icons/icon.png -------------------------------------------------------------------------------- /static/images/controller.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /static/images/esp32-flash-tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/images/esp32-flash-tool.png -------------------------------------------------------------------------------- /static/images/github-brands.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/images/globe-solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/images/info.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/images/linkedin-brands.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhdt/esp32-flash-tool/59fe737beb9cc7e1be190bf4febcda7af3b40d2a/static/images/logo.png -------------------------------------------------------------------------------- /static/images/settings.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | }, 5 | "globals": { 6 | "assert": true, 7 | "expect": true, 8 | "should": true, 9 | "__static": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/unit/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | Vue.config.devtools = false 3 | Vue.config.productionTip = false 4 | 5 | // require all test files (files that ends with .spec.js) 6 | const testsContext = require.context('./specs', true, /\.spec$/) 7 | testsContext.keys().forEach(testsContext) 8 | 9 | // require all src files except main.js for coverage. 10 | // you can also change this to match only the subset of files that 11 | // you want coverage for. 12 | const srcContext = require.context('../../src/renderer', true, /^\.\/(?!main(\.js)?$)/) 13 | srcContext.keys().forEach(srcContext) 14 | -------------------------------------------------------------------------------- /test/unit/karma.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const path = require('path') 4 | const merge = require('webpack-merge') 5 | const webpack = require('webpack') 6 | 7 | const baseConfig = require('../../.electron-vue/webpack.renderer.config') 8 | const projectRoot = path.resolve(__dirname, '../../src/renderer') 9 | 10 | // Set BABEL_ENV to use proper preset config 11 | process.env.BABEL_ENV = 'test' 12 | 13 | let webpackConfig = merge(baseConfig, { 14 | devtool: '#inline-source-map', 15 | plugins: [ 16 | new webpack.DefinePlugin({ 17 | 'process.env.NODE_ENV': '"testing"' 18 | }) 19 | ] 20 | }) 21 | 22 | // don't treat dependencies as externals 23 | delete webpackConfig.entry 24 | delete webpackConfig.externals 25 | delete webpackConfig.output.libraryTarget 26 | 27 | // apply vue option to apply isparta-loader on js 28 | webpackConfig.module.rules 29 | .find(rule => rule.use.loader === 'vue-loader').use.options.loaders.js = 'babel-loader' 30 | 31 | module.exports = config => { 32 | config.set({ 33 | browsers: ['visibleElectron'], 34 | client: { 35 | useIframe: false 36 | }, 37 | coverageReporter: { 38 | dir: './coverage', 39 | reporters: [ 40 | { type: 'lcov', subdir: '.' }, 41 | { type: 'text-summary' } 42 | ] 43 | }, 44 | customLaunchers: { 45 | 'visibleElectron': { 46 | base: 'Electron', 47 | flags: ['--show'] 48 | } 49 | }, 50 | frameworks: ['mocha', 'chai'], 51 | files: ['./index.js'], 52 | preprocessors: { 53 | './index.js': ['webpack', 'sourcemap'] 54 | }, 55 | reporters: ['spec', 'coverage'], 56 | singleRun: true, 57 | webpack: webpackConfig, 58 | webpackMiddleware: { 59 | noInfo: true 60 | } 61 | }) 62 | } 63 | -------------------------------------------------------------------------------- /test/unit/specs/Home.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Home from '@/views/Home' 3 | 4 | describe('Home.vue', () => { 5 | it('should render correct contents', () => { 6 | const vm = new Vue({ 7 | el: document.createElement('div'), 8 | render: h => h(Home) 9 | }).$mount() 10 | 11 | expect(vm.$el.querySelector('.home')).to.contain('Welcome to your new project!') 12 | }) 13 | }) 14 | --------------------------------------------------------------------------------