Reboot/Soft Reset possible?

Technical questions regarding the XTC tools and programming with XMOS.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Reboot/Soft Reset possible?

Post by kster59 »

Is there some Xc library function to reboot the Xmos device through software (not a JTAG command)?

I got the USB flash bootloader/firmware update working and it would be nice to reboot the device without unplugging the device and plugging it back in.

I noticed even on the XMOS IDE tools that once you flash it you need to unplug the XMOS XC-1A and plug it back.


User avatar
Berni
Respected Member
Posts: 363
Joined: Thu Dec 10, 2009 10:17 pm
Contact:

Post by Berni »

Well the chips seam to reset when you write to some PLL setting register. Look around a bit and you should find a few lines of assembler that reads the register and then writes back the same value and supposedly that causes the chip to reset. I have no idea if this is a silicon bug or actually intentional, but it can be useful.
DaveBest
Member++
Posts: 25
Joined: Mon Jan 18, 2010 3:36 pm

Post by DaveBest »

You can write a function for this:
Take a look at http://www.xmoslinkers.org/forum/viewto ... ?f=4&t=293

Or in short:

Code: Select all

#include <xs1.h>

void chipReset(void)
{
  unsigned x;
 
  read_sswitch_reg(get_core_id(), 6, x);
  write_sswitch_reg(get_core_id(), 6, x);
}
But i got no idea how you could possibly do this immediately after the program has been burned into the flash.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

I tried this but it doesn't seem to work on the XC-1A.

Is something to do with the FTDI 2232D JTAG?

I already have the firmware burned to flash and a reset by unplugging the usb cable and plugging it back in resets it and loads the new flash and I verified this works.

However,

Code: Select all

void chipReset(void)
{
  unsigned x;
  
  read_sswitch_reg(get_core_id(), 6, x);
  write_sswitch_reg(get_core_id(), 6, x);
}
Does not seem to reset my XC-1A device.

Has anyone else tried it?
User avatar
Woody
XCore Addict
Posts: 165
Joined: Wed Feb 10, 2010 2:32 pm

Post by Woody »

Berni wrote:Well the chips seam to reset when you write to some PLL setting register. ... I have no idea if this is a silicon bug or actually intentional, but it can be useful.
This is the intended operation. When the PLL is reprogrammed it's possible to get short clock pulses which are out of spec. for the device. So to avoid problems when the PLL is reprogrammed, the chip is reset.
User avatar
Ross
XCore Expert
Posts: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

Unfortunately it doesn't work for me with an XC-1A.

Even the XMOS IDE tools when you execute the "run / from flash" doesn't reboot the device so maybe there is something to do with the FT2232D chip. I need to physically unplug and plug it back in.

I have a XK1 also that I can try to see if that's the problem...

Anyone with an XC-1A have it working?
User avatar
shawn
XCore Addict
Posts: 238
Joined: Thu Dec 17, 2009 5:15 am

Post by shawn »

I plan on getting a small batch of XC-1A's, I hope...
I shall print out the XC-1A spec's and give a good
read especially where it relates to the POR feature
and wiring of the FT2232 to be sure. I know the G4
is all ported differently and the slavecores and their
master should reconfigure more gracefully. Right
now I am not sure how FT2232 is setup physically
as it may not or may be a symptom.
User avatar
Woody
XCore Addict
Posts: 165
Joined: Wed Feb 10, 2010 2:32 pm

Post by Woody »

kster59 wrote:Unfortunately it doesn't work for me with an XC-1A.
Resetting the XS1 device by writing to the PLL will reset the XCore. It will not reset external devices unless they are specifically reset by the boot code running on the XCore.

On the XS-1A board from the schematics it looks like the the FT2232D is reset independently.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

I'm using the XC-1A. I don't think there's any peripherals that need to be reset unless the XMOS device is being held in JTAG debug mode.

If I run a program and that program updates the flash then executes a reset of the core, it should load the newly just written program into the flash shouldn't it?

On the XC-1A my program writes the update fine but I need to unplug it and plug it back into the USB before it will boot the updated code.
Post Reply