I have been playing around with a 2148 and olimex interface, as the description says, for a little while now.
The other day I was programming, had just set some PLL parameters and some time later when debugging the code, the chip seemed to stop processing… When trying to reload the code to flash, several error messages appeared… I disconnected the chip from the interface and tried again… only to receive the following errors…(i am using openOCD and eclipse)
Info : clock speed 1500 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: lpc2148.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Embedded ICE version 0
Error: unknown EmbeddedICE version (comms ctrl: 0x00000000)
Info : lpc2148.cpu: hardware has 2 breakpoint/watchpoint units
However it still seems to connect to the chip… but i cannot seem to halt the cpu to load/erase the flash or perform any other tasks…
if i try to halt via telnet i receive the following:
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
in procedure 'halt'
It could be the USB-Tiny. But if you have the ability, reprogram via serial port to a known well-behaved configuration. It is possible to accidentally (or on purpose) have your start-up code disable the JTAG interface.
[You may already know all this - apologies if so.]
The LPC2148 has a built in bootloader that tries to establish communication on RXD0 & TXD0 (P0.1 & P0.0) if P0.14 is held low during reset. AN10356 [here is really about in-application programming, but does give some background on the built-in command handler.
The software most commonly used to perform this task is[Flash Magic.
So if your board has a level-shifter on those pins, you can use Flash Magic to reprogram the chip via the serial port on your PC. Or if your board has a USB-serial converter there, you can re-program via USB. This bootloader runs before your user program, so it can be used no matter what code you have in the part. Whereas the JTAG pins won’t work if your code re-configures the pins as GPIO, for example.
Ah. One of the bargain sites I frequent used to carry a header board from the0. Similar to the Olimex [header board that Sparkfun sells. As you say, the pins go straight to the header. So you’d have to buy a [level shifter or [USB inteface just to connect to the pins. Not an easy decision - might be a waste of time and money since the 2148 might be completely dead, or the USB-Tiny might be the problem, or…
ule_1 could you please post your openocd configuration file here? ive been having trouble flashing the olimex lpch2148 with openocd. i suspect it has to do with the new version of openocd 0.6, i have tried with some different files around the internet but none of them worked. Lots of syntax (it seems) errors appear.
im working under ubuntu 12.04 with a jlink jtag debugger. i can succesfully communicate with the jlink via the openocd telnet port, but the flashing thing havent worked so far.
With this file I run openocd: sudo openocd -f config.cfg
and this is the output generated:
Open On-Chip Debugger 0.6.0-dev-00599-ga21affa (2012-06-08-05:31)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
init_targets
Warning - assuming default core clock 12MHz! Flashing may fail if actual core clock is different.
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
1500 kHz
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled Dec 1 2009 11:42:48
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 80000
Info : J-Link hw type J-Link
Info : J-Link max mem block 9576
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0x0
Info : Vref = 3.300 TCK = 1 TDI = 0 TDO = 0 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
Info : clock speed 1500 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : Embedded ICE version 4
Info : lpc2148.cpu: hardware has 2 breakpoint/watchpoint units
Now, on the other console I connected to the telnet port
telnet localhost 4444
and this is what I did:
Open On-Chip Debugger
> flash banks
#0 : lpc2148.flash (lpc2000) at 0x00000000, size 0x0007d000, buswidth 0, chipwidth 0
> halt
target state: halted
target halted in Thumb state due to debug-request, current mode: System
cpsr: 0x8000003f pc: 0x0000220e
> flash write_bank 0 helloWorldARM.o 0
Verification will fail since checksum in image (0x00000001) to be written to flash is different from calculated vector checksum (0x588a38b2).
To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
wrote 124326 bytes from file helloWorldARM.o to flash bank 0 at offset 0x00000000 in 10.918998s (11.119 KiB/s)
So I think it worked well. Now I have to test if the program was correctly flashed.