|
||||||||||||||||||||||||
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) - FPGA 2.61 - HW 2.60 (As reported from system. However "DS203V2.7B" is printed on the circuit board) or get a zip with the complete tree here: Just download the Windows TAR archive and unpack it somewhere, no installation is required.
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 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")
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 Assuming the pathing is set correctly within winXP, create a test program: main.c #include <stdio.h> int factorial(int n)
{ int main () { 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 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':
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): 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 So, the gnu toolchain compiler is working.
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 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 The above creates a new app1.hex and app2.hex.
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 Edit "Calibrat.c" line 38: changed: s8 Offset; Compile again: >> c-make Then we get these errors: arm-none-eabi-gcc -Wall -Os -I. -Iinc -Werror -mcpu=cortex-m3 -mthumb -fno-common 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
The basic order for working on the scope's gui is: Modify the code,
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 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.
|
||||||||||||||||||||||||