Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-24 Thread Chris Fryer
On 20/09/13 14:53, Thomas Schmid wrote: > > The binary I sent above still bricks my oocd connections. I am not > 100% sure why, but I believe that it reconfigures the reset GPIO line > to be a regular output pin and pulls it low. > I managed to get my device into a similar state to the one that T

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-20 Thread Thomas Schmid
Spencer, The binary I sent above still bricks my oocd connections. I am not 100% sure why, but I believe that it reconfigures the reset GPIO line to be a regular output pin and pulls it low. Anyway, if I have a proper C code with good startup scripts, everything works just fine. The interesting

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-20 Thread Spencer Oliver
On 20 September 2013 09:46, Chris Fryer wrote: > On 20/09/13 08:44, Chris Fryer wrote: > > I'll try to find a more controlled way to break my uC to see if I can bring > it back without manual reset intervention. > > I can now send my device to DEEPSLEEP (Kinetis VLLS0) and connect properly > using

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-20 Thread Chris Fryer
On 20/09/13 08:44, Chris Fryer wrote: I'll try to find a more controlled way to break my uC to see if I can bring it back without manual reset intervention. I can now send my device to DEEPSLEEP (Kinetis VLLS0) and connect properly using oocd without any manual intervention. Thanks as ever fo

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-20 Thread Chris Fryer
I can confirm that (using the patch and correct reset_config) I /do/ now see a pulse on the resetb line (two in fact) during oocd attach (using the right channel on the scope helps :-[ ). I'll try to find a more controlled way to break my uC to see if I can bring it back without manual reset i

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Spencer Oliver
On 19 September 2013 16:44, Chris Fryer wrote: > On 19/09/13 16:33, Spencer Oliver wrote: >> >> That cmd is not correct, try: >> reset_config srst_only srst_nogate >> the cmd you tried is for setting the core reset, it is confusing i know. >> >> Just done a quick test and it seems to be working he

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Spencer Oliver
On 19 September 2013 17:27, Spencer Oliver wrote: > On 19 September 2013 17:20, Thomas Schmid wrote: >> Spencer, >> >> Your patch compiles, and it pulls down the reset line. However, I noticed >> something else. The Reset line doesn't get pulled up all the way. It is >> stuck at 2V, instead of th

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Spencer Oliver
Chris, Are you able to try the attached patch, if not can you send me the binary that causes connection issues? This patch adds support for connecting under reset, this is already supported by the other adapters that OpenOCD supports. To use you will need to tweak your reset_config line, eg. res

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Thomas Schmid
Ups. After fixing my script, reset now works. However, I still get the following error. It looks like it finds the chip for a while, but then it gets a read error, after which it finds it again: Info : CMSIS-DAP: FW Version = 1.0 Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Spencer Oliver
On 19/09/13 20:21, Thomas Schmid wrote: > Ups. After fixing my script, reset now works. > That's good, however 'connect_assert_srst' should only be required under certain conditions such as when swd/jtag has been disabled or if invalid options have been programmed (if supported). Is this still

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Spencer Oliver
On 19/09/13 17:34, Thomas Schmid wrote: > Yes, the above binary locks oocd out. However, using the mbed tool I can > still flash the board (with the drag and drop method). > > I agree, it "should" be open-drain. There is a 10k pullup, but clearly > on my board something fights against it. Maybe the

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Thomas Schmid
Just to reconfirm, the above main.elf binary locks me out and oocd can't connect to the board anymore. Switching to Windows, and dropping the earlier FRDM_RGBLED_KL25Z.bin file into the folder reprograms the board. Switching back to Linux and connecting oocd works again. - Thomas On Thu, Sep 19

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Chris Fryer
On 19/09/13 15:55, Thomas Schmid wrote: Yes, very quick: 1. disconnect your board, press reset button and hold it while plugging board back in. 2. Drop this bootloader on the BOOTLOADER drive: https://mbed.org/media/uploads/samux/mbed_if_v2.0_frdm_kl25z.s19 3. Unplug, plug back in. 4. Drop th

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Chris Fryer
On 19/09/13 17:27, Spencer Oliver wrote: > I also switched to the mbed dap driver, just to make sure that this is not > the problem. > > The application I am trying to flash is this one: > > https://community.freescale.com/servlet/JiveServlet/download/312559-255229/test-frdm-kl25z.tar.gz > > Binar

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Thomas Schmid
Yes, the above binary locks oocd out. However, using the mbed tool I can still flash the board (with the drag and drop method). I agree, it "should" be open-drain. There is a 10k pullup, but clearly on my board something fights against it. Maybe the app configures that I/O line with a pull-down? I

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Spencer Oliver
On 19 September 2013 17:20, Thomas Schmid wrote: > Spencer, > > Your patch compiles, and it pulls down the reset line. However, I noticed > something else. The Reset line doesn't get pulled up all the way. It is > stuck at 2V, instead of the 3.3 that it should be at. > I will look into that. > >

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Spencer Oliver
On 19 September 2013 16:42, Thomas Schmid wrote: > No luck over here with this command. The Reset line doesn't move. > > Does the command have to be at a specific place in the configuation (e.g. > before we include the kl25.cfg file)? > > Spencer: which programmer are you using? I use the Keil boo

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Spencer Oliver
On 19 September 2013 15:46, Chris Fryer wrote: > On 19/09/13 15:29, Thomas Schmid wrote: > > You can unstuck your device by reprogramming it using the mbed.org tools. At > least, that's what worked for me. > > Thanks for the suggestion. > I haven't used mbed at all and from a quick look, it's not

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Chris Fryer
On 19/09/13 16:33, Spencer Oliver wrote: > That cmd is not correct, try: > reset_config srst_only srst_nogate > the cmd you tried is for setting the core reset, it is confusing i know. > > Just done a quick test and it seems to be working here. Hmmm ... something funny going on. Maybe I'm a patch s

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Thomas Schmid
No luck over here with this command. The Reset line doesn't move. Does the command have to be at a specific place in the configuation (e.g. before we include the kl25.cfg file)? Spencer: which programmer are you using? I use the Keil bootloader included in the app note 232 for the FRDM board (usb

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Thomas Schmid
Should work on Linux and Mac, depending on your bootloader version. At least on my Ubuntu 13.04, the BOOTLOADER drive shows up. - Thomas On Thu, Sep 19, 2013 at 9:02 AM, Chris Fryer wrote: > On 19/09/13 15:55, Thomas Schmid wrote: > > Yes, very quick: > > 1. disconnect your board, press res

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Thomas Schmid
Yes, very quick: 1. disconnect your board, press reset button and hold it while plugging board back in. 2. Drop this bootloader on the BOOTLOADER drive: https://mbed.org/media/uploads/samux/mbed_if_v2.0_frdm_kl25z.s19 3. Unplug, plug back in. 4. Drop the attached binary on your board. 5. Now you c

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Spencer Oliver
On 19 September 2013 16:29, Chris Fryer wrote: > On 19/09/13 15:53, Spencer Oliver wrote: >> >> Another option is to press and release the reset button while OpenOCD is >> trying to connect. It may take a few attempts but usually works, the object >> is to connect before any code is executed. Chee

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Chris Fryer
On 19/09/13 16:12, Thomas Schmid wrote: > Should work on Linux and Mac, depending on your bootloader version. At > least on my Ubuntu 13.04, the BOOTLOADER drive shows up. I'm on Ubuntu 13.04 and the BOOTLOADER drive shows up but IIRC dropping an S19 file on it had no effect. I could only reflash

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Chris Fryer
On 19/09/13 15:53, Spencer Oliver wrote: > Another option is to press and release the reset button while OpenOCD > is trying to connect. It may take a few attempts but usually works, > the object is to connect before any code is executed. Cheers Spen No luck with any of the reset_config options

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Chris Fryer
On 19/09/13 15:29, Thomas Schmid wrote: You can unstuck your device by reprogramming it using the mbed.org tools. At least, that's what worked for me. Thanks for the suggestion. I haven't used mbed at all and from a quick look, it's not obvious how to access these 'tools'. Is

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Spencer Oliver
On 19 September 2013 15:29, Thomas Schmid wrote: > Chris, > > I am having very similar problems. cmsis-dap does a software reset using > SWD. That's why you don't see any activity on the reset line. You can > unstuck your device by reprogramming it using the mbed.org tools. At least, > that's what

Re: [OpenOCD-devel] cmsis-dap reset problem

2013-09-19 Thread Thomas Schmid
Chris, I am having very similar problems. cmsis-dap does a software reset using SWD. That's why you don't see any activity on the reset line. You can unstuck your device by reprogramming it using the mbed.org tools. At least, that's what worked for me. I am now looking into a way to switch from so