Incorrect order of WiFi and SPI libraries was causing linker
to generate output binary which Arduino Due MCU was unable to load.
Change-Id: I3e5aa19d531ed8d754dad7d4fd53848a6a4d1f68
Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/673
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sanjay Sharma <sanjay1.sharma@intel.com>
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
lib_src.extend(__search_files(lib_path, '*.c'))
lib_src.extend(__search_files(lib_path, '*.cpp'))
lib_src.extend(__search_files(lib_path, '*.c'))
lib_src.extend(__search_files(lib_path, '*.cpp'))
+ lib_obj = __src_to_obj(env, lib_src)
build_dir = env.get('BUILD_DIR')
if build_dir:
build_dir = env.get('BUILD_DIR')
if build_dir:
- lib_a = env.StaticLibrary(build_dir + lib, __src_to_obj(env, lib_src))
+ lib_a = env.StaticLibrary(build_dir + lib, lib_obj)
- lib_a = env.StaticLibrary(lib, __src_to_obj(env, lib_src))
- env.AppendUnique(LIBS = [File(lib_a[0])])
+ lib_a = env.StaticLibrary(lib, lib_obj)
+
+ # If we link libSPI.a, the final binary is not getting launched
+ # on the board. Which is not the case if we directly use SPI.o.
+
+ if env.get('TARGET_ARCH') == 'arm':
+ if lib == 'SPI':
+ for obj in lib_obj:
+ if obj.name.endswith('SPI.o'):
+ env.PrependUnique(LIBS = [File(obj)])
+ else:
+ env.AppendUnique(LIBS = [File(lib_a[0])])
+ else:
+ env.PrependUnique(LIBS = [File(lib_a[0])])
+
+ #env.AppendUnique(LIBS = [File(lib_a[0])])
def __build_core(env):
core_src = __search_files(core_folder, '*.S')
def __build_core(env):
core_src = __search_files(core_folder, '*.S')
env.AppendUnique(LIBS = 'm')
env.Replace(ARCOM = '$AR ' + platform_info.get('compiler.ar.flags') + ' $TARGET $SOURCES')
env.AppendUnique(LIBS = 'm')
env.Replace(ARCOM = '$AR ' + platform_info.get('compiler.ar.flags') + ' $TARGET $SOURCES')
__build_core(env)
env.AddMethod(__import_lib, "ImportLib") #import arduino library
__build_core(env)
env.AddMethod(__import_lib, "ImportLib") #import arduino library
arduino_simplecs_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
arduino_simplecs_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
arduino_simplecs_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
arduino_simplecs_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
-if 'ETHERNET' in env.get('TARGET_TRANSPORT'):
- transportLib = 'Ethernet'
-if 'WIFI' in env.get('TARGET_TRANSPORT'):
- transportLib = 'WiFi'
-
-arduino_simplecs_env.PrependUnique(LIBS = ['octbstack', 'connectivity_abstraction','coap',transportLib])
+arduino_simplecs_env.PrependUnique(LIBS = ['octbstack', 'connectivity_abstraction','coap'])
arduino_simplecs = arduino_simplecs_env.Program('SimpleClientServer', 'ocserver.cpp')
env.CreateBin('SimpleClientServer')
arduino_simplecs = arduino_simplecs_env.Program('SimpleClientServer', 'ocserver.cpp')
env.CreateBin('SimpleClientServer')
// Note : Arduino WiFi Shield currently does NOT support multicast and therefore
// this server will NOT be listening on 224.0.1.187 multicast address.
// Note : Arduino WiFi Shield currently does NOT support multicast and therefore
// this server will NOT be listening on 224.0.1.187 multicast address.
+static const char ARDUINO_WIFI_SHIELD_UDP_FW_VER[] = "1.1.0";
+
/// WiFi Shield firmware with Intel patches
static const char INTEL_WIFI_SHIELD_FW_VER[] = "1.2.0";
/// WiFi Shield firmware with Intel patches
static const char INTEL_WIFI_SHIELD_FW_VER[] = "1.2.0";
// Verify that WiFi Shield is running the firmware with all UDP fixes
fwVersion = WiFi.firmwareVersion();
OC_LOG_V(INFO, TAG, "WiFi Shield Firmware version %s", fwVersion);
// Verify that WiFi Shield is running the firmware with all UDP fixes
fwVersion = WiFi.firmwareVersion();
OC_LOG_V(INFO, TAG, "WiFi Shield Firmware version %s", fwVersion);
- if ( strncmp(fwVersion, INTEL_WIFI_SHIELD_FW_VER, sizeof(INTEL_WIFI_SHIELD_FW_VER)) !=0 )
+ if ( strncmp(fwVersion, ARDUINO_WIFI_SHIELD_UDP_FW_VER, sizeof(ARDUINO_WIFI_SHIELD_UDP_FW_VER)) !=0 )
{
OC_LOG(DEBUG, TAG, PCF("!!!!! Upgrade WiFi Shield Firmware version !!!!!!"));
return -1;
{
OC_LOG(DEBUG, TAG, PCF("!!!!! Upgrade WiFi Shield Firmware version !!!!!!"));
return -1;