Home |  Uploading |  Communicating |  Assembling |  Notes | 


Uploading, Communicating and Re-Assembling + Special Notes
Documentation for Prior Versions
00.0160 (2009) to 00.0250 (2012)

SourceForge.net Logo
 

Uploading Armpit Scheme to the MCU


For microcontrollers of the LPC2000, LPC1700 and LPC1300 families, the Intel Hex image files from the Armpit Scheme download site can be uploaded to the MCU's FLASH memory via ISP (rs232 interface) using lpc21isp (1) or lpc21isp (2) (Linux or Windows -- as of June 7, 2007 those links appear inactive, try Yahoo lpc21isp, Augsburg lpc21isp, mikrocontroller lpc21isp or cmucam lpc21isp, alternatively lpcflash4linux or lpc2k_pgm), or the NXP (Philips) LPC2000 Flash ISP Utility (Windows).

For microcontrollers of the LPC2800 family, the Binary image file from the Armpit Scheme download site can be uploaded to the MCU's FLASH memory using NXP's MASS DFU program (Windows).

For microcontrollers of the AT91SAM7 family, the Binary image file from the Armpit Scheme download site can be uploaded to the MCU's FLASH memory via ISP using AT91-ISP and SAM-BA (USB interface, Windows), Sam_I_Am (USB interface, Linux), SAM7_PGM (rs232 interface, Linux) or sam7utils (USB interface, multiple OSs).

For microcontrollers of the EP9300, LM3S1000, STM32, STR7 and STR9 families, the Binary image file from the Armpit Scheme download site can be uploaded to the MCU's FLASH memory using OpenOCD (Linux/Unix, Windows), and a JTAG wiggler.

For the Samsung S3C2410 on the TinCan Tools Hammer, the Binary image file from the Armpit Scheme download site can be uploaded to the MCU's FLASH memory using TinCanTool's Flyswatter board and OpenOCD.

For the TI OMAP3530 on the BeagleBoard and Overo Tide, with ARMPit Scheme 00.0250, the Binary image file from the Armpit Scheme download site is a signed image (.ift extension, signed for loading into core RAM at 0x40200000) designed for booting from SD card (Live-SD). Copy the signed image file to a FAT16-formatted (2 GB max) SD card whose 1st partition has been set to active (see Beagle Board web site for instructions if needed) and rename the file MLO. Insert the card in the device and power-up (press the user button on BeagleBoard to boot from SD). This version of ARMPit Scheme does not touch the on-board FLASH (if any).

For the TI OMAP3530 on the BeagleBoard, with ARMPit Scheme 00.0241, the Binary image file from the Armpit Scheme download site can be uploaded to the MCU's 64KB of internal RAM using the U-Boot command: loadb 40200000 (then use kermit to send the .bin file) after which the program is started with the U-Boot command: go 40200000. The program then runs from on-chip RAM while Pop RAM is used for the heap (96MB) and to shadow the NAND Flash (32MB shadowing the top 32MB of NAND, used to store scheme user files). It takes about 5 seconds to get to the Armpit prompt due to the copying of the scheme user file area from NAND Flash to shadow RAM. U-Boot can also be used to Flash the Armpit Scheme core to NAND and auto-start it on MCU reset (be careful not to erase X-Loader and U-Boot or the ability to re-flash the Armpit core, or Linux, or some other system, onto the board, will then depend on the availability of an appropriately formatted external SD/MMC boot medium).


 

Communicating with Armpit Scheme


Once Armpit Scheme is loaded onto the MCU you can communicate with its REP (Read-Eval-Print loop) using a terminal emulation program such as Minicom (Solaris, Linux, Mac OSX: fink install minicom) or HyperTerminal (Windows). Communication parameters for on-board rs232 serial interfaces (including USB-to-rs232) are 9600,8N1 except for the BeabgleBoard that runs at its default of 115200 Bauds (as used also by U-Boot). For boards with USB (LPC-H2148, SAM7-H256, STR-H711 ...) the USB communication parameters are 115200,8N1 and the interface (USB CDC ACM) uses either the built-in driver in Linux and MacOSX, the usbsacm driver in Solaris 10 (built-in since 07/07) or the built-in usbser.sys driver in Windows (Search for it and copy it out of the .cab archive). In *NIX, look at /dev to find the new port that Minicom should use to connect with Armpit Scheme (eg. /dev/term/0 on Solaris, /dev/tty.usbmodem4B11 on Mac OSX, /dev/ttyUSB0 on Linux). On MS Windows, the OS applies a user-supplied file to attach device and driver -- you can use usbser.inf from the lpcusb project or adapt gserial.inf (cut it out from middle of page) by changing the Vendor ID in [GSerialDeviceList] to "USB\VID_FFFF&PID_0005", then, use Device Manager to find which COM port HyperTerminal should use to connect to the Armpit Scheme device.

Starting with version 00.0156, Armpit Scheme no longer sends linefeeds after carriage returns. The communication software (minicom, HyperTerminal) needs to be configured to add these line feeds for proper display.


 

Re-Assembling Armpit Scheme


The source code of Armpit Scheme (eg. armpit_00.0098.s) can be modified and re-assembled (if desired). Armpit Scheme is written in ARM assembly language (ARM7TDMI) and assembled with the GNU assembler (version 2.17). Development is performed on SUN Sparc under Solaris 10 (SunOS blade 5.11 snv_27 sun4u sparc SUNW) with the assembler from the GNU ARM Toolchain made available by CodeSourcery. You may use any appropriate develoment environment (Linux, MacOSX, Windows) to modify, reassemble and upload the code. The first few lines of source code are used to specify the target board. In version 00.0017 you can just uncomment the line corresponding to your target (here: Tiny2106) and reassemble for that board:


     TINY_2106	= 1
     @TINY_2131 = 1
     @TINY_2138	= 1
     @H_2148	= 1
     @H_2214	= 1

In versions 00.0036 to 00.0098 you should uncomment the line corresponding to your MCU type as well as that corresponding to your board and specify whether the board as native USB (LPC-H2148, SAM7-H256, STR-H711). For example, for the LPC_H2148:

  @ 1- Select MCU Family:
     LPC_2000	= 1	@ uncommment if assembling for NXP   LPC2000  family MCU
     @AT91_SAM7	= 1	@ uncommment if assembling for ATMEL AT91SAM7 family MCU
     @STR_7xx 	= 1	@ uncommment if assembling for ST    STR7xx   family MCU
  @ 2 - Select Board:
     @TINY_2106	= 1	@ uncomment if assembling for NewMicros Tiny-2106 board (lpc2000)
     @TINY_2131	= 1	@ uncomment if assembling for NewMicros Tiny-2131 board (lpc2000)
     @TINY_2138	= 1	@ uncomment if assembling for NewMicros Tiny-2138 board (lpc2000)
     @SFE_Logomatic= 1	@ uncomment if assembling for SparkFun  Logomatic board (lpc2000)
     @LPC_H2103	= 1	@ uncomment if assembling for Olimex    LPC-H2103 board (lpc2000)
     LPC_H2148	= 1	@ uncomment if assembling for Olimex    LPC-H2148 board (lpc2000)
     @LPC_H2214	= 1	@ uncomment if assembling for Olimex    LPC-H2214 board (lpc2000)
     @SAM7_H256	= 1	@ uncomment if assembling for Olimex    SAM7-H256 board (at91sam7s)
     @STR_H711	= 1	@ uncomment if assembling for Olimex	STR-H711  board (str7xx)
  @ 3- Specify if board has USB:
     has_usb	= 1	@ uncomment if board has USB (comment out if board doesn't have USB)

The modified source code can then be re-assembled, linked (to start at 0x00000000) and converted to Intel Hexadecimal and binary formats using a sequence of commands such as (on the development machine):

     arm-none-eabi-as -mcpu=arm7tdmi -o a.o    armpit_00.0098.s
     arm-none-eabi-ld -Map map.txt --script build_link_98 -o a.elf a.o
     arm-none-eabi-objcopy -O ihex   a.elf armpit_00.0098.hex
     arm-none-eabi-objcopy -O binary a.elf armpit_00.0098.bin
where build_link_98 is the script file:

     SECTIONS
     {
       .text 0x0000 : 
         { *(.text) ; _endflash = . ; }
       .data   ram_address :
        AT ( ADDR (.text) + SIZEOF (.text) )
         { _startram = . ; *(.data) ; _endram = . ;  }
     }


 

Special Notes


Note 1: The Tiny2131, LPC-H2103 and LPC-P1343 implementation of Armpit Scheme is a reduced version because of the small memory of the LPC2131, LPC2103 and LPC1343 MCUs.

Note 2: Using the USB plug (USB<->rs232) on the LPC-H2214 board requires that you first install the required driver for the on-board FTDI converter chip, onto the upload host.

Note 3: To compile lpc21isp (if needed) on Solaris 10, you may need to modify the C source code in lpc21isp.c, to replace the line:


     cfmakeraw(&IspEnvironment->newtio);

with the 5 lines:

     IspEnvironment->newtio.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
     IspEnvironment->newtio.c_oflag &= ~OPOST;
     IspEnvironment->newtio.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
     IspEnvironment->newtio.c_cflag &= ~(CSIZE|PARENB);
     IspEnvironment->newtio.c_cflag |= CS8;

Note 4: Program upload onto the LPC-H2148 Flash has to be performed via the MCU's rs232 interface (or JTAG if available) as its USB device is not attached to the ISP bootloader.

Note 5: To use lpc21isp with the LPC2478, the following line may need to be added to the LPCtypes[] (this depends on your version of lpc21isp):


     { 0x1701FF35, 2478, 512, 64, 27, 4096, SectorTable_213x }

It may also be necessary to comment out the following 2 lines in main() (right after OpenSerialPort) to avoid losing the immediate 'OK' response from the MCU:

    //   ResetTarget(&IspEnvironment, PROGRAM_MODE);
    //    ClearSerialPortBuffers(&IspEnvironment);



Last updated June 17, 2011

bioe-hubert-at-sourceforge.net