[mc1322x] CodeSourcery , flash loader

Andrew Pullin pullin at berkeley.edu
Tue May 11 16:07:38 EDT 2010


More on this JTAG stuff. I updated OpenOCD, built it with libftdi 0.17-1 
. No errors when inserting breakpoints.
But it still isn't working right, unfortunately. If I load the code with:

target remote localhost:3333
monitor soft_reset_halt
set *0x80020010 = 0
load
monitor reg pc 0x00400000
continue

then it'll run just fine (using blink-green_redbee-econotag.elf).
But if I set a breakpoint at main, it'll run to main() fine. But then if 
I step instruction on the call to gpio_pad_dir(), the PC will end up at 
0x00000004, jump to 0x00400004, and fall though the undefined handlers 
until it loads R0 into PC, and the OpenOCD console reports, "Error: 
address + size wrapped(0xffffffff, 0x00000004)".

Actually, as I was writing this, my J-Link EDU came in the mail, and 
trying the same thing with the JLink + OpenOCD seems to produce 
identical results: jump to 0x04.
So, any idea what's going on? Something to do with a call to a function 
that's in ROM?
Sorry if this is something "obvious" ; I've never gotten JTAG to work 
with a project before, and I always end up debugging-by-printf... so I'm 
very interesting in getting this to work right.

-Andrew

On 05/06/2010 04:49 AM, Mariano Alvira wrote:
> On Wed, May 05, 2010 at 07:09:16PM -0700, Andrew Pullin wrote:
>    
>> On 05/02/2010 11:03 AM, Mariano Alvira wrote:
>>      
>>>
>>>        
>> Ah, ok, OpenOCD seems to work, for the most part. If I connect via gdb,
>> I can load&  run a program as per the instructions on the site.
>> Unfortunately, debugging doesn't seem to be working? If I do a "break
>> main", and then "continue", it won't work right:
>>      Warning:
>>      Cannot insert breakpoint 8.
>>      Error accessing memory address 0x400982: Unknown error 4294967295.
>>
>> Single instruction stepping seems to work and output the proper source
>> lines, but OpenOCD occasionally generates "Error: address + size
>> wrapped(0xfffffffe, 0x00000004)" .
>>
>> I'm using a development version of OpenOCD, 0.5.0-dev-00191-gcc5f3c8,
>> built with --enable-maintainer-mode . Have you gotten breakpoints and
>> debugging to work fully?
>>      
> Yes, that should work. OpenOCD does change and break stuff frequently
> though. What kernel are you running? There is a bug in the ftdi driver
> for the FT2232H that has been fixed since 2.6.31 --- it caused data to
> be lost randomly (also caused dropped serial characters). If you
> aren't running a newer kernel then I'd try that before trying a
> different version of OpenOCD.
>
> I know this commit is good: 0324eb24967088f753bc2fd997b4c18f4ea988c8
>
> So if it is Openocd you can bisect against that.
>
>    
>>      
>>>> If the Econotag has onboard JTAG, does that mean that there's a way to
>>>> do a similar thing with the redbee-dev, not needed a JTAG pod?
>>>>
>>>>          
>>> Yes, you plug in an EconoTAG and run:
>>>
>>>      openocd -f board/redbee-econotag.cfg
>>>
>>>        
>> That seems to work for the Econotag, but the small redbee + dev board
>> only enumerates one USB->serial device when I plug it in, which seems to
>> be the communication UART.
>>      
> Ah, I think I misunderstood/misread your question. The module has it's
> JTAG pins on the top and no JTAG controller. The dev board doesn't
> hook into JTAG at all --- so for the redbee + dev combo you need an
> external JTAG pod.
>
> -Mar.
>    




More information about the mc1322x mailing list