Hi Freddie.

(This is a repost, so the list will get a copy. - sorry, my email program keeps 
sending from the wrong address.)

On Mon, 08 Sep 2014 08:23:21 +0200, Freddie Chopin wrote:
> W dniu 2014-09-07 22:29, Jens Bauer pisze:
>> First of all: a NOP that is HardFaulting.
> 
Maybe this is an interesting direction - in my very old (2010) LPC13xx 
manual it says that 0x2fc is the address for "code read protection" 
value which is inserted automatically by NXP tools (like Flash Magic), 
but in this very old manual it also says:

>> When programming flash images via [...] Serial Wire Debugger (SWD), the
user code valid signature is automatically inserted by the 
programming utility.
> 
The problem is that you have the undefined instruction at 0x266, and the 
value seen there doesn't look anything like the values for CRP...

I thought about the CRP as well (right after sending the mail).
But as you say, it's on a different address.

> How do you program the chip? If you use "dump image" command do you also 
get this wrong value? Is the wrong instruction at this address present 
every time, or only after it hardfaults?

I tried dump_image and hexdump -v -C ...

00000240  00 bf 00 bf 00 bf 00 bf  00 bf 00 bf 00 bf 00 bf  |.?.?.?.?.?.?.?.?|
00000250  00 bf 00 bf 00 bf 00 bf  00 bf 00 bf 00 bf 00 bf  |.?.?.?.?.?.?.?.?|
00000260  01 bf 00 bf 00 bf 00 b7  00 bf 05 3a 9f d1 70 bd  |.?.?.?.?.?.:.?p?|
00000270  00 00 01 50 f8 b5 4f f4  80 73 4f f0 a0 45 c5 f8  |...P??O?.sO?E??|
00000280  00 34 1d 4b 00 20 1a 68  1c 4e 42 f4 80 72 1a 60  |.4.K. .h.NB?.r.`|
00000290  4f f4 00 72 03 f5 00 43  c3 f8 00 28 03 f5 00 43  |O?.r.?.C??.(.?.C|

As you see, the b7 is there; faulty.

So I tried turning off the power, turning it on, connecting OpenOCD and dumping 
a new image...

00000240  00 bf 00 bf 00 bf 00 bf  00 bf 00 bf 00 bf 00 bf  |.?.?.?.?.?.?.?.?|
00000250  00 bf 00 bf 00 bf 00 bf  00 bf 00 bf 00 bf 00 bf  |.?.?.?.?.?.?.?.?|
00000260  00 bf 00 bf 00 bf 00 bf  00 bf 01 3a 9f d1 70 bd  |.?.?.?.?.?.:.?p?|
00000270  00 00 01 50 f8 b5 4f f4  80 73 4f f0 a0 45 c5 f8  |...P??O?.sO?E??|
00000280  00 34 1d 4b 00 20 1a 68  1c 4e 42 f4 80 72 1a 60  |.4.K. .h.NB?.r.`|
00000290  4f f4 00 72 03 f5 00 43  c3 f8 00 28 03 f5 00 43  |O?.r.?.C??.(.?.C|

This looks perfect.

So for some reason, it seems that after a short while, funny bits show up in 
the flash memory.
That is probably why the chip is hardfaulting.

I then tried turning off the power, turning it on, and immediately ...

> arm disassemble 0x240 20
0x00000240  0xbf00      NOP
0x00000242  0xbf00      NOP
0x00000244  0xbf00      NOP
0x00000246  0xbf00      NOP
0x00000248  0xbf00      NOP
0x0000024a  0xbf00      NOP
0x0000024c  0xbf00      NOP
0x0000024e  0xbf00      NOP
0x00000250  0xbf00      NOP
0x00000252  0xbf00      NOP
0x00000254  0xbf00      NOP
0x00000256  0xbf00      NOP
0x00000258  0xbf00      NOP
0x0000025a  0xbf00      NOP
0x0000025c  0xbf00      NOP
0x0000025e  0xbf00      NOP
0x00000260  0xbf00      NOP
0x00000262  0xbf00      NOP
0x00000264  0xbf00      NOP
0x00000266  0xbf00      NOP
(program is still running after disassembling)

But going back to the text-file I attached previously, there's still some 
odd/even spook in there.

I believe it can probably be 'fixed' by moving my code. I'll try that and see 
if it keeps running.
After a while, I could then dump the memory and see if anything changed.

> It is also possible that the chip is somehow broken - if you have 
another board try the same firmware with a different chip...

Yes, that's possible. I'm using 'bare boards' and currently I have only this 
single LPC1342. It hasn't been used much, but could of course have been damaged 
somehow (ESD, lightning, cheese-sandwich, evil power supply, ...).

BTW: <http://usbcables.gpio.dk/>
-I am using a genuine Distortec USB cable connected directly from my computer 
to my JTAG-lock-pick Tiny 2, though; so there's no problem there! ;)


Love
Jens

> 
Regards,
FCh

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to