home
faq
how to
sitemap
contact
 
Some notes on how to modify the gui for the DS203 oscilloscope
 

March 2, 2015

 
   

Here we describe a few initial steps that can be taken to modify ds203's gui. A great starting point is to use Wildcat's revision 4.0. Which can be found here.

The source code used here in this example is posted by Wildcat as the attachment revision 4.0.

As he states in his readme file:

   Wildcat Community Edition revision(W4.0)

   Based on DSO203 GCC v1.7 APP (Revisions and notes for previous versions below)

   Developed and tested with:

          - SYS 1.51

          - ALTERBIOS 0.4 (Needed for SYS versions prior to V1.60)
                               This is necessary to save 64K color BMP's in version W3.2 and above to
                               properly display spectrograms and map mode screenshots, fixes file corruption problem.

          - FPGA 2.61

          - HW 2.60 (As reported from system. However "DS203V2.7B" is printed on the circuit board)
                               (all as supplied with device from SEEED)
...
   Access source in github:
          https://github.com/pmos69/dso203_gcc

   or get a zip with the complete tree here:
          https://github.com/pmos69/dso203_gcc/zipball/master
...
   Uses CodeSourcery Arm toolchain:
          https://sourcery.mentor.com/sgpp/lite/arm/portal/release1802

   Just download the Windows TAR archive and unpack it somewhere, no installation is required.
   Watch out for symlinks in the TAR you'll have to re-create them or copy/rename files to "fill the gaps"

  purple seperator  

 

Therefore, this version of the gui requires the following:

              hardware version 2.6

              FPGA version 2.61      (FPGA261, which can be found here: DSO Quad:Upgrading Firmware)         

              SYS version 1.51      (SYS_B261, which can also be found here: DSO Quad:Upgrading Firmware)   

              ALTERBIOS 0.4      (we haven't tried installing this)

              Wildcat's revision 4.0      (app1.hex, which is located with the source code, found here)

Each of the above hex files (aside from app1.hex) can be found at the
DSO Quad "upgrading firmware" page.

Instructions on how to install them are also found there. The directions for each hex file's installation within winXP is the same:

              turn off the dso

              power it up while holding down the first button, button ">||"

              the dso will appear as an external usb device... drive F:, for example.

              copy the hex files to this device

              (if the transfer goes well, then the file will change its extension fom "hex" to "rdy")

  purple seperator  

 

Next, install the (ARM) gnu toolchain platform:

              sourcery G++ Lite for ARM EABI (release 1802)

First, we must register here: sourcery.mentor.com

After completing the registration, the email received will contain a link to the gnu toolchain platform, which is here:

              https://sourcery.mentor.com/GNUToolchain/release1802

For winXP try this self-extracting file:

              arm-2011.03-42-arm-none-eabi_win_installer.exe

              the default install directory is: C:\Program Files\CodeSourcery\Sourcery G++ Lite

              chose: modify PATH for current user.

settings chosen for installation:

              Product Name:     Sourcery G++ Lite for ARM EABI
              Install Folder:     C:\Program Files\CodeSourcery\Sourcery G++ Lite
              Shortcut Folder:     C:\Documents and Settings\user-name\Start Menu\
                                          Programs\CodeSourcery\Sourcery G++ Lite for ARM EABI
              Disk Space Information (for Installation Target):     
              Required: 131,296,177 bytes     
              Available: 4,048,846,848 bytes

Assuming the pathing is set correctly within winXP, create a test program: main.c

              #include <stdio.h>

              int factorial(int n) {
                    if (n == 0) return 1;
                    return n * factorial (n - 1);
              }

              int main () {
                    int i; int n;
                    for (i = 0; i < 10; ++i) {
                          n = factorial (i);
                          printf ("factorial(%d) = %d\n", i, n);
                    }
                    return 0;
              }

Test the compiler with the command:

              >> arm-none-eabi-gcc -o factorial main.c

Initially we get these errors:

c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol _star t; defaulting to 00008018
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x18): undefined reference to `_sbrk' c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libc.a(lib_a-writer.o): In function `_write_r':

writer.c:(.text+0x20): undefined reference to `_write' c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libc.a(lib_a-closer.o): In function `_close_r':

closer.c:(.text+0x18): undefined reference to `_close' c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libc.a(lib_a-fstatr.o): In function `_fstat_r':

fstatr.c:(.text+0x1c): undefined reference to `_fstat' c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libc.a(lib_a-isattyr.o): In function `_isatty_r ':

isattyr.c:(.text+0x18): undefined reference to `_isatty' c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libc.a(lib_a-lseekr.o): In function `_lseek_r':

lseekr.c:(.text+0x20): undefined reference to `_lseek' c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text+0x20): undefined reference to `_read'
collect2: ld returned 1 exit status

 

Add a generic script file: "generic.ld" to the directory with "main.c".

"generic.ld" is found at:

              C:\Program Files\CodeSourcery\Sourcery G++ Lite\arm-none-eabi\lib

This time compile it with:

              >> arm-none-eabi-gcc -o factorial main.c -T generic.ld

The result has no errors, but we get warnings:

c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libcs3unhosted.a(unhosted-_close.o):
warning: I O function '_close' used
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libcs3unhosted.a(unhosted-_fstat.o):
warning: I O function '_fstat' used
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libcs3unhosted.a(unhosted-isatty.o):
warning: I O function '_isatty' used
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libcs3unhosted.a(unhosted-_lseek.o):
warning: I O function '_lseek' used
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libcs3unhosted.a(unhosted-_read.o):
warning: IO function '_read' used
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.5 .2/../../../../arm-none-eabi/lib\libcs3unhosted.a(unhosted-_write.o):
warning: I O function '_write' used

This time we get an executable: "factorial"

Try running it with the simulator:

             >> arm-none-eabi-run factorial

... this does nothing, no output.

 

Add a generic script file: "generic-hosted.ld" to the directory with "main.c".

"generic-hosted.ld" is found at:

              C:\Program Files\CodeSourcery\Sourcery G++ Lite\arm-none-eabi\lib

compile it with:

              >> arm-none-eabi-gcc -o factorial main.c -T generic-hosted.ld

This time we get: no errors, and no warnings.

Run the executable with the simulator:

             >> arm-none-eabi-run factorial

and we finally get an output:

factorial(0) = 1
factorial(1) = 1
factorial(2) = 2
factorial(3) = 6
factorial(4) = 24
factorial(5) = 120
factorial(6) = 720
factorial(7) = 5040
factorial(8) = 40320
factorial(9) = 362880

So, the gnu toolchain compiler is working.

  purple seperator  

 

From here we can move on to modifying the source code provided by Wildcat's revision 4.0.

Download the compressed files from the link above. Unzip the source code files into a directory, and make a separate copy of the files for editing and testing.

In a dos box, go to the directory with the source files to be edited and delete the hex files:

              >> del app1.hex
              >> del app1.hex

Compile the code by running the makefile:

              >> c-make

From this we get:

arm-none-eabi-gcc -o app1.elf Calibrat.o Draw.o Files.o Function.o Interrupt.o Main.o Menu.o Process.o BIOS.o startup.o stm32f10x_nvic.o cortexm3_macro.o -mcpu= cortex-m3 -lc -mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float -nostartfiles
-T app1.lds
arm-none-eabi-objcopy -O ihex app1.elf app1.hex
arm-none-eabi-gcc -o app2.elf Calibrat.o Draw.o Files.o Function.o Interrupt.o Main.o Menu.o Process.o BIOS.o startup.o stm32f10x_nvic.o cortexm3_macro.o -mcpu= cortex-m3 -lc -mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float -nostartfiles
-T app2.lds
arm-none-eabi-objcopy -O ihex app2.elf app2.hex rm app1.elf app2.elf

The above creates a new app1.hex and app2.hex.

  purple seperator  

 

Try another test.

Delete all of the object files (*.o):     >> del *.o

Compile again:    >> c-make

and, we get an error:

cc1.exe: warnings being treated as errors
Calibrat.c: In function 'Calibrat':
Calibrat.c:38:7: error: 'Offset' may be used uninitialized in this function cs-make: *** [Calibrat.o] Error 1

Edit "Calibrat.c" line 38:

changed:        s8 Offset;
to:              
s8 Offset=0;

Compile again:    >> c-make

Then we get these errors:

arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common
-fzero-initialized-in-bss -msoft-float -MD -I FWLib/inc -c -o Calibrat.o Cali brat.c arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common
-fzero-initialized-in-bss -msoft-float -MD -I FWLib/inc -c -o Draw.o Draw.c arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common
-fzero-initialized-in-bss -msoft-float -MD -I FWLib/inc -c -o Files.o Files.c arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common
-fzero-initialized-in-bss -msoft-float -MD -I FWLib/inc -c -o Function.o Func tion.c arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common
-fzero-initialized-in-bss -msoft-float -MD -I FWLib/inc -c -o Interrupt.o Int errupt.c arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common
-fzero-initialized-in-bss -msoft-float -MD -I FWLib/inc -c -o Main.o Main.c arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common
-fzero-initialized-in-bss -msoft-float -MD -I FWLib/inc -c -o Menu.o Menu.c arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common
-fzero-initialized-in-bss -msoft-float -MD -I FWLib/inc -c -o Process.o Proce ss.c arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -c -o BIOS.o BIOS.S arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common
-fzero-initialized-in-bss -msoft-float -MD -I FWLib/inc -c -o startup.o start up.c
arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common
-fzero-initialized-in-bss -msoft-float -MD -I FWLib/inc -c -o stm32f10x_nvic. o stm32f10x_nvic.c
arm-none-eabi-as -o cortexm3_macro.o cortexm3_macro.s cortexm3_macro.s: Assembler messages:
cortexm3_macro.s:131: Error: selected processor does not support requested speci al purpose register -- `mrs r0,CONTROL'
cortexm3_macro.s:142: Error: selected processor does not support requested speci al purpose register -- `msr CONTROL,r0'
cortexm3_macro.s:154: Error: selected processor does not support requested speci al purpose register -- `mrs r0,PSP'
cortexm3_macro.s:165: Error: selected processor does not support requested speci al purpose register -- `msr PSP,r0'
cortexm3_macro.s:176: Error: selected processor does not support requested speci al purpose register -- `mrs r0,MSP'
cortexm3_macro.s:187: Error: selected processor does not support requested speci al purpose register -- `msr MSP,r0'
cortexm3_macro.s:220: Error: selected processor does not support requested speci al purpose register -- `mrs r0,PRIMASK'
cortexm3_macro.s:253: Error: selected processor does not support requested speci al purpose register -- `mrs r0,FAULTMASK'
cortexm3_macro.s:264: Error: selected processor does not support requested speci al purpose register -- `msr BASEPRI,r0'
cortexm3_macro.s:275: Error: selected processor does not support requested speci al purpose register -- `mrs r0,BASEPRI_MAX'
cs-make: *** [cortexm3_macro.o] Error 1

Copy cortexm3_macro.o back from the original files, to skip the recompiling of cortexm3_macro.c...

Compile again:    >> c-make

This time we get no errors and no warnings, and we finally get a new set of hex files:

        app1.hex
        app2.hex

  purple seperator  

 

The basic order for working on the scope's gui is:

        Modify the code,
        compile it with: "c-make",
        which creates a new "app1.hex",
        then upload "app1.hex" to the dso. (press button 1, while turning it on).

  purple seperator  

 

As an initial test, try a simple modification of the colors:

(the 16-bit color definitions seem to be reversed from Adafruit's 16-bit color chart)

In "Draw.h" add the lines:

              #define INDIGO1 0xF814
              #define INDIGO2 0xF80A

In "Draw.c" add the lines:

to set the color for the FFT wave:

              draw.c  line: 1391:        LCD_Buffer[buffer][i-1] = INDIGO2;

to set the color for the CH_A wave:

              draw.c  line: 678:         Color[TR_1]=GRN;

to set the color for the CH_B wave:

              draw.c  line: 680:         Color[TR_2]=BLUE;

...compile: >> c-make  and then upload the new  app1.hex   to the oscilloscope.

 

dark maelstrom icon dark maelstrom
flash games
  t-shirt icon dark maelstrom
t-shirt designs

back

home