De/Re-assigning Port pins real time

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
Post Reply
zonedar
Member
Posts: 14
Joined: Fri Nov 14, 2014 6:58 pm

De/Re-assigning Port pins real time

Post by zonedar »

Hi all,

I've got a project I'm using a slice kit to vet out code and techniques before i get a laid-out board. I'm using all the PCI-e connectors (Triangle-LCD, Star-SDRAM, Circle-GPIO, Square-SDFlash card).

I'm trying to test out a method to do in field updates via the SD card that I've got mounted as a FAT FS and using the flashlib (fl_*).

However the pins to the SPI flash that the XMOS boots from are in conflict with some of the pins used by the SDRAM slice card (STAR port).

Code: Select all

on tile[0] : sdram_ports sdramports = {
  XS1_PORT_16A, XS1_PORT_1B, XS1_PORT_1G, XS1_PORT_1C, XS1_PORT_1F, XS1_CLKBLK_2 };

on tile[0] : fl_PortHolderStruct spi = { PORT_SPI_MISO, PORT_SPI_SS, PORT_SPI_CLK, PORT_SPI_MOSI, XS1_CLKBLK_2};
I will never access the boot flash at the same time I will use the SD card. According to the doc there is a MUX in between the STAR port and the boot spi on these pins so I can keep it from wiggling the the wrong thing.

Is there a way I can dynamically assign these ports at run time?

Thanks,

-Steve


User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Hi zonedar, the XMOS factory supplied bootrom code makes use of the referenced port pins to boot from the external SPI flash device.

However, if you apply the following few lines of code,

http://www.xcore.com/forum/viewtopic.ph ... tch#p14268

then you may steer the mux to allow for your access to the same SPI port pins. The method is a one-time latch and will remain in this latched state till the next power up cycle.

XS1-L16 boot

https://www.xcore.com/forum/viewtopic.php?f=8&t=2827

http://www.xcore.com/forum/viewtopic.ph ... mux#p18949
* see comment from Sam (XMOS) - if the Slicekit support files are used then similar code for the mux will be embedded into your source code automatically - we have been applying manually to date in our experiments

https://github.com/xcore/sc_slicekit_support
zonedar
Member
Posts: 14
Joined: Fri Nov 14, 2014 6:58 pm

Post by zonedar »

Hi mons,

Thanks and the info about the mux is useful.

However I left out the important bit of my question. The crux is that I can't get the program to link due to 'duplicate port declarations'.

Code: Select all

xmap: Error: L00130 Symbol sdramports.cas is a duplicate port declaration.
xmap: Error: L00130   previously declared as spi.spiSS.
xmap: Error: L00130 Symbol sdramports.we is a duplicate port declaration.
xmap: Error: L00130   previously declared as spi.spiCLK.
xmap: Error: L00130 Symbol spi.spiMOSI is a duplicate port declaration.
xmap: Error: L00130   previously declared as touchports.PENIRQ.
xmap: Error: L00131 Symbol sdramports.cb is a duplicate clock declaration.
xmap: Error: L00131   previously declared as spi.spiClkblk.
Is there a way to dynamically assign/de-assign ports at run time. Or is it possible to de-reference them as pointers to pins to allow them to be used in two different struct?

Thanks,

-Steve
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm
Contact:

Post by Folknology »

Take a look at movable ports, there is an example of their use here:

https://www.xmos.com//download/public/a ... 0.a%29.pdf

regards
Al
zonedar
Member
Posts: 14
Joined: Fri Nov 14, 2014 6:58 pm

Post by zonedar »

Thanks Al. I look into it.

-Steve
Post Reply