Welcome, Guest

Author Topic: Programming STM32-P207  (Read 8566 times)

rd

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Programming STM32-P207
« on: December 17, 2012, 10:14:16 PM »
Hi All!

I have a simple question, how to program STM32-P207 board? There is some note in the board's manual which makes me very confused. Here it is:

Note: additionally, the board can be programmed via JTAG interface but there are signals
multiplexed with the LCD and the audio, so if using JTAG interface for programming you might
need to implement a software mechanism to stop them or you might not be able to reprogram again.


So, what I have to do to transfer my software to the board? What kind of the mechanism I have to implement (in software/hardware)?

I use ULINK2 JTAG from KEIL as a programming/debugging device.

Thanks in advance,

Roman

LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1778
  • Karma: +46/-2
Re: Programming STM32-P207
« Reply #1 on: December 18, 2012, 08:31:31 AM »
Hey rd,

ULINK2 JTAG from KEIL has three interfaces JTAG, SWD and SWV. Just select the SWD interface as preferred interface (in the project options) and you are good to go. There is no multiplexing on the SWD lines.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

GordonS

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Programming STM32-P207
« Reply #2 on: January 25, 2013, 02:01:48 PM »
Hi,

I'm trying to program an STM32-P207 using an ARM-USB-OCD-H from Rowley Crossworks under Linux.

After some false starts, I'm connected, but I now persistently get a status error "cannot set debug register"

I've tried pressing the WKUP button and the board goes quiet, but as soon as I try to connect, the board just runs the demo again.

Have you any suggestions, please?

Thanks.
          Gordon.

-------

I reduced the JTAG clock speed (div 2) and the status changed to:
"Cannot find debug component from ROM table"
Which may now suggest a Crossworks/target issue, rather than a failure to properly communicate.
G.
« Last Edit: January 25, 2013, 02:21:28 PM by GordonS »

LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1778
  • Karma: +46/-2
Re: Programming STM32-P207
« Reply #3 on: January 25, 2013, 04:56:50 PM »
Hey Gordon,

This seems like a powering issue.  If you are powering the board from the USB try switching the USB port or try to power it externally with 5VDC.

The best suggestion in your case (as a Rowley Crossworks user) is to use ARM-JTAG-SWD adapter (https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-SWD/) which will enable the SWD interface for ARM-USB-OCD-H! This way you don't have to worry about buttons and so on. There is a ready configuration in Crossworks for the adapter (I've tested in under Windows though).

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

GordonS

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Programming STM32-P207
« Reply #4 on: January 25, 2013, 05:53:58 PM »
Hi Lub,

I've read someone else suggest that for another board.

I have to get a lead and/or PSU.
What's the DC Jack size, please?  Looks like 2.1mm?

Thanks.

Gordon.

Of course I was able to get a universal PSU with several adapters.
Problem not solved, though :-(
« Last Edit: January 25, 2013, 06:54:02 PM by GordonS »

GordonS

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Programming STM32-P207
« Reply #5 on: January 28, 2013, 03:24:26 PM »
I still can't get this to connect properly with the ARM-USB-OCD-H JTAG connection.

After reducing the JTAG clock speed to half, the problem has changed from "cannot set debug register" to "Cannot find debug component in ROM Table", which sounds rather like a Crossworks problem to me.

Are you able to confirm if I should be able to program the board OK with JTAG, or do I really need the SWD adaptor?

I don't have time to get one of the SWDs for this task, so I'll have to hack one of my prototypes, but it may be useful in the future.

LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1778
  • Karma: +46/-2
Re: Programming STM32-P207
« Reply #6 on: January 31, 2013, 09:37:06 AM »
Hey Gordon,

Our boards usually use power jack for a 2.5mm male. This is it - YDJ-1136 connector - http://store.comet.bg/Catalogue/Product/24563/.

Gordon, the problem as I have mentioned in the P207 manual is that the LCD interface uses a signal that belongs to the JTAG interface. So basically the problem is in the software we sell the board with (and the desire to put more interfaces on the board) - after reset it changes the JTAG layout in order to initialize the display for demonstration purposes. The processor pin redefined is pin #134(TRST/SPI1_MISO).

You are able to program P207 with the JTAG but it is good idea to disable the software initialization of the display in your code. Or you can hold WAKEUP BUT constantly. Note that disconnecting the LCD physically would not do the job.

SWD is required if you want to debug the display since when the display pins are initialized, the JTAG signal TRST (processor pin 134) becomes display SPI1_MISO - e.g. the whole JTAG interface becomes corrupted.

Sorry for the delay, I don't usually keep a strict eye on the forums. In future please e-mail support@olimex.com.

I will try to define the whole thing clearer in the manual.

Best regards,
Lub/OLIMEX
« Last Edit: January 31, 2013, 10:09:00 AM by LubOlimex »
Technical support and documentation manager at Olimex

GordonS

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Programming STM32-P207
« Reply #7 on: January 31, 2013, 10:57:55 AM »
Hi Lub,

I've tried pressing the WKUP, pressing and holding the WKUP and the other boot0/boot1 settings. In the other boot settings Crossworks recognises the board OK, but fails to erase or program, which I think is expected.

Actually I just tried that again so I could check accuracy of my statements, but at the moment, whatever I do I get "Target not responding.".  When I try to connect it resets the processor, but that appears to be all.

If you have any suggestions, I'll try them, but at the moment I can't really spend much time on it.

Oh, I don't need the display. I bought the board as a quick and tidy way to prototype a stepper-motor controller, but I now have the necessary drivers hacked onto one of our prototypes.

--------------------
ADDENDUM -- I get the same with my prototype with a Turtelizer dongle. Maybe there's something else going on here.
--------------------

OK, a reboot of my PC sorted whatever was amiss with the "Target not responding.".

With boot0 high I connect OK and see the device type reported on the status line.
If I try to erase I get a 'Loader verify failed", which I think is as expected. I get similar results however boot1 is set. I've now reverted to boot0 low as I think that's the right setting.
« Last Edit: January 31, 2013, 11:16:11 AM by GordonS »