Commit graph

41 commits

Author SHA1 Message Date
Our Air Quality
f9ae521710 newlib: rebuild with the global stdio streams enabled.
This change means that there is only one set of global stdin, stdout, and stderr
FILE streams shared by all the threads. This reduces memory usage and avoids
having to close these streams before threads exit. These streams still have a
lock to synchronise access.
2018-02-28 23:44:27 +11:00
Our Air Quality
3c81f7d587 lwip update
* The mdns responder has been reworked to lower stack and memory usage. This is
  a variation on the upstream code, it use malloc whereas the upstream code uses
  pools. The high stack usage of the mdns responder was problem for
  esp-open-rtos, so we might have to maintain the differences for now.

* Improved lwip core locking, and lock checking. Upstream improvements, that
  need some added support from esp-open-rtos specific code. More core lock is
  performed when calling from the esp-open-rtos code now, so a little safer. The
  checking is not enforced, but projects might see warning messages and might
  want to look into them.

* The esp-open-rtos lwip support has been sync'ed with the new freertos port
  included with lwip. There are still some minor differences.

* A few lwip timer bugs have been resolved. This might help resolve some issues.

* Plus it picks up all the other upstream fixes and improvements.

* The default lwip stack has been lowered from 768 words to 480 words,
  due to the reduced stack usage by the mdns responder.
2018-02-09 20:26:02 +11:00
Our Air Quality
c3dbac37ef Change the netif default to the station in STATIONAP mode.
It seems most common for the connection to the wider internet to be
via the station netif even if there is also an AP netif, so set the
default to the station netif. The lwip ipv4 route logic will still use
the AP netif if the destination is to that subnet.
2017-12-30 20:51:53 +11:00
Ruslan V. Uss
e5e902589c
Merge pull request #523 from ourairquality/reclaim-wdev-bss
Reclaim a chunk of unused dram in the wdev bss area, 8000 bytes.
2017-12-28 06:48:16 +05:00
Ruslan V. Uss
a922ea0383
Merge pull request #519 from ourairquality/heap-end-use-startup-stack
Reuse the startup stack for the dynamic heap.
2017-12-25 22:00:35 +05:00
Our Air Quality
aa0b7f5005 Reclaim a chunk of unused dram in the wdev bss area, 8000 bytes. 2017-12-19 14:12:02 +11:00
Our Air Quality
724bf797b1 Reuse the startup stack for the dynamic heap.
Once scheduling has started, the startup stack is no longer usable, control can
never return to that stack. So bump up the heap end in the first task that runs
after scheduling has started. This gives back about 1k.
2017-12-14 07:48:25 +11:00
Our Air Quality
e9d9201527 Newlib: implement locks
* Dynamically allocate arc4random data. Saves about 1k off the bss.
2017-12-13 11:29:43 +11:00
Our Air Quality
cd23acaa4a LwIP v2 support 2017-08-30 13:51:32 +10:00
Our Air Quality
ec5dabd237 sysparam: reserve one more flash sector before placing the sysparams
This is to help work with recent SDKs that add a RF cal sector by
default in the fifth last sector - just so the sysparam sectors do not
jump around when using different SDK versions.
2017-08-30 13:51:32 +10:00
Andrew Clink
03597d9162 Make FreeRTOS hooks weak; Add example 2017-03-20 12:56:17 -07:00
Tuan PM
2b915c11c7 add some missing include & fixed display output on sh1104 (#319)
* add some missing include

* Fixed display on SH1106
2017-01-03 00:40:54 +02:00
Our Air Quality
1728ef3dfc Flush the uart tx fifo before a restart. (#274)
Also comment the point at which the bus clock that drives the uart changes on startup and comment out the change in the uart divisor. This at least allows a consistent uart baud rate during a restart if using the rate 115200.
2016-11-18 11:34:03 +02:00
Our Air Quality
e48910ea3b Update and re-organise the sdk internal definitions. (#267) 2016-11-14 00:05:13 +02:00
Our Air Quality
a5cc728079 FreeRTOS type updates. (#261) 2016-11-05 12:04:03 +02:00
OurAirQuality
7bab80c33d FreeRTOS v9.0.0 upgrade 2016-10-25 23:35:51 +11:00
Johan Kanflo
40dc3bf945 Sysparam by @foogod (#180)
* Sysparam implementation

sysparam improvements

Mostly done, a few minor cleanups left.

Add sysparam_editor example

Sysparam code cleanup

Add documentation to sysparam.h

Fix up sysparam.h docs

Added a couple more debug statements

Fix potential memory leak if realloc() fails

Major sysparam overhaul

Add sysparam_get_info function

Add sysparam initialization to app_main.c

* Fixed warnings, added license
2016-08-18 12:07:46 +02:00
Angus Gratton
678b59babf Honour values of configCPU_CLOCK_HZ & configTICK_RATE_HZ for tick rate
Fixes #147

* Can vary tick rate from 100Hz via configTICK_RATE_HZ. Note that the
  SDK binary libraries are hard-coded to assume the tick rate is 100Hz,
  so changing the tick rate may have unexpected consequences for lower
  layer WiFi behaviour (such as certain kinds of timeouts happening
  faster/slower.)

* Setting configCPU_CLOCK_HZ to 160MHz means ESP will set 160MHz during
  initialisation. Only 80MHz and 160MHz are supported.

* Timing of tasks is no longer affected by current CPU freq (whether set
  via configCPU_CLOCK_HZ or via sdk_system_update_cpu_freq().)
  Previously doubling the CPU frequency would double the tick rate.
2016-07-06 17:22:09 +10:00
Alex Stewart
8c9a77efe8 Added first half of RE'd user_interface.c 2016-07-06 17:21:34 +10:00
Angus Gratton
04b119a61e Seed libc PRNG from hardware RNG on reset 2016-06-30 08:18:10 +10:00
Angus Gratton
3ba19d7c4e Merge pull request #137 from SuperHouse/feature/better_crash_dumps
Better crash dumps
2016-05-17 09:38:19 +10:00
Angus Gratton
36886412e6 Add abort() implementation
Also reduces the IRAM footprint of the fatal exception handler, as only
the prelude (which disables interrupts & enables the flash mapping) is
in IRAM now.

Closes #54, relevant to #133.
2016-05-15 22:30:01 +10:00
Angus Gratton
52f9b13faf Break out debug dump functions into their own compilation unit 2016-05-15 22:30:01 +10:00
Angus Gratton
f9fb0f212c Add stack memory dump to fatal exception handler 2016-05-15 22:24:40 +10:00
Angus Gratton
b61d06e940 Wrap structure around phy_info PHY initialisation settings
Add notes based on testing some of the values found there.
2016-05-15 22:21:10 +10:00
Angus Gratton
fee987d5cf Startup code: Move user_start_phase2 to irom section
This saves 1020 bytes from the text (IRAM) section by preventing
inlining of user_start_phase2() (and dump_flash_config_sectors() as
well) into the IRAM function sdk_user_start().
2016-05-15 22:16:42 +10:00
Angus Gratton
dccc57433d Move static constructor calls to after PHY, clock & baud rate are setup
Otherwise anything printed inside the constructor happens at unexpected baud rate.

Ref #128
2016-04-24 18:52:20 +10:00
Angus Gratton
b61b62136b gcc __attribute__((constructor)): Remove hacked calling, move ctor sections to flash
More hacky moving of parts of .rodata to flash, until we can move all of
it.

Candidate fix for #128
2016-04-24 18:52:16 +10:00
Angus Gratton
d1091b69d1 Make the task stack overflow message clearer
Related to #96
2016-02-24 08:54:32 +11:00
Angus Gratton
c2e3541c05 Disable default line-buffering of stdout
As discussed in #52. Application can re-enable buffering on stdout with setbuf() or setbuf()
2015-10-11 09:21:30 +11:00
Angus Gratton
0c6a8881a4 Fix sdk_uart_rx_one_char implementation, move into sdk_compat.c 2015-10-06 23:48:28 +11:00
Angus Gratton
7823a28ff8 Change default baud rate back to 74906bps, compatible with boot ROM rate
This reverts a behaviour change from 3ceadfc0a6.
2015-10-06 23:11:17 +11:00
Angus Gratton
0c0668bfa0 app_main: Refactor to use uart.h functions instead of raw register access
This removes the automatic insertion of CR ahead of LF by the SDK putc
function when called inside the SDK (although we'd already replaced
printf, so most were bypassing this putc function anyhow.)
2015-10-06 18:14:05 +11:00
Angus Gratton
3ceadfc0a6 uart.h: Add uart_get_baud/uart_set_baud functions, change default baud rate from 74906 to 115200 2015-10-06 17:49:00 +11:00
Alex Stewart
b280f8a725 Fix format strings in app_main.c 2015-09-20 14:09:30 -07:00
Alex Stewart
19f01b2f72 app_main.c: load correct g_ic sector from flash 2015-08-30 13:37:40 -07:00
Alex Stewart
8b5e8b923e Bug fix for dump_flash_config_sectors 2015-08-30 12:11:08 -07:00
Alex Stewart
a88f36d986 More app_main.c fixups
It's alive! IT'S ALIVE!!
2015-08-28 18:53:43 -07:00
Alex Stewart
a9eb3a38e3 More app_main fixups from object code comparisons 2015-08-28 18:53:43 -07:00
Alex Stewart
aa7f305e16 Various app_main.c bug fixes 2015-08-28 18:53:43 -07:00
Alex Stewart
a044c061d5 Replace libmain:app_main.o with core/app_main.c 2015-08-28 18:53:43 -07:00