Search found 62 matches

by ers35
Sat Apr 20, 2019 2:44 pm
Forum: Development Tools and Programming
Topic: --image-search-sector usage?
Replies: 3
Views: 7174

Re: --image-search-sector usage?

Use the libflash API to iterate through the available images in the flash. See app_flash_util for an example. It may already be compatible with your board.
by ers35
Fri Apr 19, 2019 8:09 pm
Forum: Development Tools and Programming
Topic: --image-search-sector usage?
Replies: 3
Views: 7174

Re: --image-search-sector usage?

The XFLASH manual says --image-search-sector is the default mode as of tools 14.2.

What are you trying to do with xflash?
by ers35
Thu May 25, 2017 2:09 am
Forum: Development Tools and Programming
Topic: Any xTIMEcomposer __VERSION__ like macro?
Replies: 3
Views: 4863

Re: Any xTIMEcomposer __VERSION__ like macro?

As a workaround you can generate a header file containing the version using a Makefile. See the attached example.

Code: Select all

$ xmake
$ xsim bin/main.xe 
Community_14.2.4 (build 15898, Dec-20-2016)
by ers35
Tue Mar 07, 2017 3:44 am
Forum: Development Tools and Programming
Topic: Passing unsafe pointers through a channel
Replies: 1
Views: 5042

Re: Passing unsafe pointers through a channel

The scope of pBridgeState is limited to the first unsafe block. You don't get an error for bridgeStateMemLock because it is available in the outer scope. You meant to use pBridgeStateMemLock. Do the following instead: bridgeState_t bridgeState; swlock_t bridgeStateMemLock; unsafe{ bootDone <: (bridg...
by ers35
Sat Feb 25, 2017 5:29 am
Forum: Development Tools and Programming
Topic: List of string constants and C++
Replies: 1
Views: 2726

Re: List of string constants and C++

At first I tried this, but the program crashes because sizeof(&list[0]) is not the same in XC and C so the types don't match. I wonder if the compiler should produce a warning: // string-constant.xc // xcc -target=XS1-L4A-64-TQ48-C4 string-constant.xc string-constant.c #include <stdio.h> extern ...
by ers35
Wed Oct 12, 2016 12:08 pm
Forum: Other XMOS Development Kits
Topic: AVTP Wireshark Analysis
Replies: 6
Views: 8678

Re: AVTP Wireshark Analysis

Is your laptop a Mac? Try using Windows or Linux. See my other post: https://www.xcore.com/forum/viewtopic.php?p=23460#p23460 What commands did you use to enable mirroring? Paste the output of "show mirror". Try these commands. For example, to mirror port 1 to port 8: configure mirror add ...
by ers35
Wed Aug 10, 2016 6:23 pm
Forum: Q&A
Topic: Const Array
Replies: 5
Views: 6331

Re: Const Array

Use an enum:

Code: Select all

// xcc -c -target=XCORE-200-EXPLORER array.xc

#include <stdint.h>

enum { N = 4 };

int main()
{
  uint8_t received[N];
  return 0;
}
by ers35
Sun Jun 26, 2016 1:23 am
Forum: Development Tools and Programming
Topic: path problem when file reading
Replies: 4
Views: 7889

Re: path problem when file reading

Change the current directory before calling xrun:

Code: Select all

REM setup environment
call "C:\Program Files (x86)\XMOS\xTIMEcomposer\Community_14.1.2\SetEnv.bat"
cd "Folder 2"
xrun binary.xe
cd ../"Folder 3"
xrun binary.xe
by ers35
Tue Jun 14, 2016 7:56 am
Forum: Development Tools and Programming
Topic: Passing va_list as a function argument
Replies: 5
Views: 11394

Re: Passing va_list as a function argument

I am not aware of a comprehensive document that covers all the differences. The XC 1.0 specification is still useful despite missing newer additions. The XMOS Programming Guide is more up to date.
by ers35
Tue Jun 14, 2016 7:16 am
Forum: Development Tools and Programming
Topic: Passing va_list as a function argument
Replies: 5
Views: 11394

Re: Passing va_list as a function argument

XC is not 100% compatible with C syntax. Include stdio.h and use __VALIST instead.

Code: Select all

// xcc -c stdarg2.xc

#include <stdarg.h>
// #define __VALIST char*
#include <stdio.h>

void foo(__VALIST arg);