Commit graph

67 commits

Author SHA1 Message Date
Angus Gratton
aea147ad6a Add C++ support to Makefile, and proof-of-concept simple.cpp example
This is a work in progress based on @mikejac's work.

Missing:
* No 'new' operator.
* I don't think STL is currently supported.
2015-09-20 21:13:38 +10:00
Michael Jacobsen
436aa8b8cc Mostly updated header files for use in C++ 2015-09-20 21:13:38 +10:00
Angus Gratton
3eb43c6ef5 Moved DoubleLoadStorageHandler to end of functions, improve fast path l8ui performance
This allows a conditional branch that previously required a full jump instruction not to require it.
2015-09-15 15:09:42 +10:00
Angus Gratton
6ad51e209a Fix performance regression in 3911a94cc 2015-09-15 15:00:56 +10:00
Angus Gratton
8a088f73db unaligned_load: Fix sign extension, add test case for sign extension
H/T to @foogod again for this.
2015-09-15 12:00:32 +10:00
Angus Gratton
e4c76b488c Remove the unaligned load handler to its own source file as it was getting quite complex
The downside here is needing to use #include so the 'beq' in the
exception vector can land on it directly, save an instruction.

There might be a better way to do this, but it seems hard to "curate"
the order that symbols appear in each section.
2015-09-15 11:34:21 +10:00
Angus Gratton
c759a2af05 Remove one more branch from l8ui code path
Thanks for @foogod for the heads-up on this.
2015-09-15 11:01:21 +10:00
Angus Gratton
390e007c75 Fix sign extension as suggested by @foogod
Also removes a branch from l8ui path, saves some cycles
2015-09-14 18:30:11 +10:00
Angus Gratton
44f2ba66e5 Exception vectors: Remove no-op syscallhandler 2015-09-14 18:17:45 +10:00
Angus Gratton
d4e5af7f0b NMI exception handler: Fix reserving too much RAM for registers 2015-09-14 17:43:29 +10:00
Angus Gratton
9ae2464258 Exception handlers: remove unused NMIHandlerAddress 2015-09-14 17:22:50 +10:00
Angus Gratton
6650369502 Use GPIO2 for led_debug.S 2015-09-14 17:20:00 +10:00
Angus Gratton
e347f296f3 Exception vectors: Rearrange to use absolute offets instead of .align hacks 2015-09-14 17:20:00 +10:00
Angus Gratton
1a4c829b1f Extended unaligned load support to work from DoubleExceptionVector
Allows handling bad loads that occur inside level 1 exception handlers.
2015-09-14 17:20:00 +10:00
Angus Gratton
a5266adb48 Merge branch 'master' into experiments/unaligned_load 2015-09-10 08:19:42 +10:00
Angus Gratton
c55cfd3b2e Merge branch 'fix/int32_t'
Closes #42
2015-09-09 16:23:31 +10:00
Angus Gratton
1221e2117b Rework component makefiles to have a default <component>_ROOT
This fixes a long-standing bug where build directories sometimes
expanded many levels deeper than they should have.

Component names can now no longer contains slashes (ie the component
name for 'extras/i2c' is now just 'i2c')
2015-09-08 09:59:59 +10:00
Angus Gratton
e61e84ca7d libc: Redefine int32_t/uint32_t as 'int' not 'long'
libc built from projectgus/newlib-xtensa@0077776963

Closes #42
2015-09-05 13:37:00 +10:00
Angus Gratton
5aa095298d libc syscalls: ENOSYS implementations for open,fstat,close,lseek
Closes #41
2015-09-03 11:45:52 +10:00
Angus Gratton
006c73c7ba libc read()/write() syscalls - return EBADF if fd is not stdin/stdout as applicable
As discussed in #41

Also fixes indent in _read_r
2015-09-03 11:34:54 +10:00
Alex Stewart
78be94744c Fix broken UART(i) definition 2015-08-25 22:31:47 -07:00
Alex Stewart
0155632dd3 Remove 'packed' attribute from all regs structs 2015-08-25 17:13:13 -07:00
Alex Stewart
b76bf99d7c Remove unnecessary AND for VAL2FIELD macro
Added VAL2FIELD_M / SET_FIELD_M for rare cases when there might actually be some need for it.
2015-08-25 17:07:06 -07:00
Angus Gratton
76ad427dc2 Merge pull request #29 from foogod/issue_8
Add more *_regs.h definitions
2015-08-24 16:14:19 +10:00
Angus Gratton
08bb9f16e7 Add a comment explaining commented out REG_BASE lines
Change was part of #27
2015-08-22 17:39:25 +10:00
Alex Stewart
9f3f3e5b08 Add esp/rtcmem_regs.h 2015-08-21 14:20:00 -07:00
Alex Stewart
b482a1cc77 Fix a couple of struct def issues with 2 previous commits 2015-08-21 14:06:38 -07:00
Alex Stewart
3f3f257612 Add more regs to esp/dport_regs.h
Added a bunch of definitions based on info in http://esp8266-re.foogod.com/wiki/Memory_Map#dport0
2015-08-21 13:59:20 -07:00
Alex Stewart
af32217805 Add esp/uart_regs.h and esp/spi_regs.h 2015-08-21 13:56:23 -07:00
Alex Stewart
d79c1c3983 rename GPIO_CONF_DRIVER_ENABLE back to GPIO_CONF_PUSH_PULL 2015-08-21 09:54:20 -07:00
Alex Stewart
13b924d259 Fix leftover IOMUX_FUNC_A/D references 2015-08-19 16:53:02 -07:00
Alex Stewart
0d6af96f2d Cleanup a few comments in *_regs.h files 2015-08-19 16:50:56 -07:00
Alex Stewart
c32a6692a0 Add esp/wdt_regs.h 2015-08-19 16:48:11 -07:00
Alex Stewart
eaa090e267 Added esp/timer_regs.h and esp/dport_regs.h 2015-08-19 11:34:18 -07:00
Alex Stewart
3cc5d1fa86 Replace stdint.h with esp/types.h in gpio_regs.h 2015-08-19 09:05:03 -07:00
Alex Stewart
5e6b022e39 Fix cut-paste error in gpio_regs.h comment 2015-08-19 09:03:18 -07:00
Alex Stewart
7fa2817f1b Add esp/gpio_regs.h 2015-08-18 22:46:25 -07:00
Alex Stewart
9727df5f6c Add esp/iomux_regs.h 2015-08-18 17:38:31 -07:00
Angus Gratton
7f338e66cb Unaligned load: Remove debugging variables 2015-08-11 16:25:35 +10:00
Angus Gratton
e3b24df043 Unaligned load: Shave a few more instructions off 2015-08-11 16:25:11 +10:00
Angus Gratton
3b3f5ea771 Unaligned loads: Only save working registers, use jump table to load non-working registers 2015-08-11 15:29:53 +10:00
Angus Gratton
8ea4ae27e2 Unaligned loader: Support l16si 2015-08-11 15:03:53 +10:00
Angus Gratton
773a046dc3 Unaligned loader: clean up, reduce number of registers 2015-08-11 14:23:41 +10:00
Angus Gratton
bfd38cd1e2 Experimental support for storing const strings in SPI flash or IRAM
As discussed in #11

Known limitations:
- Only supports l8ui/l16ui
- Unoptimised load routine
- Not called from DoubleExceptionHandler but should be
- Doesn't restore state properly when falling through to fatal exception handler
2015-08-10 12:03:03 +10:00
Angus Gratton
d685581829 Syscall hander: Fix a3 save address
(SDK doesn't use syscall exception so bug probably never hit?)
2015-08-10 11:54:30 +10:00
Johan Kanflo
3bacab7c67 Correct prototype for sdk_uart_rx_one_char, kudos to @foogod 2015-08-07 13:26:06 +02:00
Angus Gratton
bed6907d22 Exception vector address must be 256 byte aligned
Not actually a problem with the current linker script as the address is
predetermined there at start of IRAM, but might as well be accurate
about it.

As per advice from @foogod on esp8266-re mailing list:
https://groups.google.com/d/msg/esp8266-re/1ljIY3Zttbo/HvzHSWOLCgAJ
2015-08-06 09:54:46 +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
aed843fc14 exception_vectors: Remove some cruft some the symbol table 2015-07-30 10:10:37 +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