Page 1 of 1

Need to use more then 64kb programming flash space in XmosStartkit

Posted: Mon Jun 19, 2017 6:07 am
by darshan2210
Hello ,
I am facing some Problems with XMOS startkit.
I have checked in XMOS hardware Guide that there are 2 MB flash .
But Still i can Used only 64kb space. WHY?
And Can i Use multi tile on Single startkit.

I have these type of error if i use multiple tile

par
{

on tile[0]: output_gpio(i_gpio_tx, 1, p_uart_tx, null);
on tile[0]: output_gpio(TowerLightArray, 4, TowerLight, null);
on tile[0]: output_gpio(StatusLEDArray,4,ELED,null);
on tile[0].core[1]: input_gpio_with_events(SwitchArray,4,SwitchPannel,null);
on tile[0]:uart_tx(i_tx, null,115200, UART_PARITY_NONE, 8, 1,i_gpio_tx[0]);
on tile[0].core[0] : input_gpio_with_events(i_gpio_rx, 1, p_uart_rx, null);
on tile[0].core[0]: uart_rx(i_rx, null, RX_BUFFER_SIZE,115200, UART_PARITY_NONE, 8, 1,i_gpio_rx[0]);
on tile[0]: encoder_read(p_inputsw,enc_data1,OffsetUpdate1,ClickEvent1,DrillStateINT1,SingleCycleINT1);
on tile[0]: transmit(i_tx, enc_data1,OffsetUpdateAck1);//(server interface b1 i1, client uart_tx_if uart_tx,server interface b2 m1,streaming chanend
reset_flag)
on tile[1]:Capture(pcam_trig,ClickEvent1);
on tile[0]:InOutCommon(TowerLightArray[0],TowerLightArray[1],TowerLightArray[2],TowerLightArray[3]
,StatusLEDArray[1],StatusLEDArray[2],StatusLEDArray[3],SwitchArray[0],SwitchArray[1],SwitchArray[2],SwitchArray[3],DrillStateINT1,SingleCycleINT1);


}

Error: Description Resource Path Location Type
index of array exceeds its upper bound main.xc /main_proj_test_270117/src line 267 C/C++ Problem


Please let me know what is possible if i need to use more programming space .
Thanks in advance.

Re: Need to use more then 64kb programming flash space in XmosStartkit

Posted: Mon Jun 19, 2017 9:21 am
by CousinItt
As it says in the startkit hardware manual:
startKIT is based on a two-tile xCORE device (xCORE-Analog A8-DEV). Tile 0 is
dedicated to the integrated debugger and USB PHY. Tile 1 is user-programmable
providing eight logical cores with a total of 500 MIPS compute. All the digital I/O on
Tile 1 have been brought out to pins providing many combinations of peripherals
to be integrated with the startKIT board.
As I understand it, there is no chance of using tile 0 in a user program. The device has 64 kb per tile, hence the limitation on code size.

Re: Need to use more then 64kb programming flash space in XmosStartkit

Posted: Mon Jun 19, 2017 1:38 pm
by Bianco
Are you sure this is not an index out of bound issue?

Code: Select all

#define RAM_SIZE 65535

int main (void)
{
  char myarray[RAM_SIZE+1];
  myarray[0] = 1;
  return 0;
}
Result:

Code: Select all

xcc -target=STARTKIT main1.xc

Constraint check for tile[0]:
  Cores available:            8,   used:          1 .  OKAY
  Timers available:          10,   used:          1 .  OKAY
  Chanends available:        32,   used:          0 .  OKAY
  Memory available:       65536,   used:      66696 .  FAILED
    (Stack: 66148, Code: 470, Data: 78)
Error: Constraints check FAILED for tile[0].

Code: Select all

int main (void)
{
  char myarray[10];
  myarray[10] = 1;
  return 0;
}
Result:

Code: Select all

xcc -target=STARTKIT main1.xc
main1.xc:5:10: error: index of array exceeds its upper bound
  myarray[10] = 1;

Re: Need to use more then 64kb programming flash space in XmosStartkit

Posted: Tue Jun 20, 2017 5:07 pm
by Bambus
There is an SPI flash memory on the board with 256kB. You can't run your program on it, but you can flash it with your object files.
Technically, it might be possible to use both tiles if you use an external JTAG debugger. Check out this thread: http://www.xcore.com/viewtopic.php?f=44&t=2477

Re: Need to use more then 64kb programming flash space in XmosStartkit

Posted: Wed Jun 21, 2017 7:31 am
by darshan2210
Sorry Bianco But i can't understand what you want to say ?
I put the error that listed after build my project .
And one question in my mind that the flash memory is about 2MB then why Startkit only provide of 64KB ?
Thanks For all buddies those have Supported.

Re: Need to use more then 64kb programming flash space in XmosStartkit

Posted: Wed Jun 21, 2017 9:08 am
by infiniteimprobability
Sorry Bianco But i can't understand what you want to say ?
I put the error that listed after build my project .
What Bianco illustrated nicely with code examples was that there is a difference between an out of bounds index and exceeding internal memory. Looks like you may have the first issue, not the second. Check your source at the relevant line that the compiler tells you for index out of range errors..
And one question in my mind that the flash memory is about 2MB then why Startkit only provide of 64KB ?
Thanks For all buddies those have Supported.
xcores run all code from internal SRAM. Flash is not memory mapped. At boot time, the code is copied into internal RAM and run from there. You would never get the sort of performance and xcore provides running out of SPI flash

Re: Need to use more then 64kb programming flash space in XmosStartkit

Posted: Fri Jun 23, 2017 5:31 am
by darshan2210
so can we use both Tile tile[0] and tile[1].?

Re: Need to use more then 64kb programming flash space in XmosStartkit

Posted: Fri Jun 23, 2017 8:57 am
by infiniteimprobability
CousinItt's first response to you answered this correctly. Short answer is no I'm afraid.

There may well be ways of hacking the OTP and board to get access to tile[0] (turn it into a U16 device) which has been discussed on other threads here but then you'll be left with the issue of how to program and debug because your integrated xtag running on tile[0] will be no more.

Re: Need to use more then 64kb programming flash space in XmosStartkit

Posted: Thu Jun 29, 2017 11:56 am
by darshan2210
ok . Thanks to all Supporting buddies .
Really Good support there.