Commit graph

32 commits

Author SHA1 Message Date
Joost Nieuwenhuijse
233f9a6a31 Change linker script to support C++ exceptions
See:
https://github.com/espressif/esp-idf/issues/459
https://github.com/jcmvbkbc/crosstool-NG/issues/54
2018-05-16 17:54:56 +02:00
Joost Nieuwenhuijse
ee001e0231 Move large lib_a-svfwprintf to flash
lib_a-svfwprintf may get included when linking against libstdc++
This will overflow IRAM

https://github.com/SuperHouse/esp-open-rtos/issues/623
2018-05-16 17:53:17 +02:00
Our Air Quality
e43329cbc7 Skip calling wrappers from a number of the ROM functions.
A number of the ROM functions were pointing to wrappers that saved and
restored the $a0 register, but the functions they called either did
not use $a0 or saved and restored $a0 as needed anyway.
2018-03-31 21:29:26 +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
Vlad Ivanov
c9851e9253 FreeRTOS: Drop reference to xthal_set_intset (#198) 2016-08-27 22:23:27 +02:00
Angus Gratton
d9202af2aa Use latest upstream rboot, always build with OTA - use prebuilt rboot if
none is compiled locally.
2016-05-28 11:27:10 +10:00
Angus Gratton
b304f65c21 Merge pull request #142 from SuperHouse/feature/rodata_defaults_flash
Store .rodata in flash by default
2016-05-28 11:25:45 +10:00
Angus Gratton
f0db26604f brk/malloc: Allow malloc to fail when out of RAM
Fixes #76.
2016-05-27 12:09:07 +10:00
Angus Gratton
d72aedf7b1 Store .rodata in flash by default
Closes #11
2016-05-23 15:20:06 +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
e8eac9614d Simplify linker script to remove preprocessing, not check flash sizes
Memory layout is now split into two linker scripts for OTA vs
non-OTA (different starting offsets), remaining functionality in
common.ld.

As discussed in #64, progress towards #38
2015-11-13 12:15:01 +11:00
Angus Gratton
fbea34b07a Linker script: Fix IROM0_LEN calculation
Use linker script arithmetic (yay?) to calculate flash size in bytes
from FLASH_SIZE in megabits.

Closes #64
2015-11-13 11:25:08 +11:00
Angus Gratton
1b22cc088e Add initial mbedTLS and HTTPS example project (using howsmyssl.com JSON API)
mbedTLS version 2.1.0 (current stable)

Has some known issues/hacks:
* Entropy source not hooked in at all
* Linker script has a messy hack in it to store some (not all) data in
  irom
2015-09-20 21:13:38 +10:00
Angus Gratton
f230fbcd65 Move start of IROM0 to 0x40220000, save 128kB of flash
Old starting point left 256kB for RAM sections, but I think they
shouldn't ever possibly exceed 128kB.
2015-09-20 21:13:38 +10:00
Michael Jacobsen
372827ac42 Mostly updated header files for use in C++ 2015-09-20 21:13:38 +10:00
Angus Gratton
ac0a947453 Merge branch 'master' into experiments/unaligned_load 2015-09-10 08:19:42 +10:00
Alex Stewart
c30f48c3b1 Fix linker script handling of irom/irom0 segments 2015-08-27 13:54:30 -07:00
Angus Gratton
25e124a612 ld: Link memmove into IRAM (used by sprintf, etc.) 2015-08-10 11:54:30 +10:00
Angus Gratton
19b8383069 Working TFTP server based OTA updates
Tested with 16MBit flash configuration, two rboot update slots.

Closes #10
2015-08-05 14:10:14 +10:00
Angus Gratton
efc454035c Move all code paths touched by NMI to IRAM
Prerequisite for calling Cache_Read_Disable() for OTA updates.

Massive thanks due to @foogod and their xtobjdis tool, creating the call
graph of where the wDev_ProcessFiq touched (including in newlib, etc.)
would have otherwise been very painful:
https://bitbucket.org/foogod/xtobjdis
2015-07-29 16:47:33 +10:00
Angus Gratton
ed7ba52c9a Add exception vectors & low-level handlers
At the moment these are almost bit-for-bit copies of the vector
behaviour in the RTOS SDK, but hopefully that will start to change.

Progress towards #2
2015-07-28 11:01:57 +10:00
Angus Gratton
87dc2317f5 Support building an OTA-compatible flash image
Image is suitable for SDK v1.2 bootloader or rBoot.
2015-07-21 15:27:19 +10:00
Angus Gratton
a566a51c09 Use linker scripts rather than libcirom/objcopy tricks to arrange
IRAM/IROM sections.

esp-open-rtos compiled code: .text goes into irom by default, symbols
explicitly marked with IRAM attribute go into iram.

SDK code: .text goes into iram by default, symbols marked with
ICACHE_FLASH_ATTR go into irom.

libgcc functions also go into iram by default.
2015-07-09 13:58:41 +10:00
Angus Gratton
a3c4469b1f Add a linker script comment for all the patched newlib _lock_xxx symbols 2015-06-16 16:34:13 +10:00
Angus Gratton
b7b16de429 Alias ets_printf directly to printf at link time
I thought maybe ets_printf had some special properties, but it doesn't
seem to have any so far.
2015-06-16 16:22:55 +10:00
Angus Gratton
93dc7edead Grow linker script irom section for 512KB flash chip
Necessary to fit http_get_ssl example, newlib string functions are
larger than espressif SDK implementations.
2015-06-16 14:23:47 +10:00
Angus Gratton
49268a33e1 Link against newlib from esp-open-sdk's libcirom, replace FreeRTOS heap management.
Compiles and runs, expects xtensa lock.c patch in newlib (will still run
otherwise but malloc/free and other functions will be non-memory-safe...)
2015-06-16 14:20:24 +10:00
Angus Gratton
0dbb6d31a5 Add IRAM attribute for IRAM loaded symbols, add to common FreeRTOS functions
Closes #7.

It'd be nice to change the linker script so .text is always linked to
IROM instead of needing to objcopy each compiled file. The sticking
point for this is libgcc & libhal, which have symbols in .text that need
to be loaded to IRAM.
2015-06-08 18:19:59 +10:00
Angus Gratton
a476fb007e Fix IROM macro 2015-06-08 17:58:10 +10:00
Angus Gratton
a173ffa81d Remove custom entry point, pending merge of esptool.py patch adding --entry-symbol option 2015-06-03 14:29:56 +10:00
Angus Gratton
e743d03a78 Preprocess all binary SDK symbols to add an sdk_ prefix
* This fixes the problem of axTLS symbols hmac_md5/hmac_sha1 having same
  name as symbols in libwpa (which have incompatible signatures)

* Also allows for easier identification and piece-by-piece removal of
  binary functions.

* Some libc symbols are not renamed, list is in lib/symbols_norename.txt
2015-06-02 15:08:35 +10:00
Angus Gratton
1ffbc303ff Working variant of esp_iot_rtos_sdk (files from commit ec75c85f9ef53) 2015-05-07 14:22:25 +10:00