Topic : Problem with using Rlink with STFOXF1B6 micro

Forum : ST7/STM8

Original Post
Post Information Post
October 7, 2008 - 10:06pm
Guest

Hi everyone,

I have just received my STX-Rlink and have build a proto board for programming my FOXF1 microcontroller. But as I am new to ST7 micro and Ride development tools, I guess I am doing something wrong because every time I try to connect to my target microcontroller I am getting a message" Error resetting in ICC mode: No response from the device"
I am using the ICC-ST7 daughter board for this task and have connected the HE-10 connector as below:

HE-10Pin Microcontroller Pin Signal
Pin 1,3,5,10 Pin 10: GND
Pin 2 Pin 7: ICCDATA
Pin 4 Pin 8: ICCCLK
Pin 6 Pin 9: RESET
Pin 7 Pin 11: VCC
Pin 9 Pin 13: CLKIN

I am powering the target ST7FOXF1 from an external regulated PSU.

Firstly i didn't connect the CLKIN and was keeping the setting ignore option bytes checked but found the above error message, then I unchecked the textbox for ignoring option bytes but again the same message. Then I did the connection for CLKIN and put a jumper on the daughter board to give clock(I guess that was required) but again got the same error irrespective of whether the textbox for ignoring option bytes is checked or unchecked.

Please advice on how to solve this problem and move ahead as I have to deliver my project in the next one week.
Also, I have taken snapshots of the error message and settings etc, please let me know how to upload photographs so that I can share them with you.

Rgds,
Navneet

Replies
Post Information Post
+1
0
-1
October 8, 2008 - 10:08am
Raisonance Support Team

Hi,

Your connections look fine to me.

Have you placed a capacitor between GND and VCC next to the CPU? I think you need one.

Have you placed a capacitor on RESET? You can put one but it should not be too large.

Is there a crystal on your board? If there is one, then you should not connect CLKIN from RLink, as you only need one clock, and some problems can appear if there are two clocks. (electrical conflicts, etc.)

Are there any components other than the RLink and the CPU on the ICCDATA, ICCCLK, RESET and CLKIN signals? (passive or active) If yes, try to remove them on one of your prototypes and see if it makes a difference.

If these hints do not solve your problem, we will need more information for helping you. (schematic of the board, version of the software, etc.) Please answer the questions in this form and post them here or send them to 'support@raisonance.com':
http://www.raisonance.com/Forum/punbb/viewtopic.php?id=2231

Best Regards,

Vincent

+1
0
-1
October 8, 2008 - 10:28am
Raisonance Support Team

Well, in fact I'm not so sure about the connections. The signals on RLink are fine, but on the ST7 it seems wrong. I didn't check that the first time...
If it's the 20-pin package, then ICCDATA should be on pin 18 and ICCCLK on pin 19:
http://www.st.com/stonline/products/literature/ds/14013/st7foxf1.pdf

(I assume that it's the 20-pin because for the other packages, you'd be using the wrong pins for GND and VCC ;/ )

It looks like you confused I2CDATA/I2CCLK for ICCDATA/ICCCLK. (you wouldn't be the first to make this mistake)

Best Regards,

Vincent

+1
0
-1
October 23, 2008 - 7:19pm
Guest

Hi Vincent,

Sorry for not being able to reply back as I was traveling.
Thanks for your advice, I had messed up with the ICC and I2C pins. My programmer is able to identify a device but now I need some more serious help from you.

As I am new to ST7 environment, I am really confused as to how the PC behaves in this family. My preferred language for programming is assembly as it gives me much better control of the device than C. Till now I have worked on PIC and 8051 based micro's. What I have understood about ST7 architecture is that the PC at reset points to memory address FFFE and FFFF i.e. the reset vector resides at these places and my memory starts at F000 in a 4KB device and (I guess obviously) the PC increases in every machine cycle. In this case I am not able to understand how does my PC jumps from FFFE-FFFF to the place where my reset code is placed? I have tried using the ORG directive but it is ( I think) only for locating code inside a particular segment and gives an error. I am also trying the following code, the idea behind it is to make the program jump to another place main where I can store the initializing code:-

STRT SEGMENT CODE AT 0FFFEH
aseg STRT
JP MAIN

MN SEGMENT CODE AT 0FFD0H
aseg MN
MAIN:

But this code gives an error ( no 117) saying ADDRESS SPACE OVERFLOWN.

I would request everyone to help me understand this thing. As I am relatively new to the programming domain and don't have anyone to guide me, pls advice.

Best regards,
Navneet

+1
0
-1
October 27, 2008 - 11:36am
Raisonance Support Team

Hi,

In fact the PC is not initialized with 0xFFFE like you describe, but it is loaded with the data contained there.

So at Reset, you have
PC=(*((unsigned short *)(0xFFFE)));
and not
PC=0xFFFE;

And it is the same for the other interrupt vectors.

So you have to create, at address 0xFFE0->0xFFFF, a table containing the addresses of the ISRs.
(and not instructions that jump to the ISRs)

This is explained in the ST docs in more details.

In C it is done automatically using the 'interrupt' keyword. (and some special label for the reset)
If you want to write a program completely in assembler, you have to do it manually. For example like this:

   cseg at 0ffE0h

_vectab:
   dw    NULL           ;PWMART
   dw    NULL           ;I2C
   dw    NULL           ;NOT USED
   dw    _sci_it_routine;SCI
   dw    NULL           ;TIMER B
   dw    NULL           ;TIMER A
   dw    NULL           ;SPI
   dw    NULL           ;CAN
   dw    NULL           ;EI3
   dw    NULL           ;EI2
   dw    NULL           ;EI1
   dw    NULL           ;EI0
   dw    NULL           ;MCC
   dw    NULL           ;TLI
   dw    NULL           ;TRAP
   dw    _main          ;RESET

This is an extract of file calc.st7, from the example located at
[RIDE_INSTALL_DIR]\examples\ST7\ASM\CALC\...
The example is designed for the ST72F521, so the IT vectors will not match your FOX, but you can use it as example for the syntax.

Best Regards,

Vincent