Resources in External Filesystem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
WeWh_3706036
Level 1
Level 1
First like received

I am trying to add resources to the external filesystem (filesystem.bin) and I have configured the makefile per this example: Keep web content (.html, .js) on external flash in a filesystem .

The WIFI firmware  is contained within the Filesystem.bin and the resource files correctly show "RESOURCES_IN_FILESYSTEM".  However I cannot get the resources in the application to be part of the filesystem.  I am using the snip/resource read and I have tried  using :

LOCATION_CONFIGURABLE_RESOURCES += apps/resource_read/test_file01.txt

Additionally Platform_config.h contains:

/*  WICED Resources uses a filesystem */

#define USES_RESOURCE_FILESYSTEM

/* Location on SPI Flash where filesystem starts */

#define FILESYSTEM_BASE_ADDR  ( 0 )

My current Makefile is:

#

# Copyright 2018, Cypress Semiconductor Corporation or a subsidiary of

# Cypress Semiconductor Corporation. All Rights Reserved.

# This software, including source code, documentation and related

# materials ("Software"), is owned by Cypress Semiconductor Corporation

# or one of its subsidiaries ("Cypress") and is protected by and subject to

# worldwide patent protection (United States and foreign),

# United States copyright laws and international treaty provisions.

# Therefore, you may use this Software only as provided in the license

# agreement accompanying the software package from which you

# obtained this Software ("EULA").

# If no EULA applies, Cypress hereby grants you a personal, non-exclusive,

# non-transferable license to copy, modify, and compile the Software

# source code solely for use in connection with Cypress's

# integrated circuit products. Any reproduction, modification, translation,

# compilation, or representation of this Software except as specified

# above is prohibited without the express written permission of Cypress.

#

# Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND,

# EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED

# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress

# reserves the right to make changes to the Software without notice. Cypress

# does not assume any liability arising out of the application or use of the

# Software or any product or circuit described in the Software. Cypress does

# not authorize its products for use in any products where a malfunction or

# failure of the Cypress product may reasonably be expected to result in

# significant property damage, injury or death ("High Risk Product"). By

# including Cypress's product in a High Risk Product, the manufacturer

# of such system or application assumes all risk of such use and in doing

# so agrees to indemnify Cypress against all liability.

#

NAME := Platform_XXXXX_rev1

#Name  := Platform_CYW94343WWCD1_EVB

WLAN_CHIP            := 4343W

WLAN_CHIP_REVISION   := A1

WLAN_CHIP_FAMILY     := 4343x

HOST_MCU_FAMILY      := STM32L4xx

HOST_MCU_VARIANT     := STM32L476

HOST_MCU_PART_NUMBER := STM32L476VGT6

BT_CHIP          := 43438

BT_CHIP_REVISION := A1

BT_CHIP_XTAL_FREQUENCY := 37_4MHz

PLATFORM_SUPPORTS_BUTTONS := 1

ifndef BUS

BUS := SDIO

endif

VALID_BUSES := SDIO

# WIFI_FIRMWARE and WIFI_FIRMWARE_CLM_BLOB are now included into resources

# RESOURCES_LOCATION default to RESOURCES_IN_WICEDFS. But can be optionally config to RESOURCES_IN_DIRECT_RESOURCES

# WARNING: Config RESOURCES_LOCATION to RESOURCES_IN_DIRECT_RESOURCES will build firmware and blob to into main application

# and may cause internal flash to overflow

RESOURCES_LOCATION := RESOURCES_IN_WICEDFS

#EXTERNAL_MEMORY_RESOURCES = $(ALL_RESOURCES)

#ifeq ($(RESOURCES_LOCATION), RESOURCES_IN_DIRECT_RESOURCES)

#INTERNAL_MEMORY_RESOURCES = $(ALL_RESOURCES)

#GLOBAL_DEFINES += WWD_DIRECT_RESOURCES

#endif

GLOBAL_DEFINES += USE_ALT_FREERTOS

GLOBAL_DEFINES += USE_SABER

GLOBAL_DEFINES += BOOTLOADER_APP_LUT_NO_SECURE_FLAG

# Global includes

GLOBAL_INCLUDES  := .

GLOBAL_INCLUDES  += $(SOURCE_ROOT)libraries/inputs/gpio_button

# GLOBAL_INCLUDES  += $(SOURCE_ROOT)wiced/platform/MCU/STM32L4xx/peripherals/CMSIS/Device/ST/STM32L4xx/include

# Global defines

# HSE_VALUE = STM32 crystal frequency = 26MHz (needed to make UART work correctly)

#GLOBAL_DEFINES += HSE_VALUE=26000000

GLOBAL_DEFINES += $$(if $$(NO_CRLF_STDIO_REPLACEMENT),,CRLF_STDIO_REPLACEMENT)

GLOBAL_DEFINES += WICED_DCT_INCLUDE_BT_CONFIG

GLOBAL_DEFINES += WICED_DISABLE_MCU_POWERSAVE

GLOBAL_DEFINES += WICED_ENABLE_MCU_RTC

WIFI_IMAGE_DOWNLOAD := buffered

# Source files

$(NAME)_SOURCES := platform.c \

                   gpio.c \

                   adc.c \

                   tim.c

$(NAME)_COMPONENTS +=  inputs/gpio_button

$(NAME)_COMPONENTS += filesystems/wicedfs

                    

JLINK_NATIVE := 1

# WICED APPS

# APP0 and FILESYSTEM_IMAGE are reserved main app and resources file system

# FR_APP := resources/sflash/snip_ota_fr-BCM943362WCD6.stripped.elf

# DCT_IMAGE :=

# OTA_APP :=

FILESYSTEM_IMAGE := $(OUTPUT_DIR)/filesystem.bin

# WIFI_FIRMWARE :=

# APP0 :=

# APP1 :=

# APP2 :=

# WICED APPS LOOKUP TABLE

APPS_LUT_HEADER_LOC := 0x0000

APPS_START_SECTOR := 1

ifneq ($(APP),bootloader)

ifneq ($(MAIN_COMPONENT_PROCESSING),1)

$(info +-----------------------------------------------------------------------------------------------------+ )

$(info | IMPORTANT NOTES                                                                                     | )

$(info +-----------------------------------------------------------------------------------------------------+ )

$(info | Wi-Fi MAC Address                                                                                   | )

$(info |    The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 | )

$(info |    Ensure each target device has a unique address.                                                  | )

$(info +-----------------------------------------------------------------------------------------------------+ )

$(info | MCU & Wi-Fi Power Save                                                                              | )

$(info |    It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz | )

$(info |    reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   | )

$(info |    Application Note located in the documentation directory if you plan to use powersave features.   | )

$(info +-----------------------------------------------------------------------------------------------------+ )

endif

endif

0 Likes
1 Solution
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

Hello:

I think we already put the resource files into filesystem.bin

echo ./tools/common/Win32/mk_wicedfs32 build/snip.resource_read-CYW943907AEVAL1F/filesystem.bin build/snip.resource_read-CYW943907AEVAL1F/resources/Staging/

./tools/common/Win32/mk_wicedfs32 build/snip.resource_read-CYW943907AEVAL1F/filesystem.bin build/snip.resource_read-CYW943907AEVAL1F/resources/Staging/

./tools/common/Win32/mk_wicedfs32 build/snip.resource_read-CYW943907AEVAL1F/filesystem.bin build/snip.resource_read-CYW943907AEVAL1F/resources/Staging/

below is the image:

pastedImage_0.png

View solution in original post

1 Reply
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

Hello:

I think we already put the resource files into filesystem.bin

echo ./tools/common/Win32/mk_wicedfs32 build/snip.resource_read-CYW943907AEVAL1F/filesystem.bin build/snip.resource_read-CYW943907AEVAL1F/resources/Staging/

./tools/common/Win32/mk_wicedfs32 build/snip.resource_read-CYW943907AEVAL1F/filesystem.bin build/snip.resource_read-CYW943907AEVAL1F/resources/Staging/

./tools/common/Win32/mk_wicedfs32 build/snip.resource_read-CYW943907AEVAL1F/filesystem.bin build/snip.resource_read-CYW943907AEVAL1F/resources/Staging/

below is the image:

pastedImage_0.png