Skip to content

Commit 9827a40

Browse files
committed
wip
1 parent dc7a73c commit 9827a40

File tree

3 files changed

+161
-0
lines changed

3 files changed

+161
-0
lines changed

cores/esp8266/core_esp8266_main.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,24 @@ extern "C" void ICACHE_RAM_ATTR app_entry (void)
212212
return app_entry_custom();
213213
}
214214

215+
extern "C" void user_pre_init (void)
216+
{
217+
// NOT WORKING
218+
// 4M
219+
#define SPI_FLASH_SIZE_MAP 4
220+
#define SYSTEM_PARTITION_RF_CAL_ADDR (0x400000 - 0x3000 - 0x1000 - 0x1000)
221+
#define SYSTEM_PARTITION_PHY_DATA_ADDR (0x400000 - 0x3000 - 0x1000)
222+
#define SYSTEM_PARTITION_SYSTEM_PARAMETER_ADDR (0x400000 - 0x3000)
223+
static const partition_item_t partitions[] = {
224+
{ SYSTEM_PARTITION_BOOTLOADER, 0x0, 0x1000},
225+
{ SYSTEM_PARTITION_RF_CAL, SYSTEM_PARTITION_RF_CAL_ADDR, 0x1000},
226+
{ SYSTEM_PARTITION_PHY_DATA, SYSTEM_PARTITION_PHY_DATA_ADDR, 0x1000},
227+
{ SYSTEM_PARTITION_SYSTEM_PARAMETER,SYSTEM_PARTITION_SYSTEM_PARAMETER_ADDR, 0x3000},
228+
{ SYSTEM_PARTITION_CUSTOMER_BEGIN, 0x1000, 0x8000},
229+
};
230+
system_partition_table_regist(partitions, sizeof(partitions) / sizeof(partitions[0]), SPI_FLASH_SIZE_MAP);
231+
}
232+
215233
extern "C" void user_init(void) {
216234
struct rst_info *rtc_info_ptr = system_get_rst_info();
217235
memcpy((void *) &resetInfo, (void *) rtc_info_ptr, sizeof(resetInfo));
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# released to public domain
6+
7+
help()
8+
{
9+
cat << eof
10+
11+
usage: $1 <esp-open-sdk path>
12+
13+
Compare include files against sdk's
14+
15+
eof
16+
exit 1
17+
}
18+
19+
20+
sdk="$1"
21+
me="$0"
22+
core=$(cd ${me%/*}/../../../..; pwd)
23+
24+
[ -r "$sdk/lib/libnet80211.a" ] || help "$0"
25+
26+
for f in $(cd "$sdk"; find include -type f); do
27+
diff -bu "$sdk/$f" "$core/tools/sdk/$f" || true
28+
done | sed \
29+
-e 's/^+#ifdef.*cplusplus//g' \
30+
-e 's/^+extern "C"//g' \
31+
-e 's/^+}$//g' \
32+
-e 's/^+#endif$//g' \
33+
-e 's/^+[ \t]*$//g' \
+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# released to public domain
6+
7+
help()
8+
{
9+
cat << eof
10+
11+
usage: $1 [-v] <esp-open-sdk path>
12+
13+
For each binary-only library file from ESP-NONOS-SDK, this script searches for
14+
the exact commits and reports matching versions and commit urls.
15+
16+
The argument must be the ESP-NONOS-SDK git-cloned directory. It is left
17+
unmodified, and is locally cloned to work with. The local copy is then
18+
removed.
19+
20+
Because of libmain.a local tweaks, comparison is done for each .a file by
21+
extracting object files, removing the potentially modified ones
22+
(mem_manager.o time.o user_interface.o eagle_lwip_if.o) and doing a md5
23+
check against the core files.
24+
25+
eof
26+
exit 1
27+
}
28+
29+
30+
verbose=false
31+
[ "$1" = "-v" ] && { shift; verbose=true; }
32+
sdk="$1"
33+
me="$0"
34+
core=$(cd ${me%/*}/../../../..; pwd)
35+
36+
37+
[ -r "$sdk/lib/libnet80211.a" ] || help "$0"
38+
[ -r "$core/tools/xtensa-lx106-elf/bin" ] || help "$0"
39+
40+
tmp=$(pwd)/NONOSDK.deleteme
41+
42+
cat << eof
43+
44+
nonos-sdk = '$sdk'
45+
core root directory = '$core'
46+
temporary nonos-sdk clone = '$tmp'
47+
48+
If libmain.a is not found, it should be the one around the same libpp.a's commit
49+
50+
eof
51+
52+
md5()
53+
{
54+
mkdir temp
55+
cd temp
56+
PATH="$core/tools/xtensa-lx106-elf/bin:$PATH" xtensa-lx106-elf-ar x "$1"
57+
rm -f mem_manager.o time.o user_interface.o eagle_lwip_if.o
58+
cat *.o | md5sum
59+
cd ..
60+
rm -rf temp
61+
}
62+
63+
search()
64+
{
65+
rm -rf "$tmp"
66+
git clone $sdk "$tmp" 1>&2
67+
cd "$tmp"
68+
git reset --hard 1>&2
69+
70+
corelibs=$(cd "$core/tools/sdk/lib"; ls *.a)
71+
commits=$(git log|grep ^commit\ | tac | sed 's,commit ,,')
72+
73+
for f in $corelibs; do
74+
75+
git checkout master 1>&2 # needed
76+
77+
if [ -r "$tmp/lib/$f" ]; then
78+
79+
coremd5=$(md5 "$core/tools/sdk/lib/$f")
80+
found=false
81+
82+
for i in $commits; do
83+
git reset --hard 1>&2
84+
git checkout $i 1>&2
85+
86+
[ -d "$tmp/lib" ] || continue
87+
88+
espmd5=$(md5 "$tmp/lib/$f")
89+
if [ "$espmd5" = "$coremd5" ]; then
90+
tag=$(git describe --tag)
91+
date=$(git log $tmp/lib/$f | head -3 | grep ^Date | sed 's,^[^ ]*[ ]*,,g')
92+
echo "$tag - https://github.com/espressif/ESP8266_NONOS_SDK/commit/$i - $f - $date"
93+
found=true
94+
break
95+
fi
96+
done
97+
98+
$found || echo "NOTFOUND - $f"
99+
fi
100+
101+
done
102+
103+
cd ..
104+
rm -rf "$tmp"
105+
}
106+
107+
$verbose && search
108+
$verbose || search 2>/dev/null
109+
110+
echo "all done"

0 commit comments

Comments
 (0)