contiki-os / contiki

The official git repository for Contiki, the open source OS for the Internet of Things
http://www.contiki-os.org/
Other
3.71k stars 2.58k forks source link

cc2530 cannot build hello world #2592

Open chopin1998 opened 5 years ago

chopin1998 commented 5 years ago

just git clone from git clone https://github.com/contiki-os/contiki

then build hello -> make TARGET=cc2530dk hello-world

but it show me:

~/tmp/build/contiki/examples/cc2530dk(master) » make TARGET=cc2530dk hello-world                                                                                                                                                                marco@thinkPad
mkdir obj_cc2530dk
cat     ../../platform/cc2530dk/./segment.rules      ../../cpu/cc253x/./segment.rules              | \
   sed -e 's/#.*$//' -e 's/^\s*//' -e '/^$/d' > obj_cc2530dk/segment.rules
  CC        ../../platform/cc2530dk/./contiki-main.c
../../platform/cc2530dk/./contiki-main.c:124: warning 94: comparison is always true due to limited range of data type
../../platform/cc2530dk/./contiki-main.c:153: warning 158: overflow in implicit constant conversion
../../platform/cc2530dk/./contiki-main.c:157: warning 217: Non-fatal Compiler Internal Problem in file 'SDCClrange.c' line number '1023' : Definition not found 
Contact Author with source code
  CC        ../../core/dev/leds.c
  CC        ../../platform/cc2530dk/dev/leds-arch.c
  CC        ../../core/lib/sensors.c
../../core/lib/sensors.c:135: warning 85: in function process_thread_sensors_process unreferenced function argument : 'data'
  CC        ../../platform/cc2530dk/dev/smartrf-sensors.c
  CC        ../../platform/cc2530dk/dev/button-sensor.c
  CC        ../../platform/cc2530dk/dev/adc-sensor.c
../../platform/cc2530dk/dev/adc-sensor.c:103: warning 85: in function status unreferenced function argument : 'type'
../../platform/cc2530dk/dev/adc-sensor.c:119: warning 85: in function configure unreferenced function argument : 'value'
  CC        ../../core/dev/serial-line.c
../../core/dev/serial-line.c:128: warning 85: in function process_thread_serial_line_process unreferenced function argument : 'data'
  CC        ../../platform/cc2530dk/dev/slip-arch.c
../../platform/cc2530dk/dev/slip-arch.c:47: warning 85: in function slip_arch_init unreferenced function argument : 'ubr'
  CC        ../../core/dev/slip.c
../../core/dev/slip.c:385: warning 85: in function process_thread_slip_process unreferenced function argument : 'data'
  CC        ../../platform/cc2530dk/./putchar.c
  CC        ../../platform/cc2530dk/./debug.c
  CC        ../../platform/cc2530dk/dev/usb-serial.c
../../platform/cc2530dk/dev/usb-serial.c:126: warning 85: in function usb_class_get_string_descriptor unreferenced function argument : 'lang'
../../platform/cc2530dk/dev/usb-serial.c:284: warning 85: in function process_thread_usb_serial_process unreferenced function argument : 'data'
  CC        ../../cpu/cc253x/./soc.c
  CC        ../../cpu/cc253x/dev/clock.c
  CC        ../../cpu/cc253x/./stack.c
  CC        ../../cpu/cc253x/dev/uart0.c
  CC        ../../cpu/cc253x/dev/uart1.c
  CC        ../../cpu/cc253x/dev/uart-intr.c
  CC        ../../cpu/cc253x/dev/dma.c
  CC        ../../cpu/cc253x/dev/dma_intr.c
  CC        ../../cpu/cc253x/dev/cc2530-rf.c
  CC        ../../cpu/cc253x/dev/watchdog.c
  CC        ../../cpu/cc253x/./rtimer-arch.c
/usr/bin/../share/sdcc/include/stdio.h:86: error 91: extern definition for 'putchar' mismatches with declaration.
../../platform/cc2530dk/./debug.h:49: error 177: previously defined here
make: *** [../../cpu/cc253x/Makefile.customrules-cc253x:17: obj_cc2530dk/rtimer-arch.rel] Error 1
------------------------------------------------------------

my sdcc version(apt install from debian source)

SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/TININative/ds400/hc08/s08/stm8 3.8.0 #10562 (Linux)
published under GNU General Public License (GPL)

chopin1998 commented 5 years ago

i modified contiki/platform/cc2530dk/putchar.c and contiki/platform/cc2530dk/debug.[ch]

change the type putchat from void to int, compiled ok..