[En-Nut-Discussion] Success on OLIMEX SAM7-EX256 board

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Sat Sep 9 16:06:12 CEST 2006


Hallo,

just to let everybody know.

I have my OLIMEX SAM7-EX256 board now displaying the expected output for the
events-demo. Very nice:-)

The last pitfall  I hit:
- Serial output is on DBGU. I had jumpered on UART0, as the OLIMEX demo
displays on that channel. Some hint on about the output channel on
http://www.ethernut.de/en/documents/at91sam7x256.html
could help others.

Other tools used and some hints:
- Suse10.1: 
  All tools mentioned on 
  http://www.ethernut.de/en/documents/install-suse.html
  come in usefull versions on the installation media. Be sure
  to install the appropriate xxx-devel packages too
- Arm-gcc:
  I installed Andreas Schwarz ARM GCC Toolchain from
  http://www.mikrocontroller.net/en/arm-gcc
- OpenOCD
  Use "at91sam7 gpnvm 0 2 clear" to enable SAM_BA on next reboot
  Save the image of the Olimex sample application, as there is no source
  code available at the moment. I used in openocd
  "dump binary sam7-ex256.bin 0x100000 0x40000"
  B.t.w: why has every device it's own layout of the JTAGheader. Luckily I
  had a DLC5 clone (Memec IJC-2) with flying leads, so I could adapt the
  the JTAG Layout 
- sam7_pgm
  Attach USB cable and repower (reboot wasn't enough, maybe I missed to give
  some commands in openocd to restart...)
  lsusb should list "..ID 03eb:6124 Atmel Corp.". Use
  "modprobe usbserial vendor=0x3EB product=0x6124" to allow communication
  via /dev/ttyUSBx and get,  patch and compile sam7_prg as described on
  http://claymore.engineer.gvsu.edu/egr326/AT91SAM7S
  Flash the programm like
  ./sam7_pgm events.hex
  sam7_pgm automatically sets NVM Bit 2 so Sam7 will start from flash next
  time. Hitting the reset switch of the board should now start the event
  output on a serial console (115200 baud, Jumper DRXD and DTXD set)

Next task: Clear the GPNVM bit 2 from inside Ethernut. That way, programming
could be done withe only sam7_prg (after initial usage of openocd or the
clear jumper).

I tried
#define FLASH_WRITE_WAIT        60000
RAMFUNC int At91EfcCmd(u_int cmd, u_long tmo);

and in main:
    int rc = 0;
    ...
    rc = At91EfcCmd(MC_GPNVM2|MC_FCMD_CGPB, FLASH_WRITE_WAIT);
    if(rc == 0)
       puts("Next reboot should start SAM_BA\n");
    else
       puts("Failed to clear GPNVM Bit 2. Next boot, application will\
    restart\n");

Rebooting show the output "Next reboot should start SAM_BA\n", but still the
application is started, not SAM-BA. 

Why is At91EfcCmd() not exported in at91_efc.h ? And why doesn't the code
work as expected.

Cheers 

-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the En-Nut-Discussion mailing list