Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
f974fddd
Commit
f974fddd
authored
8 years ago
by
Deomid Ryabkov
Committed by
Cesanta Bot
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ESP8266_RTOS example; add mos flashing
PUBLISHED_FROM=d87814d40f0acdc7a96fbd132c2157ccb499c7c6
parent
b1a46da3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
11 deletions
+43
-11
Makefile
examples/ESP8266_RTOS/Makefile
+20
-2
README.md
examples/ESP8266_RTOS/README.md
+13
-3
build.sh
examples/ESP8266_RTOS/build.sh
+3
-2
user_main.c
examples/ESP8266_RTOS/user/user_main.c
+7
-4
No files found.
examples/ESP8266_RTOS/Makefile
View file @
f974fddd
...
...
@@ -56,7 +56,7 @@ LINKFLAGS_eagle.app.v6 = \
-Wl,-static
\
-Wl,--start-group
\
-lcirom
\
-lgcc
\
-lgcc
_sdk
\
-lhal
\
-lphy
\
-lpp
\
...
...
@@ -116,5 +116,23 @@ sinclude $(SDK_PATH)/Makefile
.PHONY
:
FORCE
FORCE
:
fw.zip
:
@
/usr/local/bin/fw_meta
*
create_manifest
\
-
-platform
=
esp8266
\
-
-name
=
mongoose_example
\
-
-build_info
=
'{"build_version": "1.0", "build_id": "test"}'
\
-
-staging_dir
=
$(ODIR)
\
-
-output
=
$(ODIR)
/manifest.json
\
iram:addr
=
0,src
=
$(BIN_PATH)
/eagle.flash.bin
\
irom:addr
=
0x20000,src
=
$(BIN_PATH)
/eagle.irom0text.bin
\
sysparams:addr
=
0x7e000,type
=
sys_params,src
=
$(SDK_PATH)
/bin/esp_init_data_default.bin
@
/usr/local/bin/fw_meta
*
create_fw
\
-
-manifest
=
$(ODIR)
/manifest.json
\
-
-src_dir
=
$(ODIR)
\
-
-output
=
$@
@
echo
@
echo
"
$@
built. Use
\"
mos flash
$@
\"
to flash."
@
echo
clean
:
rm
-rf
user/.output .bin
rm
-rf
fw.zip
$(BIN_PATH)
$(ODIR)
user/.output
This diff is collapsed.
Click to expand it.
examples/ESP8266_RTOS/README.md
View file @
f974fddd
...
...
@@ -6,19 +6,29 @@ Most of the the boilerplate comes from [project_template](https://github.com/esp
To build with no changes to the SDK, you will need a module with 1MB (8Mb) flash or more.
Compile (for NodeMCU 1.0)
:
For building the example, you have two options
:
*
Using
[
Docker
](
https://www.docker.com/products/docker
)
and use our pre-built SDK container:
```
$ ./build.sh
```
*
Use SDK and toolchain installed separately as explained
[
here
](
https://github.com/espressif/ESP8266_RTOS_SDK#esp8266_rtos_sdk
)
:
```
$ export SDK_PATH=/path/to/ESP8266_RTOS_SDK
$ export BIN_PATH=./bin
$ make clean; make BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=dio SPI_SIZE_MAP=0
```
Flash (using
[
esptool
](
https://github.com/themadinventor/esptool
)
)
:
Once built, there are two options for flashing
:
*
Using the Mongoose OS
[
mos
](
https://mongoose-os.com/software.html
)
tool:
```
$ make fw.zip && mos flash fw.zip
```
*
Using
[
esptool
](
https://github.com/themadinventor/esptool
)
:
```
$ esptool.py --port /dev/ttyUSB0 --baud 230400 \
write_flash --flash_mode=
q
io --flash_size=4m \
write_flash --flash_mode=
d
io --flash_size=4m \
0x00000 ${BIN_PATH}/eagle.flash.bin \
0x20000 ${BIN_PATH}/eagle.irom0text.bin \
0x7e000 ${SDK_PATH}/bin/esp_init_data_default.bin
...
...
This diff is collapsed.
Click to expand it.
examples/ESP8266_RTOS/build.sh
View file @
f974fddd
...
...
@@ -6,5 +6,6 @@ docker run \
export SDK_PATH=/opt/Espressif/ESP8266_RTOS_SDK;
export BIN_PATH=./bin;
cd /src/examples/ESP8266_RTOS &&
mkdir -p ./bin && make clean &&
make BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=qio SPI_SIZE_MAP=0'
make clean &&
make BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=dio SPI_SIZE_MAP=0 &&
make fw.zip'
This diff is collapsed.
Click to expand it.
examples/ESP8266_RTOS/user/user_main.c
View file @
f974fddd
...
...
@@ -12,7 +12,7 @@
#define AP_CHAN 9
#define MG_LISTEN_ADDR "80"
#define MG_TASK_STACK_SIZE 4096
#define MG_TASK_STACK_SIZE 4096
/* bytes */
#define MGOS_TASK_PRIORITY 1
void
uart_div_modify
(
int
uart_no
,
unsigned
int
freq
);
...
...
@@ -82,7 +82,8 @@ static void mg_task(void *arg) {
struct
mg_mgr
mgr
;
struct
mg_connection
*
nc
;
printf
(
"SDK version: %s
\n
"
,
system_get_sdk_version
());
printf
(
"
\r\n\r\n
SDK version: %s
\r\n
"
,
system_get_sdk_version
());
printf
(
"Free RAM: %d
\r\n
"
,
system_get_free_heap_size
());
setup_ap
();
mg_mgr_init
(
&
mgr
,
NULL
);
...
...
@@ -104,8 +105,10 @@ xTaskHandle s_mg_task_handle;
void
user_init
(
void
)
{
uart_div_modify
(
0
,
UART_CLK_FREQ
/
115200
);
xTaskCreate
(
mg_task
,
(
const
signed
char
*
)
"mongoose"
,
MG_TASK_STACK_SIZE
,
NULL
,
MGOS_TASK_PRIORITY
,
&
s_mg_task_handle
);
printf
(
"Free RAM: %d
\r\n
"
,
system_get_free_heap_size
());
xTaskCreate
(
mg_task
,
(
const
signed
char
*
)
"mongoose"
,
MG_TASK_STACK_SIZE
/
4
,
/* in 32-bit words */
NULL
,
MGOS_TASK_PRIORITY
,
NULL
);
}
uint32_t
user_rf_cal_sector_set
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment