Age | Commit message (Collapse) | Author | Files | Lines |
|
Oops, a brain fart. Sorry.
Fixes: d642a0994dea ("arm-xo-1.75: conditionalize protect-fw on sec-trg-gpio#")
|
|
|
|
This adds support for using CForth on the MMP3-based Ariel board, as
used in Dell Wyse 3020. It starts up on the small core and loads OFW
in a manner equivalent to what is done on OLPC CL4.
Among the differencies from CL4 are: diffrent DRAM, generally less
hardware hooked to GPIOs (no special keys, etc.), different EC,
and different display controller. The only UART that's routed to actual
connector on board is UART3 on pins 51 and 52.
The machine originally comes with proprietary "WLoader" firmware.
Running Open Firmware on it would make it suck considerably less.
|
|
This is a trivial rename.
The cl4 word conditionalizes things that are specific to MMP3, not the just
OLPC CL4 machine. Using the cl4 name outside OLPC would be misleading.
|
|
It is the only user and having to define it before loading lcd.fth sort
of sucks.
|
|
This will allow us to support SPI on board without the OLPC
security mechanism.
|
|
This essentially syncs up the bits that were left behind to rot from
arm-xo-1.75.
|
|
The native toolchain of Debian/armhf, and perhaps some other operating
systems, ships with libgcc that's no good for running on the "security
processor" PJ1/Mohawk core, because it uses Thumb-2 instructions.
Let's switch to the arm-none-eabi toolchain. It is available on both
Debian and Fedora regardless of what the native architecture is, so
it might be a pretty good default.
|
|
However, some distributions, such as Debian/armhf, ship with libgcc that uses
Thumb-2 instructions in their toolchains. The PJ1/Mohawk "security processor"
core has no support for that.
Let's add a sanity check, because CForth not working is a big deal (the
machine can't be unbricked without disassembling it).
Sadly, there doesn't seem to be a way to tell the linker to avoid
thumb-compiled binaries. Grepping for 16-bit instrucitons in our
disasembly does the trick for now.
|
|
|
|
No longer required.
|
|
Lower the initial brightness from 15 to 10. This applies to the period
between CForth start and Open Firmware opening the display device.
Rationale:
New display backlight LEDs are to enter production for XO-4.
These make display brighter; 169 cd/m², with DCON brightness register at
maximum, at the Sugar home view.
We keep the perceived brightness the same as before (125 cd/m² same test
conditions), but allow the user to raise the brightness above the
previous maximum. We also lose some level of control in the range
downwards.
A manufacturing tag BL will identify units with new display backlight,
but access to tags in CForth is (by design) very simple and not yet
worth complicating.
Intent - new firmware with new display will show constant brightness
from turn on until Linux booted, consistent with the full brightness of
the original design.
Side effect - new firmware with old display will show brief (2s) low
brightness followed by normal brightness once Open Firmware sees no BL
tag.
See #12854.
|
|
|
|
This way we can check whether it fits between the SRAM base and shim
itself and abort the build if it's too large for us to be able to copy.
|
|
CForth image has grown and needs more space. Hopefully we still have
enough stack space.
|
|
This makes sure we do build things consistently regardless of compiler
defaults or whether we're doing a native or cross build.
|
|
It is not used.
|
|
It makes no sense, our code executes from the same address. It also adds
a .git section we are not able to handle.
However, some compilers turn it on by default (e.g. Debian) and it needs to be
turned off explicitly.
|
|
It clashes with the word that calls pfsize().
|
|
split.fth provides it now.
|
|
util.fth provides those now.
|
|
This is so that app or platforms specific sources are perferred to
generic ones.
|
|
|
|
Fixes build:
Linking cforth.elf ...
arm-none-eabi-ld: tembed.o: in function `complete_word':
/home/lkundrak/src/cforth/build/arm-xo-1.75/../../src/cforth/lineedit.c:307: undefined reference to `strlen'
arm-none-eabi-ld: tembed.o: in function `propose_word':
/home/lkundrak/src/cforth/build/arm-xo-1.75/../../src/cforth/lineedit.c:349: undefined reference to `strlen'
make: *** [../../src/platform/arm-xo-1.75/targets.mk:60: cforth.elf] Error 1
|
|
Fixes a build failure:
../../src/platform/arm-xo-1.75/consoleio.c: In function 'init_io':
../../src/platform/arm-xo-1.75/consoleio.c:138:1: error: number of arguments doesn't match prototype
138 | {
| ^
In file included from ../../src/platform/arm-xo-1.75/consoleio.c:1:
../../src/cforth/forth.h:65:6: error: prototype declaration
65 | void init_io(int argc, char **argv, cell *up);
| ^~~~~~~
make: *** [../../src/common.mk:30: tconsoleio.o] Error 1
|
|
This is so that the tccalls.fth rule matches the correct source.
|
|
It's provided by util.fth now.
|
|
On x86_64 it builds, but doesn't seem to work:
$ make -C build/arm-xo-1.75
...
cc -o meta meta.o compiler.o io.o dictfile.o mallocl.o
./meta ../../src/cforth/interp.fth kernel.dic
(cd ../../src/cforth/embed; ../../../build/arm-xo-1.75/forth ../../../build/arm-xo-1.75/kernel.dic load.fth; mv forth.dic ../../../build/arm-xo-1.75)
Tried to execute a null token
|
|
The compiler would happily just chop the end off. We have to check the
actual size with sizeof() and cause the compiler to fail (hoping that it
minds arrays of negative size, like GCC does).
|
|
Make sure the input file was exactly the size we'd expect it to be.
|
|
This allows us to fail nicely in the event word size is unknown instead of this:
In file included from ../../src/cforth/embed/mallocembed.c:3:
../../src/cforth/forth.h:21:5: error: unknown type name 'u_cell'
21 | u_cell magic, serial, dstart, dsize, ustart, usize, entry, res1;
| ^~~~~~
../../src/cforth/forth.h:62:24: error: unknown type name 'u_cell'; did you mean 'cell'?
|
|
|
|
|
|
|
|
dot.fth is used only for debugging early build problems
and is not used for production builds.
|
|
and implement on ESP32 in addition to the existing ESP8266.
|
|
|
|
The distance from here to pad was only 100 bytes,
so double number conversion in binary on 64-bit
systems could overflow. Changed to 140 bytes,
giving room for 128 digits plus a few extras.
|
|
Also added new-file: for manually entering short files on ESPs.
|
|
|
|
|
|
|
|
|
|
|
|
TCP error message decoding
GPIO open drain support
Data type fix (string argument) to dns-gethostbyname
New "load-startup-file" factor
Support different flash sizes and I/O modes in download target
|
|
Thanks to David Phillip Oster for finding the fix.
|
|
|
|
Edit the IP address and Wifi credentials
In app.fth, "fload test-socket". Then run "probe-ssh"
|
|
Some libc6's already have a double_t
|
|
|
|
|
|
There was a lot of code to do double number arithmetic
that earlier C compilers could not handle, but
modern compilers have an impressive array of longer
types so that old arithmetic code can now be replaced by
the compiler's arithmetic on double-width types.
|
|
In the process, eliminated variant code for double
arithmetic in favor of parameterized code.
|
|
|
|
I hope it will work going forward. I tried to anticipate
some upcoming changes in the esp-idf makefiles that will
land in 3.2, but one never knows.
|
|
|
|
|
|
- Switch ESP8266 ADC between VCC sensing and external A0 pin
- Use the ESP8266 RTC to wakeup from deep sleep
- Stepper motor driver for Wemos motor shield
- Various fast ways to compute temperature from a PT100 thermistor
|
|
|
|
/setval?foo=3&bar=4
|
|
|
|
Callbacks from the network stack and alarm handlers
can damage the stacks of foreground applications, because
while the inner interpreter is running, the stack pointers
are in local variables that are not visible to the callback.
The solution is to switch to private stacks during callbacks.
|
|
|
|
|
|
|
|
Correctly installs the nodemcu SDK when you
start the build from an app other than the
default esp8266 one.
|
|
|
|
|
|
|
|
|
|
|
|
Some lines were moved into the common file
src/app/glfw/targets.mk so they did not need
to be in the top Makefiles
|
|
|
|
|
|
|
|
Moved stuff around to simplify app load files and to
make it easy to have per-app source and build directories.
|
|
Both files that are too large for the available RAM,
and ones larger than 32K.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It would be useful for interfaces to dynamic libraries.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bit band calculation for cortex M3/4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It supports, for example, the "Blue Pill" board that costs about $2.
At present, the only supported peripheral is USART1 connected via
PA9 (TX) and PA10 (RX).
|
|
The null implementation of init_io() in embed/consio.c prevented
the other generic routines thereif from being used with platforms
that need a non-null init_io(). Platforms than need a null init_io()
can easily add it, or can simply not call it from their main()
|
|
The rules in question need only the dependencies;
the corresponding actions are inferred from common.mk .
This keeps the actions in one place, so changes do
not need to be propagated to several places.
|
|
|
|
|
|
arm-teensy3 - serial receive hardware flow control
|
|
When enabled in build, Teensy 3.1 pin 6 is RTS and must be tied to CTS
of host. Host must be configured to observe CTS.
Tested with `screen /dev/ttyUSB0 115200,crtscts` no issues.
Tested with `cat /dev/ttyUSB0` and `for x in $(seq 10000); do echo -e "get-msecs .d ( $x )\n" > /dev/ttyUSB0; done` no issues.
|
|
arm-teensy3 - merge various changes
|
|
Clean EXTRA_CLEAN
|
|
- rebase arm-teensy3 platform code, to
f0d263c540180ef173f639224e93e7c6ce9c5d3d from
https://github.com/PaulStoffregen/cores
- allow any pin for analog writes,
- avoid redundant usb_init and analog_init calls,
- add RTC access words, thanks to Mitch's textend.c,
- fix layout of ccalls,
- fix paste via USB, by using half of the USB buffers for the TX path,
and half for the RX path, and hand over only RX buffers when RX
exhaustion is detected, tested with a million lines of paste,
- separate console controls; add new words uart-on uart-off uart? for
controlling UART console, and usb-on usb-off usb? for controlling USB
console,
- add new word restart to use watchdog method for forcing system reset,
and allow bye to fall out of interpreter into restart,
- add new word reflash for placing system into wait for loader,
equivalent to pressing the button,
- remove watchdog test file; only ever used for restarting.
- use $PATH for teensy_loader_cli,
- add -dirty to version if repository not pristine,
- clean up build log.
Co-authored-by: James Cameron <quozl@laptop.org>
|
|
- "make clean" was leaving files behind on my arm-teensy3 branch,
reported by Jordan Hubbard,
- remove some not-needed cleans of date.c, in embed-linux, esp32,
arm-teensy3,
- wrap long lines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Some changes to the factoring of vocabulary had
broken the OFW build.
|
|
Sensor drivers moved to src/sensors/
HTTP server common code moved to src/lib
Platform dependencies in server better isolated.
|
|
build/embed-linux64
|
|
CR-LF handling is now centralized
|
|
|
|
|
|
It caused failures with 64-bit embedded images.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thanks Rob Sciuk
|
|
|
|
|
|
Restore arm-teensy3 pump controller
|
|
- was lost in yesterday's rework,
- compile tested only.
|
|
Add arm-teensy3 isolated build
|
|
As of 8a02ea67f577c1798b50c38da9b74296a861b45a from
https://github.com/PaulStoffregen/cores
Also maintained in branch cforth in a fork
https://github.com/quozl/cores/tree/cforth
Passes LED blink test.
|
|
- add build date and commit hash to banner,
- add local strlen implementation.
Tested on Teensy 3.1.
arm-none-eabi-size app.elf
text data bss dec hex filename
72680 168 13688 86536 15208 app.elf
|
|
|
|
to me it implies that either the pc platform is not used or getchar is
not used
Signed-off-by: James Cameron <quozl@laptop.org>
|
|
- on some units, pin 13 does not float high enough, so require shorting
pin 13 and 14 to inhibit non-volatile buffer execution.
- fix a! argument specification list, analogWriteADC0 takes only one
argument.
|
|
|
|
- minimal teensy3 sources copied from
https://github.com/PaulStoffregen/cores.git
064c0b52eed1f91faa768f8d173cd84268dbbbfb
- hardware UART0 at 115200 baud with FIFO,
- USB serial console multiplexed with UART0,
- use EEPROM as a non-volatile text block to execute,
ground pin 13 to inhibit,
- first of the two I2C peripherals available, pins 18 and 19,
- built-in LED blink test, use `lb` to trigger.
|
|
Test built on Ubuntu 14.04 using;
```
cd build/arm-teensy3-pump && \
make CROSS=arm-none-eabi- LIBS=-lm
```
|
|
|
|
|
|
|
|
|
|
They are rarely needed and hard to compile because
of dependencies.
|
|
|
|
Drivers for ds1307 tsl2561
|
|
|
|
|
|
|
|
The default build now excludes support for the FTDI
low-level API and OPENGL. Those features are tricky
to use and tricky to compile because of complex dependencies.
|
|
That code is now irrelevant.
|
|
I2C drivers for af1271 mlx90614
|
|
|
|
|
|
Those modes requires additional packages to be installed, which can be
troublesome. Without FTDI, it is still possible to access serial ports
in their normal modes, but you cannot use the fancy features of FTDI
chips to do things like using them as GPIO ports.
|
|
A recent change broke the compilation of versions that use
T16 token encoding to save space. That change increased
the default dictionary size to a larger value than T16
encoding can handle. This fix ensures sets the default
dictionary size, when using T16, to the max value possible
for T16.
|
|
When the ESP8266 version starts, it looks for a
SPIFFS file named "start". If that file exists,
it is loaded as Forth source.
You can prevent the autoload by typing a key within 2 seconds.
|
|
With this change it should not be necessary to explicitly
download or patch the nodemcu-firmware tree, nor to explicitly
run make in that tree to "prime" the process. Running make in
build/esp8266 will do it all for you.
|
|
|
|
|
|
|
|
Also added some missing dependencies
|
|
|
|
|
|
The symptom was that "rf foo" would sometimes make
a file named "X" which was not deleteable because
the real name contained a non-printing character.
Also added "rm*" and "rm *" to clear out the file system.
|
|
e.g. "COMPORT=COM4 make download"
For complete functionality, the "loadit" script in nodemcu-firmware
must be modified to get the comport name from $1 instead of hardcoding.
|
|
|
|
Previously, OFW extensions were only built for ESP8266.
This patch adds ofw-windows32 and ofw-windows64 targets
that run under Windows with OFW extensions.
|
|
Recent versions of nodemcu_firmware do not have some of the
myspiffs_* functions, instead using a vfs abstraction.
With this commit, CForth will compile with either old or new
nodemcu_firmware
|
|
|
|
The problem was in ip_canonical(), which double-incremented
a pointer as it stepped through the word. [else] calls
$canonical after parsing each word of the input to be
discarded. If a single word exceeded half the size of
the input buffer, the double-increment would cause a write
past the end of the buffer, thus possibly smashing the heap.
This only showed up when compiling md5.fth from the OFW source.
That file contains an [ifdef] notdef block with an embedded
C comment block with a line of 72 asterisks.
|
|
Most of the Open Firmware files that were copied into
the CForth tree did not need any modifications, so I
deleted them in favor of using the files directly from
a copy of the openfirmware tree.
This leaves only a few files in src/ofw:
core/deblock.fth
This is a reimplementation of the deblocker package that does not
depend on the file code in the Forthmacs kernel
fs/ext2fs/ext2fs.fth
fs/ext2fs/methods2.fth
fs/fatfs/loadpkg.fth
fs/fatfs/methods2.fth
The "method2.fth" files similarly do not depend on Forthmacs
kernel file code, instead using the reimplemented deblocker package.
The load files ext2fs.fth and loadpkg.fth refer to "methods2.fth"
instead of the "methods.fth" files from openfirmare/
core/ofwcore.fth
objects.fth
These are mostly the same as the corresponding openfirmware/ files,
but with a few ifdefs to handle miscellaneous differences between
CForth and Forthmacs. The changes could easily be folded back into
the openfirmware/ tree.
disklabel/loadpkg.fth
Has additional ifdefs to permit the omission of some filesystems.
Would be easy to fold back into openfirmware/
filenv.fth
An implementation of NVRAM using SPIFFS files. This is similar
to openfirware/cpu/x86/pc/biosload/filenv.fth but it uses ANS Forth
standard file words instead of the Forthmacs file words. I think
that biosload/filenv.fth could be replaced by this one, since
OFW supports ANS file words.
nullfb.fth
These are no-op implementations of the frame buffer support routines,
for the benefit of systems where a color frame buffer is unlikely to
be present.
objsup.fth
CForth versions of the object support words. In OFW, these support
words are typically implemented in machine code. This file implements
them in high level Forth. This high-level implementation might be
useful in the OFW tree as a porting aid to new CPU architectures -
but one wonders if any new architectures will ever be added to the
OFW tree, or indeed if there will ever be any new CPU architectures.
ofw-support.fth
Implementations of a bunch of miscellaneous, mostly trivial, words
that Forthmacs has but CForth did not otherwise have.
|
|
In the process, renamed ofw-dt.fth back to its openfirmware tree
name ofwcore.fth, moving the pile of compatibility definitions
out to ofw-support.fth.
|
|
Couple of trivial fixes
|
|
This supports the nvedit and nvalias commands.
It required a kernel change for better support
of defer words early in the compilation process,
so that accept could be deferred properly.
|
|
|
|
.. by making reasonable-ip? cognizant of RAM/ROM dictionaries.
|
|
|
|
A change from awhile ago threw an error code from interact
when the stack underflowed, instead of printing an error
message. Since there was no enclosing top-level catch, that
caused the system to crash. This reinstates the error message
without using throw at that point.
|
|
init-ds18x20 leaves a "1" on stack.
|
|
|
|
ESP8266 TCP - add dns-gethostbyname
|
|
For queries by name, returns `ERR_INPROGRESS`, and the callback is given address of IP address, or 0 if name was not found.
For queries where the name is a numeric IP address, returns `ERR_OK`, with IP filled in, and no callback.
An extern was used because the build was unhappy with `dns.h` and didn't have the patience to resolve it.
Test case, in station mode associated with an access point:
```
: ?.ipaddr ( a.ip -- ) ?dup if .ipaddr else ." NULL" then ;
: dns-cb ( a.arg a.ip a.name -- )
rot
." dns-cb arg " . cr
swap
." dns-cb ip " ?.ipaddr cr
." dns-cb name " cscount type cr
;
create ip 4 allot \ not used unless query is numeric
42 ' dns-cb ip c" google.com" dns-gethostbyname . cr d# 1000 ms
43 ' dns-cb ip c" tooraweenah.com" dns-gethostbyname . cr d# 1000 ms
44 ' dns-cb ip c" bogus.tooraweenah.com" dns-gethostbyname . cr d# 1000 ms
45 ' dns-cb ip c" 127.0.0.1" dns-gethostbyname . cr ip ?.ipaddr cr
```
|
|
.. in particular, readers for FAT and EXT2 files.
|
|
|
|
I'm not sure how it got there.
|