This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Contiki example with TI arm compiler.

Other Parts Discussed in Thread: CC2650

I was able to compile contiki hello-world example using TI ARM compiler v15.12.3.LTS.

But that seems not working correct.

Following shows steps to build.

1. To get list of source files and options, run `make --dry-run`.

make --dry-run TARGET=srf06-cc26xx BOARD=sensortag/cc2650 > log

2. Parse log file using python script ( gist.github.com/.../bad5ebebb0b4674902b42b478ee9784d )

python contiki_make_log_parser.py log > sources

This python script generate `option.cmd` file and output list of source files to stdout.

3. Create CCS Empty project.

Create empty ccs project with TI v15.12.3 compiler. Then copy source files to project directory except startup_gcc.c .

Instead of startup_gcc.c, copy startup_ccs.c from TI RTOS install path.

cp `cat sources` /path/to/prj/dir
rm /path/to/prj/dir/startup_gcc.c
cp /path/to/ti/rtos/dir/product/cc26xxware/startup_files/startup_ccs.c /path/to/prj/dir

4. Modify sources and headers.

4.1 contiki/core/sys/cc.h

Add following to contiki/core/sys/cc.h

#ifdef __TI_COMPILER_VERSION__

#ifndef CC_CONF_INLINE
#define CC_CONF_INLINE __inline__
#endif

#define CC_ALIGN(n) __attribute__((aligned(n)))

#endif

4.2 /path/to/prj/dir/contiki-main.c

Replace from "nop" to " nop" in fade function.

4.3 /path/to/prj/dir/contiki-watchdog.c

call ti_lib_watchdog_stall_enable() in watchdog_init function.

void
watchdog_init(void)
{
  ti_lib_watchdog_stall_enable();
  ti_lib_watchdog_reload_set(CONTIKI_WATCHDOG_TIMER_TOP);
  lock_config(LOCK_REGISTERS_UNLOCKED);
}

5. Add option.cmd to command file

Open Project Property -> CCS Build -> ARM Compiler -> Advanced Options -> Command Files.

Then add /path/to/option.cmd.


6. Build project.

Finally, run build project.

Debugging with XDS seems work. But without XDS debug, firmware stop during booting contiki.

Firmware stops after showing "TI CC2650 SensorTag".

I think some compiler options or linker options are lacked.

Is there a any idea to figure out cause of problem?