Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

DoNotMerge BSP change to the new STM32 Cube Networking API #171

Open
wants to merge 10 commits into
base: development
Choose a base branch
from
4 changes: 2 additions & 2 deletions examples/stm32/WolfSSL/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-759066157078245430" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1591365011612468726" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand All @@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-759066157078245430" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1591365011612468726" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
2 changes: 1 addition & 1 deletion examples/stm32/WolfSSL/NUCLEO-F429ZI.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<targetDefinitions>
<board id="nucleo-f429zi">
<name>NUCLEO-F429ZI</name>
<dbgIF>SWD</dbgIF>
<dbgIF>JTAG</dbgIF>
<dbgIF>SWD</dbgIF>
<dbgDEV>ST-Link</dbgDEV>
<mcuId>stm32f429zitx</mcuId>
</board>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.667843212">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.667843212" moduleId="org.eclipse.cdt.core.settings" name="IKS01A2_Debug">
<macros>
<stringMacro name="XI_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/ddellabitta/dev/st/STM32Cube_FW_F4_V1.16.0"/>
<stringMacro name="XI_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/ddellabitta/Downloads/stm/jan2018/STM32Cube_FW_F4_V1.18.0"/>
<stringMacro name="XI_CLIENT_PATH" type="VALUE_PATH_DIR" value="../../../../../.."/>
<stringMacro name="XI_MEMS_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/ddellabitta/dev/st/STM32CubeExpansion_MEMS1_V4.0.0"/>
<stringMacro name="XI_MEMS_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/ddellabitta/Downloads/stm/jan2018/STM32CubeExpansion_MEMS1_V4.2.0"/>
</macros>
<externalSettings/>
<extensions>
Expand Down Expand Up @@ -118,9 +118,9 @@
<cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.667843212.1209297823">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.667843212.1209297823" moduleId="org.eclipse.cdt.core.settings" name="IKS01A1_Debug">
<macros>
<stringMacro name="XI_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/ddellabitta/dev/st/STM32Cube_FW_F4_V1.16.0"/>
<stringMacro name="XI_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/ddellabitta/Downloads/stm/jan2018/STM32Cube_FW_F4_V1.18.0"/>
<stringMacro name="XI_CLIENT_PATH" type="VALUE_PATH_DIR" value="../../../../../.."/>
<stringMacro name="XI_MEMS_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/ddellabitta/dev/st/STM32CubeExpansion_MEMS1_V4.0.0"/>
<stringMacro name="XI_MEMS_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/ddellabitta/Downloads/stm/jan2018/STM32CubeExpansion_MEMS1_V4.2.0"/>
</macros>
<externalSettings/>
<extensions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -930,11 +930,11 @@
<variableList>
<variable>
<name>XI_STMCUBE_MEMS_PATH</name>
<value>file:/Users/ddellabitta/dev/st/STM32CubeExpansion_MEMS1_V4.0.0</value>
<value>file:/Users/ddellabitta/Downloads/stm/jan2018/STM32CubeExpansion_MEMS1_V4.2.0</value>
</variable>
<variable>
<name>XI_STMCUBE_PATH</name>
<value>file:/Users/ddellabitta/dev/st/STM32Cube_FW_F4_V1.16.0</value>
<value>file:/Users/ddellabitta/Downloads/stm/jan2018/STM32Cube_FW_F4_V1.18.0</value>
</variable>
</variableList>
</projectDescription>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-759066157078245430" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1591365011612468726" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand All @@ -18,7 +18,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-759066157078245430" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1591365011612468726" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<targetDefinitions>
<board id="nucleo-f429zi">
<name>NUCLEO-F429ZI</name>
<dbgIF>SWD</dbgIF>
<dbgIF>JTAG</dbgIF>
<dbgIF>SWD</dbgIF>
<dbgDEV>ST-Link</dbgDEV>
<mcuId>stm32f429zitx</mcuId>
</board>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1474710539">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1474710539" moduleId="org.eclipse.cdt.core.settings" name="IKS01A1_Debug">
<macros>
<stringMacro name="XI_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/palantir/Work/Xively/stm32f4xx/STM32CubeExpansion_WIFI1_V3.0.1"/>
<stringMacro name="XI_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/ddellabitta/Downloads/stm/jan2018/STM32CubeExpansion_WIFI1_V3.1.1"/>
<stringMacro name="XI_CLIENT_PATH" type="VALUE_PATH_DIR" value="../../../../../../.."/>
<stringMacro name="XI_MEMS_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/palantir/Work/Xively/stm32f4xx/STM32CubeExpansion_MEMS1_V4.0.0"/>
<stringMacro name="XI_MEMS_STMCUBE_PATH" type="VALUE_PATH_DIR" value="/Users/ddellabitta/Downloads/stm/jan2018/STM32CubeExpansion_MEMS1_V4.2.0"/>
</macros>
<externalSettings>
<externalSetting/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,11 @@
<variableList>
<variable>
<name>XI_STMCUBE_MEMS_PATH</name>
<value>file:/Users/palantir/Work/Xively/stm32f4xx/STM32CubeExpansion_MEMS1_V4.0.0</value>
<value>file:/Users/ddellabitta/Downloads/stm/jan2018/STM32CubeExpansion_MEMS1_V4.2.0</value>
</variable>
<variable>
<name>XI_STMCUBE_PATH</name>
<value>file:/Users/palantir/Work/Xively/stm32f4xx/STM32CubeExpansion_WIFI1_V3.0.1</value>
<value>file:/Users/ddellabitta/Downloads/stm/jan2018/STM32CubeExpansion_WIFI1_V3.1.1</value>
</variable>
</variableList>
</projectDescription>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="189434517618512245" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1591365011612468726" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand All @@ -18,7 +18,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="189434517618512245" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1591365011612468726" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE targetDefinitions [
<!ELEMENT targetDefinitions (board)>
<!ELEMENT board (name, dbgIF+, dbgDEV, mcuId)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT dbgIF (#PCDATA)>
<!ELEMENT dbgDEV (#PCDATA)>
<!ELEMENT mcuId (#PCDATA)>
<!ATTLIST board id CDATA #REQUIRED>
]>

<targetDefinitions>
<board id="nucleo-f401re">
<name>NUCLEO-F401RE</name>
<dbgIF>JTAG</dbgIF>
<dbgIF>SWD</dbgIF>
<dbgDEV>ST-Link</dbgDEV>
<mcuId>stm32f401retx</mcuId>
</board>
</targetDefinitions>
12 changes: 8 additions & 4 deletions examples/stm32/xively_demo_stm32f4xx_nucleo_wifi/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,21 +806,25 @@ ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
#endif

/******** Wi-Fi Indication User Callback *********/

void ind_wifi_socket_data_received( int8_t server_id,
int8_t socket_id,
uint8_t* data_ptr,
uint32_t message_size,
uint32_t chunk_size )
uint32_t chunk_size,
WiFi_Socket_t socket_type )
{
( void )server_id; /* Unused */
( void )server_id; /* Unused */
( void )socket_type; /* Unused */

/* Xively */
xi_bsp_io_net_socket_data_received_proxy( ( uint8_t )socket_id, data_ptr,
message_size, chunk_size );
}

void ind_wifi_socket_client_remote_server_closed( uint8_t* socket_closed_id )
void ind_wifi_socket_client_remote_server_closed( uint8_t* socket_closed_id, WiFi_Socket_t socket_type )
{
( void )socket_type; /* Unused */

/* Xively */
xi_bsp_io_net_socket_client_remote_server_closed_proxy( socket_closed_id );
}
Expand Down
2 changes: 1 addition & 1 deletion make/mt-config/mt-config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ifneq (,$(findstring fuzz_test,$(CONFIG)))
XI_CONFIG_FLAGS += -fsanitize=address -fomit-frame-pointer -fsanitize-coverage=trace-pc-guard -g
endif

XI_COMPILER_FLAGS += -Wall -Werror
XI_COMPILER_FLAGS += -Wall

# TEMPORARILY disable warnings until the code gets changed
# For all compilers:
Expand Down
4 changes: 2 additions & 2 deletions make/mt-config/mt-presets.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ CONFIG_CC3220SF =memory_fs-control_topic-tls_bsp-secure_file_transfer
CONFIG_CC3220SF_TLS_SOCKET =memory_fs-control_topic-tls_socket-secure_file_transfer

# CONFIG for STM32
CONFIG_STM32FX =memory_fs-control_topic-tls_bsp-secure_file_transfer
CONFIG_STM32FX_NUCLEO_WIFI =memory_fs-control_topic-tls_socket-secure_file_transfer
CONFIG_STM32FX =memory_fs-control_topic-tls_bsp
CONFIG_STM32FX_NUCLEO_WIFI =memory_fs-control_topic-tls_socket

# xtensa configs
CONFIG_ESP32 =memory_fs-control_topic-tls_bsp-secure_file_transfer
Expand Down
4 changes: 3 additions & 1 deletion make/mt-os/mt-stm32fx.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
include make/mt-os/mt-os-common.mk
include make/mt-utils/mt-get-gnu-arm-toolchain.mk

XI_STM32_PATH_SDK = $(HOME)/Downloads/xively-client-artifactory/st/STM32Cube_FW_F4_V1.16.0
XI_STM32_PATH_SDK ?= $(HOME)/Downloads/xively-client-artifactory/st/STM32Cube_FW_F4_V1.16.0

$(info . CC: [$(CC)] )
$(info . AR: [$(AR)] )
$(info . XI_STM32_PATH_SDK: [$(XI_STM32_PATH_SDK)] )

#####################
Expand Down
6 changes: 5 additions & 1 deletion make/mt-os/mt-stm32fx_nucleo_wifi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
include make/mt-os/mt-os-common.mk
include make/mt-utils/mt-get-gnu-arm-toolchain.mk

XI_STM32_PATH_SDK = $(HOME)/Downloads/xively-client-artifactory/st/STM32CubeExpansion_WIFI1_V3.0.2
XI_STM32_PATH_SDK ?= $(HOME)/Downloads/xively-client-artifactory/st/STM32CubeExpansion_WIFI1_V3.0.2

$(info . CC: [$(CC)] )
$(info . AR: [$(AR)] )
$(info . XI_STM32_PATH_SDK: [$(XI_STM32_PATH_SDK)] )

# This BSP folder MUST be included before the SDK's X-NUCLEO-IDW0xx1/.
# More info available in src/bsp/platform/stm32fx_nucleo_wifi/stm32_spwf_wifi.h
Expand Down
14 changes: 10 additions & 4 deletions make/mt-utils/mt-get-gnu-arm-toolchain.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ifeq ($(XI_HOST_PLATFORM),Linux)
# linux cross-compilation assumes tools downloaded and are on PATH

XI_GCC_ARM_NONE_EABI_DOWNLOAD_FILE = ~/Downloads/gcc-arm-none-eabi-5_4-2016q2-20160622-linux.tar.bz2
XI_GCC_ARM_NONE_EABI_PATH = ~/Downloads/gcc-arm-none-eabi-5_4-2016q2
XI_GCC_ARM_NONE_EABI_PATH ?= ~/Downloads/gcc-arm-none-eabi-5_4-2016q2

CC = $(XI_GCC_ARM_NONE_EABI_PATH)/bin/arm-none-eabi-gcc
AR = $(XI_GCC_ARM_NONE_EABI_PATH)/bin/arm-none-eabi-ar
Expand All @@ -17,7 +17,7 @@ else ifeq ($(XI_HOST_PLATFORM),Darwin)
# osx cross-compilation downloads arm-gcc

XI_GCC_ARM_NONE_EABI_DOWNLOAD_FILE = ~/Downloads/gcc-arm-none-eabi-5_4-2016q2-20160622-mac.tar.bz2
XI_GCC_ARM_NONE_EABI_PATH = ~/Downloads/gcc-arm-none-eabi-5_4-2016q2
XI_GCC_ARM_NONE_EABI_PATH ?= ~/Downloads/gcc-arm-none-eabi-5_4-2016q2

CC = $(XI_GCC_ARM_NONE_EABI_PATH)/bin/arm-none-eabi-gcc
AR = $(XI_GCC_ARM_NONE_EABI_PATH)/bin/arm-none-eabi-ar
Expand All @@ -27,8 +27,14 @@ else ifeq ($(XI_HOST_PLATFORM),Darwin)
XI_BUILD_PRECONDITIONS := $(CC)

else ifeq ($(XI_HOST_PLATFORM),Windows_NT)
CC = arm-none-eabi-gcc
AR = arm-none-eabi-ar
# assume the toolchain is already on the path if the XI_GCC_ARM_NONE_EABI_PATH variable is not defined.
ifndef XI_GCC_ARM_NONE_EABI_PATH
CC = arm-none-eabi-gcc
AR = arm-none-eabi-ar
else
CC = $(XI_GCC_ARM_NONE_EABI_PATH)/arm-none-eabi-gcc
AR = $(XI_GCC_ARM_NONE_EABI_PATH)/arm-none-eabi-ar
endif
endif

$(XI_GCC_ARM_NONE_EABI_DOWNLOAD_FILE):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,33 @@ static xi_bsp_io_net_state_t xi_bsp_io_net_configure_tls( const char* host )
{
WiFi_Status_t status = WiFi_MODULE_SUCCESS;
posix_time_t current_datetime = xi_bsp_time_sntp_getseconds_posix();
const uint8_t* tls_mode = ( uint8_t* )"o"; /* ["m"utual || "o"ne-way] */
const char* tls_cert = GLOBALSIGN_ROOT_CERT;
//const uint8_t* tls_mode = ( uint8_t* )"o"; /* ["m"utual || "o"ne-way] */
//const char* tls_cert = GLOBALSIGN_ROOT_CERT;

xi_bsp_debug_format( "Trusted Root CA Certificate:\r\n%s", tls_cert );
status = wifi_socket_client_security( ( uint8_t* )tls_mode, ( uint8_t* )tls_cert,
TLS_Certificate stm_cube_tls_certificate;
stm_cube_tls_certificate.certificate = ( uint8_t* )GLOBALSIGN_ROOT_CERT;
stm_cube_tls_certificate.certificate_size = sizeof(GLOBALSIGN_ROOT_CERT);

TLS_Certificate stm_cube_empty_certificate;
memset( &stm_cube_empty_certificate, 0, sizeof( TLS_Certificate) );

TLS_Certificate stm_cube_client_domain;
stm_cube_client_domain.certificate = ( uint8_t* )host;
stm_cube_client_domain.certificate_size = strlen( host );
memset( &stm_cube_empty_certificate, 0, sizeof( TLS_Certificate) );



//wifi_socket_client_security(uint8_t* tls_mode, uint8_t* root_ca_server, uint8_t* client_cert, uint8_t* client_key, uint8_t* client_domain, uint32_t tls_epoch_time):
/*status = wifi_socket_client_security( ( uint8_t* )tls_mode, ( uint8_t* )tls_cert,
NULL, NULL, ( uint8_t* )host,
( uint32_t )current_datetime );
( uint32_t )current_datetime );*/

status = wifi_set_socket_certificates( stm_cube_empty_certificate, /* ca_certificate */
stm_cube_tls_certificate, /* tls_certificate */
stm_cube_empty_certificate, /* certficate_key */
stm_cube_client_domain, /* client_domain */
( uint32_t )current_datetime );

if ( WiFi_MODULE_SUCCESS != status )
{
Expand Down
9 changes: 8 additions & 1 deletion src/libxively/io/fs/memory/xi_fs_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ xi_state_t xi_fs_read( const void* context,
{
XI_UNUSED( context );

#ifdef XI_NO_TLS_LAYER
/* DDB Jan 23, 2018:
NO TLS LAYER, the resources array is empty. Attempting to resolve an element init
XI_FS_MEMORY_DATABASE below was causing an issue on STM32's GCC toolchain. */
return XI_INVALID_PARAMETER;
#else
const size_t database_size = XI_ARRAYSIZE( XI_FS_MEMORY_DATABASE );

if ( XI_FS_INVALID_RESOURCE_HANDLE == resource_handle ||
Expand Down Expand Up @@ -238,7 +244,7 @@ xi_state_t xi_fs_read( const void* context,

const xi_fs_memory_database_t* const entry = &XI_FS_MEMORY_DATABASE[resource_handle];

// PRE-CONDITION
/* PRE-CONDITION */
assert( NULL != entry->stat_handler_function );

xi_state_t res = entry->stat_handler_function( resource_handle, &resource_stat );
Expand All @@ -259,6 +265,7 @@ xi_state_t xi_fs_read( const void* context,
}

return res;
#endif /* ifndef XI_NO_TLS_LAYER */
}

xi_state_t xi_fs_write( const void* context,
Expand Down