November 10, 2024, 12:43:59 AM

Programming STM32-P207

Started by rd, December 17, 2012, 10:14:16 PM

Previous topic - Next topic

rd

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

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

#2
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.

LubOlimex

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

#4
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 :-(

GordonS

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

#6
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
Technical support and documentation manager at Olimex

GordonS

#7
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.