From f54f25a0b4cd04615aae62d2a8b3231758da455c Mon Sep 17 00:00:00 2001 From: karawin Date: Thu, 13 Feb 2020 12:06:57 +0100 Subject: [PATCH] nvs local --- boards/build/ttgotm.bin | Bin 12288 -> 0 bytes boards/build/ttgov4.bin | Bin 12288 -> 12288 bytes boards/nvs_partition_genlocal.sh | 52 +++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) delete mode 100644 boards/build/ttgotm.bin create mode 100644 boards/nvs_partition_genlocal.sh diff --git a/boards/build/ttgotm.bin b/boards/build/ttgotm.bin deleted file mode 100644 index 30e83c49b901baeba2035117719e169d80359c7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeH}TWl0n7{_PZg*GuU*b0b=*c!!1pg`-TSPVNmvt5=myEE(zX&Wyey;)1zZo{r7 z2qh&Um>4V-Uz$JyHlhi}#6%Jk8bZMsHMVLnULcsJp+wLc9wdlJGoG_^X66&u#M$`Z z!`r*Q{0?$uqq!bF-2kc+J?rCl7?15~5YkMb) zlR|tq2rF4vXG_13g!Un*FF&HP6?w%((Gq9>EF zl*JS7qr=DE-an>w_iT^rt1K(7ue6dYW2RA8Th*3n-PTc6!xCA2%O@{y=<4szpz@>= zUSA2-uU$TTihyY(yy~RC=x1jezA_-0Fm-=GCGyYB4zH)WZlZw2NFQ17>LUgy8u9H? z1=5Er4^q8ZF_F$?o7E?;I8|mq+H`wo!>W;guJ6;e)UV*`j@8G-ZnHa@r|udng*aeteZ&m85t zmwy+U|H{qh%3a;f$9`!@-flqDN}>86LjJC^)>~Zn@|Pj~#FFN#Tvy!w9!C1Uj$M>5 z&Hsn`%h%6r<+_)T>m%2qzi{2l$9l`eM;i@D)GA;q?g^QP<_}Lsnz*jI3$y^~9}mo% za&&)>V1D!WeE6dQnxcZgLvViNLj1a;%d6e~asK2tQ)e8#aQ@8Qqvz=SX)qJlS#R1^+m)ddjTUuXCg}9O6 zXLJ$rk2f3|GC)=pAW@Y!$mRU`I=Rc*OV>wMh?aV!%ed1w1_7WyQ|t zD>V__(bu^6Je}P?;rU}fXZmy9nLhspD&-TDQoZ7{9YcD4eXJHE=0tpg^e>()t9SIY z?)LB2R~io4OYd)6=IHund`GY`EMK2HZt0+^$s{ytay&nQ>u2?yuGx91{l#o9(+l0( zc!^;?AWZMyma^BI2y8aI=IDnI@6c=14ZQ80`6~wMh6!DtMpRr7|8&E^P69fm$hg;fwE=5>WLfezyhn4=$aUCTQ;j^+#TwxlX{}TS5KOcZa?tP|IxI z6Quv~4~~CNpw9EM4?+Bcul1fJ@MzKg$d%YJ0*@8#m(-`;AnlEw~_HbKjXj6i~|4V0YoJSVE_OC delta 17 YcmZojXh>lEvyt&XKjWXxi~|4V0Ym`@T>t<8 diff --git a/boards/nvs_partition_genlocal.sh b/boards/nvs_partition_genlocal.sh new file mode 100644 index 00000000..b2d35729 --- /dev/null +++ b/boards/nvs_partition_genlocal.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +NVS_PARTITION_GENERATOR="nvs_partition_gen.py" +#NVS_PARTITION_GENERATOR="nvs_partition_gen.py" +SIZE_PARTITION="0x3000" + +cd "$(dirname $0)" +echo "Jump into $PWD directory" + +build_binary () { + if [ ! -f "$1" ]; then + echo -e "\e[31m$1 file not found\e[m" + return + fi + + fname="${1%.*}" + echo -e "\nBoard \e[33m$fname\e[m" + comment="$(grep L_COMMENT $1 | sed -E 's/^.*,string,//; s/\s*\.\s*$//')" + echo -e "\e[34m${comment}\e[m" + python $NVS_PARTITION_GENERATOR\ + --version v1\ + --input "$1"\ + --output "./build/$fname.bin"\ + --size $SIZE_PARTITION +} + +if [ "$#" -eq 0 ]; then + # clean up !! + rm -f build/*.bin + + for filename in $(ls *.csv); do + build_binary "$filename" + done +else + MY_BOARD="MY-BOARD" + if [ "$#" -eq 1 ]; then + MY_BOARD="${1%.*}" + fi + while [ ! -z "$1" ]; do + build_binary "$1" + shift + done +fi + +cat << EOT + +Minimum NVS Partition Size needed is 0x3000 bytes. Look at this link : +https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/storage/nvs_partition_gen.html#running-the-utility + +For flashing, type : + esptool --chip esp32 write_flash 0x3a2000 build/${MY_BOARD}.bin +EOT