You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/03/13 23:05:44 UTC
[incubator-nuttx] branch master updated: z20x: Performance
Improvements
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new ef604f8 z20x: Performance Improvements
ef604f8 is described below
commit ef604f8d43faa92160fd43fa80fb1638ed8298de
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Fri Mar 13 10:45:12 2020 -0600
z20x: Performance Improvements
- boards/z80/ez80/z20x/scripts/z20x_*.linkcmd: Reduce from 4 to 1 wait state. That i sufficient because of the slow clocking of the eZ80F92
- boards/z80/ez80/z20x/src/w25_main.c: Replace CRC algorithm with simple, less time consuming check sum.
- boards/z80/ez80/z20x/configs/nsh: Rename the nsh_ram configuration to just nsh
- boards/z80/ez80/z80x/configs/hello: Add simpler program to make debugging the loader easier.
---
boards/z80/ez80/z20x/README.txt | 28 +++++++--
.../z20x/configs/{nsh_ram => hello}/.gitignore | 0
.../z20x/configs/{nsh_ram => hello}/README.txt | 8 +--
.../ez80/z20x/configs/{w25boot => hello}/defconfig | 22 +++----
.../w25boot.zdsproj => hello/hello.zdsproj} | 71 +++++++++++-----------
.../{nsh_ram/nsh.zfpproj => hello/hello.zfpproj} | 8 +--
.../nsh_flash.ztgt => hello/hello_flash.ztgt} | 0
.../{nsh_ram/nsh_ram.ztgt => hello/hello_ram.ztgt} | 0
.../ez80/z20x/configs/{nsh_ram => nsh}/.gitignore | 0
.../ez80/z20x/configs/{nsh_ram => nsh}/README.txt | 2 +-
.../ez80/z20x/configs/{nsh_ram => nsh}/defconfig | 0
.../ez80/z20x/configs/{nsh_ram => nsh}/nsh.zdsproj | 0
.../ez80/z20x/configs/{nsh_ram => nsh}/nsh.zfpproj | 0
.../z20x/configs/{nsh_ram => nsh}/nsh_flash.ztgt | 0
.../z20x/configs/{nsh_ram => nsh}/nsh_ram.ztgt | 0
boards/z80/ez80/z20x/configs/w25boot/defconfig | 2 +
.../z80/ez80/z20x/configs/w25boot/w25boot.zdsproj | 8 +--
.../z80/ez80/z20x/scripts/z20x_copytoram.linkcmd | 2 +-
boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd | 2 +-
boards/z80/ez80/z20x/scripts/z20x_loader.linkcmd | 2 +-
boards/z80/ez80/z20x/scripts/z20x_program.linkcmd | 2 +-
boards/z80/ez80/z20x/src/w25_main.c | 67 +++++++++++++++++---
22 files changed, 148 insertions(+), 76 deletions(-)
diff --git a/boards/z80/ez80/z20x/README.txt b/boards/z80/ez80/z20x/README.txt
index d65f0cb..9aa6578 100644
--- a/boards/z80/ez80/z20x/README.txt
+++ b/boards/z80/ez80/z20x/README.txt
@@ -204,7 +204,25 @@ Common Configuration Notes
Configuration Subdirectories
----------------------------
- nsh_ram:
+ hello:
+
+ This is a minimal "Hello, World!" program that runs out of RAM. It is
+ a small program that is really useful only for testing the bootloader.
+
+ NOTES:
+
+ 1. Debugging from RAM
+
+ You can debug from RAM version using ZDS-II as follows:
+
+ a. Connect to the debugger,
+ b. Reset, Go, and Break. This will initialize the external RAM
+ c. Break and Load the nuttx.lod file
+ c. Set the PC to 0x050000
+ d. Single step a few times to make sure things look good, then
+ e. Go
+
+ nsh:
This configuration builds the NuttShell (NSH). That code can be
found in apps/system/nsh and apps/system/nshlib.. For more
@@ -290,14 +308,14 @@ Configuration Subdirectories
NOTE: The is no card detect signal so the microSD card must be
placed in the card slot before the system is started.
- 3. Debugging the RAM version
+ 3. Debugging from RAM
- You can debug the all RAM version using ZDS-II as follows:
+ You can debug from RAM version using ZDS-II as follows:
a. Connect to the debugger,
b. Reset, Go, and Break. This will initialize the external RAM
c. Break and Load the nuttx.lod file
- c. Set the PC to 0x040000
+ c. Set the PC to 0x050000
d. Single step a few times to make sure things look good, then
e. Go
@@ -375,4 +393,4 @@ Configuration Subdirectories
2. Booting large programs from the serial FLASH is unbearably slow;
you will think that the system is simply not booting at all. There
is probably some bug contributing to this probably (maybe the timer
- interrupt rate?)
\ No newline at end of file
+ interrupt rate?)
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/.gitignore b/boards/z80/ez80/z20x/configs/hello/.gitignore
similarity index 100%
copy from boards/z80/ez80/z20x/configs/nsh_ram/.gitignore
copy to boards/z80/ez80/z20x/configs/hello/.gitignore
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/README.txt b/boards/z80/ez80/z20x/configs/hello/README.txt
similarity index 54%
copy from boards/z80/ez80/z20x/configs/nsh_ram/README.txt
copy to boards/z80/ez80/z20x/configs/hello/README.txt
index db71007..706dbdb 100644
--- a/boards/z80/ez80/z20x/configs/nsh_ram/README.txt
+++ b/boards/z80/ez80/z20x/configs/hello/README.txt
@@ -1,13 +1,13 @@
README.txt
^^^^^^^^^^
-nsh.zdsproj is a simple ZDS-II project that will allow you
+hello.zdsproj is a simple ZDS-II project that will allow you
to use the ZDS-II debugger.
-nsh.zfpproj is a simple project that will allow you to use the Smart Flash
+hello.zfpproj is a simple project that will allow you to use the Smart Flash
Programming. NOTE: As of this writing this project does not work, probably
due to RAM configuration in the project. Use ZDS-II instead as is described
in the upper README.txt file
-nsh_ram.ztgt is the target file that accompanies the project files. This
+hello_ram.ztgt is the target file that accompanies the project files. This
one is identical to boards/scripts/z20x_ram.ztgt.
-nsh_ram.ztgt is the target file that accompanies the project files. This
+hello_flash.ztgt is the target file that accompanies the project files. This
one is identical to boards/scripts/z20x_flash.ztgt.
diff --git a/boards/z80/ez80/z20x/configs/w25boot/defconfig b/boards/z80/ez80/z20x/configs/hello/defconfig
similarity index 74%
copy from boards/z80/ez80/z20x/configs/w25boot/defconfig
copy to boards/z80/ez80/z20x/configs/hello/defconfig
index 3059947..61ee143 100644
--- a/boards/z80/ez80/z20x/configs/w25boot/defconfig
+++ b/boards/z80/ez80/z20x/configs/hello/defconfig
@@ -14,29 +14,29 @@ CONFIG_ARCH_CHIP_EZ80F92=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_Z80=y
CONFIG_BOARD_LOOPSPERMSEC=1250
+CONFIG_BOOT_RUNFROMEXTSRAM=y
+CONFIG_DISABLE_ENVIRON=y
CONFIG_DISABLE_MQUEUE=y
-CONFIG_EZ80_SPI=y
+CONFIG_DISABLE_PTHREAD=y
+CONFIG_EXAMPLES_HELLO=y
CONFIG_EZ80_UART1=y
-CONFIG_FS_WRITABLE=y
CONFIG_HOST_WINDOWS=y
-CONFIG_MAX_TASKS=8
+CONFIG_MAX_TASKS=16
CONFIG_MAX_WDOGPARMS=2
-CONFIG_MTD=y
-CONFIG_MTD_W25=y
-CONFIG_NFILE_DESCRIPTORS=6
-CONFIG_NFILE_STREAMS=6
+CONFIG_NFILE_DESCRIPTORS=8
+CONFIG_NFILE_STREAMS=8
CONFIG_PREALLOC_TIMERS=4
-CONFIG_PREALLOC_WDOGS=4
+CONFIG_PREALLOC_WDOGS=8
CONFIG_PTHREAD_STACK_DEFAULT=1024
CONFIG_RAM_SIZE=65536
CONFIG_SDCLONE_DISABLE=y
+CONFIG_START_DAY=12
CONFIG_START_MONTH=3
CONFIG_START_YEAR=2020
CONFIG_UART1_BAUD=2400
CONFIG_UART1_BITS=0
-CONFIG_UART1_RXBUFSIZE=4096
+CONFIG_UART1_RXBUFSIZE=64
CONFIG_UART1_SERIAL_CONSOLE=y
CONFIG_UART1_TXBUFSIZE=64
-CONFIG_USER_ENTRYPOINT="w25_main"
+CONFIG_USER_ENTRYPOINT="hello_main"
CONFIG_WDOG_INTRESERVE=1
-CONFIG_Z20X_W25BOOT=y
diff --git a/boards/z80/ez80/z20x/configs/w25boot/w25boot.zdsproj b/boards/z80/ez80/z20x/configs/hello/hello.zdsproj
similarity index 83%
copy from boards/z80/ez80/z20x/configs/w25boot/w25boot.zdsproj
copy to boards/z80/ez80/z20x/configs/hello/hello.zdsproj
index 2ee448c..d0d7c3c 100644
--- a/boards/z80/ez80/z20x/configs/w25boot/w25boot.zdsproj
+++ b/boards/z80/ez80/z20x/configs/hello/hello.zdsproj
@@ -1,9 +1,8 @@
-<project type="Executable" project-type="Standard" configuration="Release" created-by="d:5.3.0:17021001" modified-by="d:5.3.0:19052909" ZDSII="ZDSII - eZ80Acclaim! 5.3.3 (Build 19083001)">
-<cpu>eZ80F92</cpu>
+<project type="Executable" project-type="Standard" configuration="Debug" created-by="d:5.3.0:19052909" modified-by="d:5.3.0:19052909" ZDSII="ZDSII - eZ80Acclaim! 5.3.3 (Build 19083001)">
+<cpu>eZ80F91</cpu>
<!-- file information -->
<files>
-<file filter-key="flash">..\..\..\nuttx.hex</file>
</files>
<!-- configuration information -->
@@ -12,7 +11,7 @@
<tools>
<tool name="Assembler">
<options>
-<option name="define" type="string" change-action="assemble">_EZ80ACCLAIM!=1</option>
+<option name="define" type="string" change-action="assemble">_EZ80ACCLAIM!=1,_SIMULATE=1</option>
<option name="include" type="string" change-action="assemble"></option>
<option name="list" type="boolean" change-action="none">true</option>
<option name="listmac" type="boolean" change-action="none">false</option>
@@ -26,14 +25,14 @@
<tool name="Compiler">
<options>
<option name="padbranch" type="string" change-action="compile">Off</option>
-<option name="define" type="string" change-action="compile">_DEBUG,_EZ80F92,_EZ80ACCLAIM!</option>
-<option name="genprintf" type="boolean" change-action="compile">false</option>
+<option name="define" type="string" change-action="compile">_DEBUG,_EZ80F91,_EZ80ACCLAIM!,_SIMULATE</option>
+<option name="genprintf" type="boolean" change-action="compile">true</option>
<option name="keepasm" type="boolean" change-action="none">false</option>
-<option name="keeplst" type="boolean" change-action="none">true</option>
+<option name="keeplst" type="boolean" change-action="none">false</option>
<option name="list" type="boolean" change-action="none">false</option>
<option name="listinc" type="boolean" change-action="none">false</option>
<option name="modsect" type="boolean" change-action="compile">false</option>
-<option name="optspeed" type="boolean" change-action="compile">true</option>
+<option name="optspeed" type="boolean" change-action="compile">false</option>
<option name="promote" type="boolean" change-action="compile">true</option>
<option name="reduceopt" type="boolean" change-action="compile">false</option>
<option name="stdinc" type="string" change-action="compile"></option>
@@ -44,8 +43,8 @@
</tool>
<tool name="Debugger">
<options>
-<option name="target" type="string" change-action="rebuild">w25boot_ram</option>
-<option name="debugtool" type="string" change-action="none">USBSmartCable</option>
+<option name="target" type="string" change-action="rebuild">eZ80DevPlatform_F91_Flash</option>
+<option name="debugtool" type="string" change-action="none">Simulator</option>
<option name="usepageerase" type="boolean" change-action="none">true</option>
</options>
</tool>
@@ -76,12 +75,12 @@
<option name="debug" type="boolean" change-action="assemble">true</option>
<option name="debugcache" type="boolean" change-action="none">true</option>
<option name="igcase" type="boolean" change-action="assemble">false</option>
-<option name="outputdir" type="string" change-action="compile">Debug\</option>
+<option name="outputdir" type="string" change-action="compile">.\Debug\</option>
</options>
</tool>
<tool name="Librarian">
<options>
-<option name="outfile" type="string" change-action="build">..\..\..\nuttx.lib</option>
+<option name="outfile" type="string" change-action="build">.\Debug\hello.lib</option>
</options>
</tool>
<tool name="Linker">
@@ -93,24 +92,24 @@
<option name="map" type="boolean" change-action="none">true</option>
<option name="maxhexlen" type="integer" change-action="build">64</option>
<option name="objlibmods" type="string" change-action="build"></option>
-<option name="of" type="string" change-action="build">..\..\..\nuttx</option>
+<option name="of" type="string" change-action="build">.\Debug\hello</option>
<option name="quiet" type="boolean" change-action="none">true</option>
<option name="relist" type="boolean" change-action="build">false</option>
<option name="startuptype" type="string" change-action="build">Standard</option>
<option name="startuplnkcmds" type="boolean" change-action="build">true</option>
-<option name="usecrun" type="boolean" change-action="build">false</option>
+<option name="usecrun" type="boolean" change-action="build">true</option>
<option name="warnoverlap" type="boolean" change-action="none">true</option>
<option name="xref" type="boolean" change-action="none">true</option>
<option name="undefisfatal" type="boolean" change-action="none">true</option>
<option name="warnisfatal" type="boolean" change-action="none">false</option>
-<option name="sort" type="string" change-action="none">NAME</option>
+<option name="sort" type="string" change-action="none">name</option>
<option name="padhex" type="boolean" change-action="build">false</option>
<option name="fplib" type="string" change-action="build">Real</option>
<option name="useadddirectives" type="boolean" change-action="build">false</option>
<option name="linkconfig" type="string" change-action="build">Standard</option>
-<option name="flashinfo" type="string" change-action="build">000000-0000FF</option>
-<option name="ram" type="string" change-action="build">040000-0FFFFF</option>
-<option name="rom" type="string" change-action="build">000000-01FFFF</option>
+<option name="flashinfo" type="string" change-action="build">000000-0001FF</option>
+<option name="ram" type="string" change-action="build">B7E000-B7FFFF</option>
+<option name="rom" type="string" change-action="build">000000-03FFFF</option>
<option name="extio" type="string" change-action="build">000000-00FFFF</option>
<option name="intio" type="string" change-action="build">000000-0000FF</option>
</options>
@@ -132,9 +131,9 @@
<tools>
<tool name="Assembler">
<options>
-<option name="define" type="string" change-action="assemble">_EZ80ACCLAIM!=1</option>
+<option name="define" type="string" change-action="assemble">_EZ80ACCLAIM!=1,_SIMULATE=1</option>
<option name="include" type="string" change-action="assemble"></option>
-<option name="list" type="boolean" change-action="none">false</option>
+<option name="list" type="boolean" change-action="none">true</option>
<option name="listmac" type="boolean" change-action="none">false</option>
<option name="name" type="boolean" change-action="none">true</option>
<option name="pagelen" type="integer" change-action="none">0</option>
@@ -146,14 +145,14 @@
<tool name="Compiler">
<options>
<option name="padbranch" type="string" change-action="compile">Off</option>
-<option name="define" type="string" change-action="compile">NDEBUG,_EZ80F92,_EZ80ACCLAIM!</option>
-<option name="genprintf" type="boolean" change-action="compile">false</option>
+<option name="define" type="string" change-action="compile">NDEBUG,_EZ80F91,_EZ80ACCLAIM!,_SIMULATE</option>
+<option name="genprintf" type="boolean" change-action="compile">true</option>
<option name="keepasm" type="boolean" change-action="none">false</option>
<option name="keeplst" type="boolean" change-action="none">false</option>
<option name="list" type="boolean" change-action="none">false</option>
<option name="listinc" type="boolean" change-action="none">false</option>
<option name="modsect" type="boolean" change-action="compile">false</option>
-<option name="optspeed" type="boolean" change-action="compile">true</option>
+<option name="optspeed" type="boolean" change-action="compile">false</option>
<option name="promote" type="boolean" change-action="compile">true</option>
<option name="reduceopt" type="boolean" change-action="compile">false</option>
<option name="stdinc" type="string" change-action="compile"></option>
@@ -164,14 +163,14 @@
</tool>
<tool name="Debugger">
<options>
-<option name="target" type="string" change-action="rebuild">w25boot_flash</option>
-<option name="debugtool" type="string" change-action="none">USBSmartCable</option>
+<option name="target" type="string" change-action="rebuild">eZ80DevPlatform_F91_Flash</option>
+<option name="debugtool" type="string" change-action="none">Simulator</option>
<option name="usepageerase" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="FlashProgrammer">
<options>
-<option name="erasebeforeburn" type="boolean" change-action="none">true</option>
+<option name="erasebeforeburn" type="boolean" change-action="none">false</option>
<option name="eraseinfopage" type="boolean" change-action="none">false</option>
<option name="enableinfopage" type="boolean" change-action="none">false</option>
<option name="includeserial" type="boolean" change-action="none">false</option>
@@ -193,15 +192,15 @@
<tool name="General">
<options>
<option name="warn" type="boolean" change-action="none">true</option>
-<option name="debug" type="boolean" change-action="assemble">true</option>
-<option name="debugcache" type="boolean" change-action="none">true</option>
+<option name="debug" type="boolean" change-action="assemble">false</option>
+<option name="debugcache" type="boolean" change-action="none">false</option>
<option name="igcase" type="boolean" change-action="assemble">false</option>
-<option name="outputdir" type="string" change-action="compile">..\..\..\nuttx\</option>
+<option name="outputdir" type="string" change-action="compile">.\Release\</option>
</options>
</tool>
<tool name="Librarian">
<options>
-<option name="outfile" type="string" change-action="build">..\..\..\nuttx.lib</option>
+<option name="outfile" type="string" change-action="build">.\Release\hello.lib</option>
</options>
</tool>
<tool name="Linker">
@@ -213,7 +212,7 @@
<option name="map" type="boolean" change-action="none">true</option>
<option name="maxhexlen" type="integer" change-action="build">64</option>
<option name="objlibmods" type="string" change-action="build"></option>
-<option name="of" type="string" change-action="build">..\..\..\nuttx</option>
+<option name="of" type="string" change-action="build">.\Release\hello</option>
<option name="quiet" type="boolean" change-action="none">true</option>
<option name="relist" type="boolean" change-action="build">false</option>
<option name="startuptype" type="string" change-action="build">Standard</option>
@@ -223,14 +222,14 @@
<option name="xref" type="boolean" change-action="none">true</option>
<option name="undefisfatal" type="boolean" change-action="none">true</option>
<option name="warnisfatal" type="boolean" change-action="none">false</option>
-<option name="sort" type="string" change-action="none">NAME</option>
+<option name="sort" type="string" change-action="none">name</option>
<option name="padhex" type="boolean" change-action="build">false</option>
<option name="fplib" type="string" change-action="build">Real</option>
<option name="useadddirectives" type="boolean" change-action="build">false</option>
<option name="linkconfig" type="string" change-action="build">Standard</option>
-<option name="flashinfo" type="string" change-action="build">000000-0000FF</option>
-<option name="ram" type="string" change-action="build">040000-0BFFFF</option>
-<option name="rom" type="string" change-action="build">000000-01FFFF</option>
+<option name="flashinfo" type="string" change-action="build">000000-0001FF</option>
+<option name="ram" type="string" change-action="build">B7E000-B7FFFF</option>
+<option name="rom" type="string" change-action="build">000000-03FFFF</option>
<option name="extio" type="string" change-action="build">000000-00FFFF</option>
<option name="intio" type="string" change-action="build">000000-0000FF</option>
</options>
@@ -258,4 +257,4 @@
<breakpoints>
</breakpoints>
-</project>
+</project>
\ No newline at end of file
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj b/boards/z80/ez80/z20x/configs/hello/hello.zfpproj
similarity index 96%
copy from boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj
copy to boards/z80/ez80/z20x/configs/hello/hello.zfpproj
index 1340f95..8049fd9 100644
--- a/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj
+++ b/boards/z80/ez80/z20x/configs/hello/hello.zfpproj
@@ -74,7 +74,7 @@
</tool>
<tool name="Debugger">
<options>
-<option name="target" type="string" change-action="rebuild">nsh_flash</option>
+<option name="target" type="string" change-action="rebuild">hello_flash</option>
<option name="debugtool" type="string" change-action="none">USBSmartCable</option>
<option name="debugtoolnames" type="string" change-action="none">ZPAKII</option>
<option name="SmartEthernetNumbers" type="string" change-action="none">ZPAKII</option>
@@ -136,7 +136,7 @@
<option name="maxhexlen" type="integer" change-action="build">64</option>
<option name="linkconfig" type="integer" change-action="build">1</option>
<option name="objlibmods" type="string" change-action="build"></option>
-<option name="of" type="string" change-action="build">.\nsh</option>
+<option name="of" type="string" change-action="build">.\hello</option>
<option name="quiet" type="boolean" change-action="none">false</option>
<option name="ram" type="string" change-action="build">B7E000-B7FFFF</option>
<option name="relist" type="boolean" change-action="build">false</option>
@@ -225,7 +225,7 @@
</tool>
<tool name="Debugger">
<options>
-<option name="target" type="string" change-action="rebuild">nsh_flash</option>
+<option name="target" type="string" change-action="rebuild">hello_flash</option>
<option name="debugtool" type="string" change-action="none">USBSmartCable</option>
<option name="debugtoolnames" type="string" change-action="none">ZPAKII</option>
<option name="SmartEthernetNumbers" type="string" change-action="none">ZPAKII</option>
@@ -287,7 +287,7 @@
<option name="maxhexlen" type="integer" change-action="build">64</option>
<option name="linkconfig" type="integer" change-action="build">1</option>
<option name="objlibmods" type="string" change-action="build"></option>
-<option name="of" type="string" change-action="build">.\nsh</option>
+<option name="of" type="string" change-action="build">.\hello</option>
<option name="quiet" type="boolean" change-action="none">false</option>
<option name="ram" type="string" change-action="build">B7E000-B7FFFF</option>
<option name="relist" type="boolean" change-action="build">false</option>
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh_flash.ztgt b/boards/z80/ez80/z20x/configs/hello/hello_flash.ztgt
similarity index 100%
copy from boards/z80/ez80/z20x/configs/nsh_ram/nsh_flash.ztgt
copy to boards/z80/ez80/z20x/configs/hello/hello_flash.ztgt
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh_ram.ztgt b/boards/z80/ez80/z20x/configs/hello/hello_ram.ztgt
similarity index 100%
copy from boards/z80/ez80/z20x/configs/nsh_ram/nsh_ram.ztgt
copy to boards/z80/ez80/z20x/configs/hello/hello_ram.ztgt
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/.gitignore b/boards/z80/ez80/z20x/configs/nsh/.gitignore
similarity index 100%
rename from boards/z80/ez80/z20x/configs/nsh_ram/.gitignore
rename to boards/z80/ez80/z20x/configs/nsh/.gitignore
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/README.txt b/boards/z80/ez80/z20x/configs/nsh/README.txt
similarity index 87%
rename from boards/z80/ez80/z20x/configs/nsh_ram/README.txt
rename to boards/z80/ez80/z20x/configs/nsh/README.txt
index db71007..06419dd 100644
--- a/boards/z80/ez80/z20x/configs/nsh_ram/README.txt
+++ b/boards/z80/ez80/z20x/configs/nsh/README.txt
@@ -9,5 +9,5 @@ nsh.zfpproj is a simple project that will allow you to use the Smart Flash
in the upper README.txt file
nsh_ram.ztgt is the target file that accompanies the project files. This
one is identical to boards/scripts/z20x_ram.ztgt.
-nsh_ram.ztgt is the target file that accompanies the project files. This
+nsh_flash.ztgt is the target file that accompanies the project files. This
one is identical to boards/scripts/z20x_flash.ztgt.
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/defconfig b/boards/z80/ez80/z20x/configs/nsh/defconfig
similarity index 100%
rename from boards/z80/ez80/z20x/configs/nsh_ram/defconfig
rename to boards/z80/ez80/z20x/configs/nsh/defconfig
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zdsproj b/boards/z80/ez80/z20x/configs/nsh/nsh.zdsproj
similarity index 100%
rename from boards/z80/ez80/z20x/configs/nsh_ram/nsh.zdsproj
rename to boards/z80/ez80/z20x/configs/nsh/nsh.zdsproj
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj b/boards/z80/ez80/z20x/configs/nsh/nsh.zfpproj
similarity index 100%
rename from boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj
rename to boards/z80/ez80/z20x/configs/nsh/nsh.zfpproj
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh_flash.ztgt b/boards/z80/ez80/z20x/configs/nsh/nsh_flash.ztgt
similarity index 100%
rename from boards/z80/ez80/z20x/configs/nsh_ram/nsh_flash.ztgt
rename to boards/z80/ez80/z20x/configs/nsh/nsh_flash.ztgt
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh_ram.ztgt b/boards/z80/ez80/z20x/configs/nsh/nsh_ram.ztgt
similarity index 100%
rename from boards/z80/ez80/z20x/configs/nsh_ram/nsh_ram.ztgt
rename to boards/z80/ez80/z20x/configs/nsh/nsh_ram.ztgt
diff --git a/boards/z80/ez80/z20x/configs/w25boot/defconfig b/boards/z80/ez80/z20x/configs/w25boot/defconfig
index 3059947..c8fa1c4 100644
--- a/boards/z80/ez80/z20x/configs/w25boot/defconfig
+++ b/boards/z80/ez80/z20x/configs/w25boot/defconfig
@@ -14,7 +14,9 @@ CONFIG_ARCH_CHIP_EZ80F92=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_Z80=y
CONFIG_BOARD_LOOPSPERMSEC=1250
+CONFIG_DISABLE_ENVIRON=y
CONFIG_DISABLE_MQUEUE=y
+CONFIG_DISABLE_PTHREAD=y
CONFIG_EZ80_SPI=y
CONFIG_EZ80_UART1=y
CONFIG_FS_WRITABLE=y
diff --git a/boards/z80/ez80/z20x/configs/w25boot/w25boot.zdsproj b/boards/z80/ez80/z20x/configs/w25boot/w25boot.zdsproj
index 2ee448c..b649632 100644
--- a/boards/z80/ez80/z20x/configs/w25boot/w25boot.zdsproj
+++ b/boards/z80/ez80/z20x/configs/w25boot/w25boot.zdsproj
@@ -177,9 +177,9 @@
<option name="includeserial" type="boolean" change-action="none">false</option>
<option name="offset" type="integer" change-action="none">0</option>
<option name="snenable" type="boolean" change-action="none">false</option>
-<option name="sn" type="string" change-action="none">0</option>
-<option name="snsize" type="integer" change-action="none">0</option>
-<option name="snstep" type="integer" change-action="none">0</option>
+<option name="sn" type="string" change-action="none">000000000000000000000000</option>
+<option name="snsize" type="integer" change-action="none">1</option>
+<option name="snstep" type="integer" change-action="none">000000000000000000000000</option>
<option name="snstepformat" type="integer" change-action="none">0</option>
<option name="snaddress" type="string" change-action="none">0</option>
<option name="snformat" type="integer" change-action="none">0</option>
@@ -258,4 +258,4 @@
<breakpoints>
</breakpoints>
-</project>
+</project>
\ No newline at end of file
diff --git a/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd b/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd
index 630b22c..56651e5 100644
--- a/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd
+++ b/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd
@@ -68,7 +68,7 @@ DEFINE __CS3_CTL_INIT_PARAM = $00
DEFINE __CS3_BMC_INIT_PARAM = $00
DEFINE __RAM_CTL_INIT_PARAM = $80
DEFINE __RAM_ADDR_U_INIT_PARAM = $AF
-DEFINE __FLASH_CTL_INIT_PARAM = $88
+DEFINE __FLASH_CTL_INIT_PARAM = $28
DEFINE __FLASH_ADDR_U_INIT_PARAM = $00
define _SYS_CLK_FREQ = 20000000
diff --git a/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd b/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd
index dcb0519..76b3e47 100644
--- a/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd
+++ b/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd
@@ -65,7 +65,7 @@ DEFINE __CS3_CTL_INIT_PARAM = $00
DEFINE __CS3_BMC_INIT_PARAM = $00
DEFINE __RAM_CTL_INIT_PARAM = $80
DEFINE __RAM_ADDR_U_INIT_PARAM = $AF
-DEFINE __FLASH_CTL_INIT_PARAM = $88
+DEFINE __FLASH_CTL_INIT_PARAM = $28
DEFINE __FLASH_ADDR_U_INIT_PARAM = $00
define _SYS_CLK_FREQ = 20000000
diff --git a/boards/z80/ez80/z20x/scripts/z20x_loader.linkcmd b/boards/z80/ez80/z20x/scripts/z20x_loader.linkcmd
index a1d2232..48f348a 100644
--- a/boards/z80/ez80/z20x/scripts/z20x_loader.linkcmd
+++ b/boards/z80/ez80/z20x/scripts/z20x_loader.linkcmd
@@ -72,7 +72,7 @@ DEFINE __CS3_CTL_INIT_PARAM = $00
DEFINE __CS3_BMC_INIT_PARAM = $00
DEFINE __RAM_CTL_INIT_PARAM = $80
DEFINE __RAM_ADDR_U_INIT_PARAM = $AF
-DEFINE __FLASH_CTL_INIT_PARAM = $88
+DEFINE __FLASH_CTL_INIT_PARAM = $28
DEFINE __FLASH_ADDR_U_INIT_PARAM = $00
define _SYS_CLK_FREQ = 20000000
diff --git a/boards/z80/ez80/z20x/scripts/z20x_program.linkcmd b/boards/z80/ez80/z20x/scripts/z20x_program.linkcmd
index 509cdc5..1c3983e 100644
--- a/boards/z80/ez80/z20x/scripts/z20x_program.linkcmd
+++ b/boards/z80/ez80/z20x/scripts/z20x_program.linkcmd
@@ -75,7 +75,7 @@ DEFINE __CS3_CTL_INIT_PARAM = $00
DEFINE __CS3_BMC_INIT_PARAM = $00
DEFINE __RAM_CTL_INIT_PARAM = $80
DEFINE __RAM_ADDR_U_INIT_PARAM = $AF
-DEFINE __FLASH_CTL_INIT_PARAM = $88
+DEFINE __FLASH_CTL_INIT_PARAM = $28
DEFINE __FLASH_ADDR_U_INIT_PARAM = $00
define _SYS_CLK_FREQ = 20000000
diff --git a/boards/z80/ez80/z20x/src/w25_main.c b/boards/z80/ez80/z20x/src/w25_main.c
index 7a77678..46cfc8c 100644
--- a/boards/z80/ez80/z20x/src/w25_main.c
+++ b/boards/z80/ez80/z20x/src/w25_main.c
@@ -143,7 +143,9 @@ static int w25_read_hex(FAR uint24_t *len)
return ret;
}
- printf("Successfully loaded the Intel HEX file into memory...\n");
+ printf("Intel HEX file into memory loaded into RAM...\n");
+ fflush(stdout);
+
*len = memoutstream.public.nput;
return OK;
}
@@ -220,6 +222,7 @@ static int w25_write_binary(FAR const struct prog_header_s *hdr)
printf("Writing %lu bytes to the W25 Serial FLASH\n",
(unsigned long)hdr->len);
+ fflush(stdout);
ret = w25_write(fd, (FAR const void *)PROGSTART, hdr->len);
if (ret < 0)
@@ -323,6 +326,10 @@ static int w25_read_binary(FAR struct prog_header_s *hdr)
* CRC after loaded to memory.
*/
+ printf("Reading %lu bytes from the W25 Serial FLASH\n",
+ (unsigned long)hdr->len);
+ fflush(stdout);
+
ret = w25_read(fd, (FAR void *)PROGSTART, hdr->len);
if (ret < 0)
{
@@ -343,11 +350,12 @@ errout:
*
****************************************************************************/
-static uint24_t w25_crc24(uint32_t len)
+static uint24_t w25_crc24(uint24_t len)
{
+#if 0 /* Very slow */
FAR const uint8_t *src = (FAR const uint8_t *)PROGSTART;
uint32_t crc = 0;
- int i;
+ uint24_t i;
int j;
/* Loop for each byte in the binary image */
@@ -370,6 +378,52 @@ static uint24_t w25_crc24(uint32_t len)
}
return (uint24_t)crc;
+#else
+ FAR const uint24_t *src = (FAR const uint24_t *)PROGSTART;
+ uint24_t chksum = 0;
+ uint24_t remaining;
+
+ /* Loop for each uint24_t in the binary image */
+
+ for (remaining = len;
+ remaining >= sizeof(uint24_t);
+ remaining -= sizeof(uint24_t))
+ {
+ uint24_t val = *src++;
+
+ /* Simple checksum */
+
+ chksum += val;
+ }
+
+ /* Handle trailing partial uint24_t's (assumes little endian) */
+
+ if (remaining > 0)
+ {
+ uint24_t val = *src;
+
+ switch (remaining)
+ {
+ case 1:
+ val &= 0x0000ff;
+ break;
+
+ case 2:
+ val &= 0x00ffff;
+ break;
+
+ default: /* Shouldn't happen */
+ val = 0;
+ break;
+ }
+
+ /* Simple checksum */
+
+ chksum += val;
+ }
+
+ return chksum;
+#endif
}
/****************************************************************************
@@ -396,16 +450,15 @@ static int w25_read_verify(void)
return ret;
}
- printf("Verifying %lu bytes in the W25 Serial FLASH\n",
- (unsigned long)hdr.len);
+ printf("Verifying %lu bytes in RAM\n", (unsigned long)hdr.len);
+ fflush(stdout);
/* Compare CRCs */
crc = w25_crc24(hdr.len);
if (crc == hdr.crc)
{
- printf("Successfully verified %lu bytes in the W25 Serial FLASH\n",
- (unsigned long)hdr.len);
+ printf("Successfully verified %lu bytes\n", (unsigned long)hdr.len);
}
else
{