2419 Feather Mae Ct, Forest Hill, MD 21050 | Phone: 410-340-9019
|Products | Order | Home||
Features & Specs |
Articles & Reviews |
eMail List | News | Online Assembly Guide | Photo Gallery
OH2UG Multi-Platform Flash Loader
A new, improved and interactive bootloader for the SDR
Cube that works with companion program on Windows, Linux, and Mac
The SDR Cube's display
above shows "railroad tracks" to indicate that the Cube
has been placed into Bootload Mode (power-on while pressing the Menu pushbutton).
When the PC Client Program connects with the Cube over the AUX serial port to start flashing
new software, the railroad track begin to move, thus indicating that flashing is in progress.
When complete, the Cube resets and the newly-flashed software starts running.
The OH2UG Multi-Platform Flash Loader is a new-and-improved way to update the SDR Cube Transceiver with the latest software.
Developed by Tauno Voipo OH2UG, and offered as GPL Open Source, three big new sets of capabilities are available for the SDR Cube Transceiver ...
It programs, compares, checks, prints and erases the SDR Cube flash memory;
The Embedded Flash Agent has a progress indicator ("railroad moving tracks") on the Cube display to indicate that a bootload is in progress; and
The PC Client Program works on Windows, Mac and Linux platforms!
The OH2UG Multi-Platform Flash Loader is also backward compatible with the previous flash agent used in the SDR Cube. This means that the existing FlashCube.bat program (which uses the 16-bitFlashProgrammer.exe) will still work, in case people are not yet ready to try the new PC Client Program.
Embedded part and the PC client exe is included with the Cube package ... please refer to the Software page for the latest versions
The OH2UG Multi-Platform Flash Loader is now the standard issue for all new SDR Cube sales and software updates done here at the shop.
Many thanks to Tauno! The new flasher is a nice improvement over what we have now. And thanks also Juha OH2NLT for working to integrate the new Flash Loader so well in the SDR Cube.
The OH2UG Multi-Platform Flash Loader consists of two parts:
(1) The Embedded Flash Agent -- The bootloader code on the Cube that is controlled over the "AUX" RS-232 serial port; and
(2) The PC Client Program -- The program that runs on the PC that the user interacts with to issue commands, and talks to the Cube over the PC's serial port.
The Embedded Flash Agent
The SDR Cube's display now shows "railroad tracks" to indicate that the Cube has been placed into Bootload Mode (power-on while pressing the Menu pushbutton).
When the PC Client Program connects with the Cube over the AUX serial port to start flashing new software, the railroad track begin to move, thus indicating that flashing is in progress.
When complete, the Cube resets and the newly-flashed software starts running.
The new OH2UG Embedded Flash Agent is included in the Cube's v3.01 hex file provided on the Software page. (The previous bootloader agent is also provided integrated with v3.01, in case someone wishes to stay with the original way of bootloading.)
The PC Client Program
This is the PC Client Program that communicates with the SDR Cube over the serial port cable connected between the PC and the Cube's RS-232 "AUX" port on the rear panel.
The OH2UG PC Client Program interacts with the OH2UG Embedded Bootloader program to:
(1) Programs (flashes) new software versions into the Cube, thus enabling the user to easily load the latest versions of SDR Cube software.
(2) Compare the Cube's embedded contents against a hex file;
(3) Checks for empty flash are;
(4) Print the contents of flash area or a hex file;
(5) Erase a flash area; and
(6) Copy a flash area to a hex file.
And equally important, the OH2UG PC Client Program is able to be run on Windows, Mac and Linux platforms!
The program is a dsPIC flash loader, compatible with Microchip AN1094 remote agent.
The current version runs on 32 bit versions of Microsoft Windows and POSIX -compatible operating systems. It is tested under following operating systems:
Linux, Intel, kernels 2.6.24 to 3.2.0
Linux, PowerPC, kernel 3.2.0
Mac OS X, Intel, version 10.8.3
Mac OS X, PowerPC, version 10.5.8
Windows XP, SP3
The commands are a compatible superset of those of the AN1094 loader.
Start it from the command line. The general format is: dspicp [options and command] [hex_file_path] [options]
The program returns EXIT_SUCCESS (0) on a successful run, EXIT_FAILURE (1) else.
On POSIX operating systems, you need to provide the directory path to the executable, if it is not in a directory in the shell's PATH: ./dspicp ...
The commands are:
-i Programs hex file
-c Checks flash contents against a hex file
-h Shows a help message
-k Checks for empty flash area
-p Prints the contents of flash or a hex file
-r Erases a flash area
-x Copies flash contents to a hex file
The -c command needs a path to the hexadecimal file to verify and an interface file path (see later -i).
The -h command does not need any arguments. It prints a short help message to stdout.
The -k command checks whether the user area of the flash is erased. There may be an address range to limit the area to be checked. The area is always full erase pages long and on erase page boundary (1024 instruction addresses). Without a range specification, the check will be performed from instruction address 0xc00 up to the end of the flash.
The -p command can have a path to a hexadecimal file. If there is a path to a hex file,the command prints the contents of the file, else the command prints the contents of the target flash. To access the target, the command needs a path to a serial interface device file. There may be an address range specification to limit the printout area. The contents are printed in 24 bit hexadecimal words and single characters, least significant byte first. The command output is printed to stdout, to separate it from information and error messages, which are printed to stderr. If the operating system supports it, the command output can be piped to a file.
The -r command erases the user area of the flash. There may be an address range to limit the area to be erased. The area is always full erase pages long and on erase page boundary (1024 instruction addresses). Without a range specification, the erasure will be performed from instruction address 0xc00 up to the end of the flash.
The -x command copies the contents of the target flash to a hexadecimal file. The command needs an interface path specification and a path to the output file. There may be an address range specification to limit the area copied.
If there is none of the above commands, there must be a path to a hex file which will be programmed into target device. The programming function also verifies each page after programming.
There can be only one command. If there are multiple commands, the last one will apply.
The options are:
-a allow access to flash agent and configuration word areas
-b set serial interface bit rate
-i set serial interface device path
-n prevent target reset after command
-q quiet operation, only error messages
-v verbose operation, more messages
The -a option allows access to flash programming agent area (0x400 - 0xbff) and the configuration word area. The areas are not normally accessible. The programming agent area is not programmable even with the -a option, as it would destroy the code doing the programming.
The -b option needs an unsigned number to set the bit rate on the serial interface tothe target. The allowable bit rates are limited by the serial I/O hardware and device driver. If no bit rate is set, the default bit rate is 115200 bits/s.
The -i option needs a path to the device file of the serial line interface, typically '/dev/ttyUSB0', which is the default (first USB adapter on Linux systems). The device file name depends on the host operating system.
The -n option prevents the target reset normally done after a command.
The -q option suppresses printing of all informational messages except error messages.
The -v option adds printing more informational messages to stderr.
For the -k, -p, -r and -x commands, the addresses processed can be limited with either a start address only or a range with start and end addresses. For the start address, there is one number only. For an address range, there is a number for the first address, dash, and a number for the last address, without any spaces around the dash. If there is a start address only, the range length will be one erase page, 512 instructions, 1024 program addresses.
The numbers in the address specifications can be decimal, octal or hexadecimal. A number with leading '0x' or '0X' is hexadecimal. A number with a leading zero without the 'x' is octal, and other numbers are decimal. This is similar to the C language conventions.
The addresses are counted in dsPIC program counter units, to match those in the hardware documentation.
Command line examples
Program mycode.hex on Windows, reset target when done: dspicp -i com11 mycode.hex
Compare target contents with mycode.hex, on OS X, do not reset target: dspicp -c -n -i /dev/tty.usbserial0 mycode.hex
Print whole target contents on Linux, store result in mytarget.txt: dspicp -p -i /dev/ttyUSB0 >mytarget.txt
Copy memory contents from 0xc00 to 0xfff to file extract.hex (Windows): dspicp -x -i com11 0xc00-0xfff extract.hex
Target chip types
The program handles dsPIC33FJ128MC706, dsPIC33FJ256GP710 and dsPIC33FJ256GP710A chip types. More chips can be added by filling into the tables in module chipinfo.c
The command line handling cannot process pathological file names looking like address ranges or commands/options. In POSIX systems, the work-around is to prepend the file name with './'. The system shell may need special handling for file names containing special characters, such as spaces. It is recommended to avoid such file names.
Creators of Microchip AN1094.
Copyright (C) 2013 by Tauno Voipio
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see
Ritokalliontie 8-16 O
Copyright 2011-2013 Midnight Design
Solutions, LLC. All Rights Reserved.
Page last updated: August 2013