Update README files
This commit is contained in:
parent
f9ff3469f6
commit
333824c32b
@ -14,6 +14,7 @@ Contents
|
|||||||
- Stack Size Issues
|
- Stack Size Issues
|
||||||
- Networking Issues
|
- Networking Issues
|
||||||
- X11 Issues
|
- X11 Issues
|
||||||
|
o BASIC
|
||||||
o Configurations
|
o Configurations
|
||||||
|
|
||||||
Overview
|
Overview
|
||||||
@ -166,6 +167,96 @@ XOpenDisplay() aborted the program. UPDATE: This was caused by the small stack
|
|||||||
size and can be fixed by increasing the size of the NuttX stack that calls into
|
size and can be fixed by increasing the size of the NuttX stack that calls into
|
||||||
X11. See the discussion "Stack Size Issues" above.
|
X11. See the discussion "Stack Size Issues" above.
|
||||||
|
|
||||||
|
BASIC
|
||||||
|
^^^^^
|
||||||
|
|
||||||
|
BASIC
|
||||||
|
=====
|
||||||
|
I have used the sim/nsh configuration to test Michael Haardt's BASIC interpreter
|
||||||
|
that you can find at apps/interpreters/bas.
|
||||||
|
|
||||||
|
Bas is an interpreter for the classic dialect of the programming language
|
||||||
|
BASIC. It is pretty compatible to typical BASIC interpreters of the 1980s,
|
||||||
|
unlike some other UNIX BASIC interpreters, that implement a different
|
||||||
|
syntax, breaking compatibility to existing programs. Bas offers many ANSI
|
||||||
|
BASIC statements for structured programming, such as procedures, local
|
||||||
|
variables and various loop types. Further there are matrix operations,
|
||||||
|
automatic LIST indentation and many statements and functions found in
|
||||||
|
specific classic dialects. Line numbers are not required.
|
||||||
|
|
||||||
|
There is also a test suite for the interpreter that can be found at
|
||||||
|
apps/examples/bastest.
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
-------------
|
||||||
|
Below are the recommended configuration changes to use BAS with the
|
||||||
|
stm32f4discovery/nsh configuration:
|
||||||
|
|
||||||
|
Dependencies:
|
||||||
|
CONFIG_LIBC_EXECFUNCS=y : exec*() functions are required
|
||||||
|
CONFIG_LIBM=y : Some floating point library is required
|
||||||
|
CONFIG_LIBC_FLOATINGPOINT=y : Floating point printing support is required
|
||||||
|
CONFIG_LIBC_TMPDIR="/tmp" : Writable temporary files needed for some commands
|
||||||
|
|
||||||
|
Enable the BASIC interpreter. Other default options should be okay:
|
||||||
|
CONFIG_INTERPRETERS_BAS=y : Enables the interpreter
|
||||||
|
CONFIG_INTERPREPTER_BAS_VT100=y
|
||||||
|
|
||||||
|
The BASIC test suite can be included:
|
||||||
|
CONFIG_FS_ROMFS=y : ROMFS support is needed
|
||||||
|
CONFIG_EXAMPLES_BASTEST=y : Enables the BASIC test setup
|
||||||
|
CONFIG_EXAMPLES_BASTEST_DEVMINOR=6
|
||||||
|
CONFIG_EXAMPLES_BASTEST_DEVPATH="/dev/ram6"
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
This setup will initialize the BASIC test (optional): This will mount
|
||||||
|
a ROMFS file system at /mnt/romfs that contains the BASIC test files:
|
||||||
|
|
||||||
|
nsh> bastest
|
||||||
|
Registering romdisk at /dev/ram6
|
||||||
|
Mounting ROMFS filesystem at target=/mnt/romfs with source=/dev/ram6
|
||||||
|
nsh>
|
||||||
|
|
||||||
|
The interactive interpreter is started like:
|
||||||
|
|
||||||
|
nsh> bas
|
||||||
|
bas 2.4
|
||||||
|
Copyright 1999-2014 Michael Haardt.
|
||||||
|
This is free software with ABSOLUTELY NO WARRANTY.
|
||||||
|
>
|
||||||
|
|
||||||
|
Ctrl-D exits the interpreter.
|
||||||
|
|
||||||
|
The test programs can be ran like this:
|
||||||
|
|
||||||
|
nsh> bastest
|
||||||
|
Registering romdisk at /dev/ram0
|
||||||
|
Mounting ROMFS filesystem at target=/mnt/romfs with source=/dev/ram0
|
||||||
|
nsh> bas /mnt/romfs/test01.bas
|
||||||
|
1
|
||||||
|
hello
|
||||||
|
0.0002
|
||||||
|
0.0000020
|
||||||
|
0.0000002
|
||||||
|
|
||||||
|
nsh>
|
||||||
|
|
||||||
|
Or you can load a test into memory and execute it interactively:
|
||||||
|
|
||||||
|
nsh> bas
|
||||||
|
bas 2.4
|
||||||
|
Copyright 1999-2014 Michael Haardt.
|
||||||
|
This is free software with ABSOLUTELY NO WARRANTY.
|
||||||
|
> load "/mnt/romfs/test01.bas"
|
||||||
|
> run
|
||||||
|
1
|
||||||
|
hello
|
||||||
|
0.0002
|
||||||
|
0.0000020
|
||||||
|
0.0000002
|
||||||
|
>
|
||||||
|
|
||||||
Configurations
|
Configurations
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ Contents
|
|||||||
- SSD1289
|
- SSD1289
|
||||||
- UG-2864AMBAG01 / UG-2864HSWEG01
|
- UG-2864AMBAG01 / UG-2864HSWEG01
|
||||||
- STM32F4Discovery-specific Configuration Options
|
- STM32F4Discovery-specific Configuration Options
|
||||||
|
- BASIC
|
||||||
- Configurations
|
- Configurations
|
||||||
|
|
||||||
Development Environment
|
Development Environment
|
||||||
@ -1042,6 +1043,104 @@ STM32F4Discovery-specific Configuration Options
|
|||||||
CONFIG_STM32_USBHOST_PKTDUMP - Dump all incoming and outgoing USB
|
CONFIG_STM32_USBHOST_PKTDUMP - Dump all incoming and outgoing USB
|
||||||
packets. Depends on CONFIG_DEBUG.
|
packets. Depends on CONFIG_DEBUG.
|
||||||
|
|
||||||
|
BASIC
|
||||||
|
=====
|
||||||
|
I have used the stm32f4discovery/nsh configuration to test Michael Haardt's
|
||||||
|
BASIC interpreter that you can find at apps/interpreters/bas.
|
||||||
|
|
||||||
|
Bas is an interpreter for the classic dialect of the programming language
|
||||||
|
BASIC. It is pretty compatible to typical BASIC interpreters of the 1980s,
|
||||||
|
unlike some other UNIX BASIC interpreters, that implement a different
|
||||||
|
syntax, breaking compatibility to existing programs. Bas offers many ANSI
|
||||||
|
BASIC statements for structured programming, such as procedures, local
|
||||||
|
variables and various loop types. Further there are matrix operations,
|
||||||
|
automatic LIST indentation and many statements and functions found in
|
||||||
|
specific classic dialects. Line numbers are not required.
|
||||||
|
|
||||||
|
There is also a test suite for the interpreter that can be found at
|
||||||
|
apps/examples/bastest.
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
-------------
|
||||||
|
Below are the recommended configuration changes to use BAS with the
|
||||||
|
stm32f4discovery/nsh configuration:
|
||||||
|
|
||||||
|
Dependencies:
|
||||||
|
CONFIG_LIBC_EXECFUNCS=y : exec*() functions are required
|
||||||
|
CONFIG_LIBM=y : Some floating point library is required
|
||||||
|
CONFIG_LIBC_FLOATINGPOINT=y : Floating point printing support is required
|
||||||
|
CONFIG_LIBC_TMPDIR="/tmp" : Writable temporary files needed for some commands
|
||||||
|
CONFIG_FS_FAT=y : With FAT you create a RAMDISK at /tmp
|
||||||
|
CONFIG_FAT_LFN=y : FAT is difficult to use with long file names
|
||||||
|
|
||||||
|
Enable the BASIC interpreter. Other default options should be okay:
|
||||||
|
CONFIG_INTERPRETERS_BAS=y : Enables the interpreter
|
||||||
|
CONFIG_INTERPREPTER_BAS_VT100=y
|
||||||
|
|
||||||
|
The BASIC test suite can be included:
|
||||||
|
CONFIG_FS_ROMFS=y : ROMFS support is needed
|
||||||
|
CONFIG_EXAMPLES_BASTEST=y : Enables the BASIC test setup
|
||||||
|
CONFIG_EXAMPLES_BASTEST_DEVMINOR=0
|
||||||
|
CONFIG_EXAMPLES_BASTEST_DEVPATH="/dev/ram0"
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
This setup will initialize the BASIC test (optional): This will mount
|
||||||
|
a ROMFS file system at /mnt/romfs that contains the BASIC test files:
|
||||||
|
|
||||||
|
nsh> bastest
|
||||||
|
Registering romdisk at /dev/ram0
|
||||||
|
Mounting ROMFS filesystem at target=/mnt/romfs with source=/dev/ram0
|
||||||
|
nsh>
|
||||||
|
|
||||||
|
These steps will create and mount a RAMDISK at /tmp (required only for a
|
||||||
|
few BASIC commands). This will create a RAMDISK device at /dev/ram1 with
|
||||||
|
size = 512 * 64 = 32KiB and mount it at /tmp:
|
||||||
|
|
||||||
|
nsh> mkrd -m 1 -s 512 64
|
||||||
|
nsh> mkfatfs /dev/ram1
|
||||||
|
nsh> mount -t vfat /dev/ram1 /tmp
|
||||||
|
nsh>
|
||||||
|
|
||||||
|
The interactive interpreter is started like:
|
||||||
|
|
||||||
|
nsh> bas
|
||||||
|
bas 2.4
|
||||||
|
Copyright 1999-2014 Michael Haardt.
|
||||||
|
This is free software with ABSOLUTELY NO WARRANTY.
|
||||||
|
>
|
||||||
|
|
||||||
|
Ctrl-D exits the interpreter.
|
||||||
|
|
||||||
|
The test programs can be ran like this:
|
||||||
|
|
||||||
|
nsh> bastest
|
||||||
|
Registering romdisk at /dev/ram0
|
||||||
|
Mounting ROMFS filesystem at target=/mnt/romfs with source=/dev/ram0
|
||||||
|
nsh> bas /mnt/romfs/test01.bas
|
||||||
|
1
|
||||||
|
hello
|
||||||
|
0.0002
|
||||||
|
0.0000020
|
||||||
|
0.0000002
|
||||||
|
|
||||||
|
nsh>
|
||||||
|
|
||||||
|
Or you can load a test into memory and execute it interactively:
|
||||||
|
|
||||||
|
nsh> bas
|
||||||
|
bas 2.4
|
||||||
|
Copyright 1999-2014 Michael Haardt.
|
||||||
|
This is free software with ABSOLUTELY NO WARRANTY.
|
||||||
|
> load "/mnt/romfs/test01.bas"
|
||||||
|
> run
|
||||||
|
1
|
||||||
|
hello
|
||||||
|
0.0002
|
||||||
|
0.0000020
|
||||||
|
0.0000002
|
||||||
|
>
|
||||||
|
|
||||||
Configurations
|
Configurations
|
||||||
==============
|
==============
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user