Re: [ECOS] Re: Flash memory not accessible via Redboot on Kinetis TWR_K60N512_KIT

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [ECOS] Re: Flash memory not accessible via Redboot on Kinetis TWR_K60N512_KIT

Tomas Frydrych-6
Hi Michael,

On 15/02/12 04:40, Michael Bergandi wrote:
>>> As of OpenOCD v0.5.0, I see no support and only a quick mention the
>>> TODO. However, I did find one posting while Googling, that claimed
>>> that OpenOCD had added support...unfortunately, they provided no
>>> details.
>>
>> I use OpenOCD + JLink with the board, but you need to build OpenOCD from
>> git, as the support for Kinetis TWR was only added quite recently.
>
> Does the free Segger JLinkGDBServer not work for you?

I works, but it has limited functionality, most noticeably it will not
let you load programs into flash, and OpenOCD seems to work just as well
once you get it going. (But the JLink command tool that also comes with
the free Segger tools is invaluable if you ever screw up the security
bytes on the flash; it has a handy command to fix those.)

There are a couple issues I run into with OpenOCD:

1. if you are using a newer version of gdb, there is a mismatch between
the number of registers OpenOCD reports and gdb expects, and gdb will
just exit with an error. Building OpenOCD from source something like
this with fix it
http://www.mail-archive.com/openocd-development@.../msg14805.html.
But I decided to patch gdb instead to just warn rather then error.

2. JLink has to be started at 100kHz for the initial handshake between
the server and gdb, and only then can be speeded up. The Segger server
seems to do this automatically, with OpenOCD you have to tweak the
config file to achieve the same. (I have attached my cfg file, in case
it is of any use).

Tomas

openocd.cfg (2K) Download Attachment