Skip to content

Commit 738f521

Browse files
author
Seppo Takalo
committed
Add storage related files to baseline unittest.
* Refactor some headers to use relative path from Mbed OS root. * Refactor some data types to compile on 64bit machines. * Refactor some debug traces to use mbed_trace.
1 parent f3ce38e commit 738f521

File tree

27 files changed

+144
-109
lines changed

27 files changed

+144
-109
lines changed

UNITTESTS/empty_baseline/unittest.cmake

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,42 @@ set(unittest-includes ${unittest-includes}
1313

1414
set(unittest-sources
1515
../features/device_key/source/DeviceKey.cpp
16+
../components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp
17+
../components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp
18+
../components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.cpp
19+
../components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp
20+
../components/storage/blockdevice/COMPONENT_RSPIF/SPIFReducedBlockDevice.cpp
21+
../components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp
22+
../components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp
23+
../features/storage/filesystem/Dir.cpp
24+
../features/storage/filesystem/FileSystem.cpp
25+
../features/storage/filesystem/File.cpp
26+
../features/storage/kvstore/global_api/kvstore_global_api.cpp
27+
../features/storage/kvstore/securestore/SecureStore.cpp
28+
../features/storage/kvstore/kv_map/KVMap.cpp
29+
../features/storage/kvstore/tdbstore/TDBStore.cpp
30+
../features/storage/kvstore/direct_access_devicekey/DirectAccessDevicekey.cpp
31+
../features/storage/kvstore/conf/kv_config.cpp
32+
../features/storage/kvstore/filesystemstore/FileSystemStore.cpp
33+
../features/storage/system_storage/SystemStorage.cpp
34+
../features/storage/nvstore/source/nvstore.cpp
35+
../features/storage/blockdevice/ChainingBlockDevice.cpp
36+
../features/storage/blockdevice/ReadOnlyBlockDevice.cpp
37+
../features/storage/blockdevice/SlicingBlockDevice.cpp
38+
../features/storage/blockdevice/MBRBlockDevice.cpp
39+
../features/storage/blockdevice/HeapBlockDevice.cpp
40+
../features/storage/blockdevice/FlashSimBlockDevice.cpp
41+
../features/storage/blockdevice/ObservingBlockDevice.cpp
42+
../features/storage/blockdevice/ProfilingBlockDevice.cpp
43+
../features/storage/blockdevice/BufferedBlockDevice.cpp
44+
../features/storage/blockdevice/ExhaustibleBlockDevice.cpp
1645
)
1746

1847
set(unittest-test-sources
1948
empty_baseline/empty_baseline.cpp
2049
)
2150

22-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_PLATFORM_CTHUNK_COUNT_MAX=10 -DDEVICE_ANALOGIN -DDEVICE_ANALOGOUT -DDEVICE_CAN -DDEVICE_CRC -DDEVICE_ETHERNET -DDEVICE_FLASH -DDEVICE_I2C -DDEVICE_I2CSLAVE -DDEVICE_I2C_ASYNCH -DDEVICE_INTERRUPTIN -DDEVICE_LPTICKER -DDEVICE_PORTIN -DDEVICE_PORTINOUT -DDEVICE_PORTOUT -DDEVICE_PWMOUT -DDEVICE_QSPI -DDEVICE_SERIAL -DDEVICE_SERIAL_ASYNCH -DDEVICE_SERIAL_FC -DDEVICE_SPI -DDEVICE_SPISLAVE -DDEVICE_SPI_ASYNCH -DDEVICE_FLASH -DCOMPONENT_FLASHIAP")
23-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_PLATFORM_CTHUNK_COUNT_MAX=10 -DDEVICE_ANALOGIN -DDEVICE_ANALOGOUT -DDEVICE_CAN -DDEVICE_CRC -DDEVICE_ETHERNET -DDEVICE_FLASH -DDEVICE_I2C -DDEVICE_I2CSLAVE -DDEVICE_I2C_ASYNCH -DDEVICE_INTERRUPTIN -DDEVICE_LPTICKER -DDEVICE_PORTIN -DDEVICE_PORTINOUT -DDEVICE_PORTOUT -DDEVICE_PWMOUT -DDEVICE_QSPI -DDEVICE_SERIAL -DDEVICE_SERIAL_ASYNCH -DDEVICE_SERIAL_FC -DDEVICE_SPI -DDEVICE_SPISLAVE -DDEVICE_SPI_ASYNCH -DDEVICE_FLASH -DCOMPONENT_FLASHIAP")
51+
set(DEVICE_FLAGS "-DDEVICE_ANALOGIN -DDEVICE_ANALOGOUT -DDEVICE_CAN -DDEVICE_CRC -DDEVICE_ETHERNET -DDEVICE_FLASH -DDEVICE_I2C -DDEVICE_I2CSLAVE -DDEVICE_I2C_ASYNCH -DDEVICE_INTERRUPTIN -DDEVICE_LPTICKER -DDEVICE_PORTIN -DDEVICE_PORTINOUT -DDEVICE_PORTOUT -DDEVICE_PWMOUT -DDEVICE_QSPI -DDEVICE_SERIAL -DDEVICE_SERIAL_ASYNCH -DDEVICE_SERIAL_FC -DDEVICE_SPI -DDEVICE_SPISLAVE -DDEVICE_SPI_ASYNCH -DDEVICE_FLASH -DCOMPONENT_FLASHIAP")
52+
set(CONF_FLAGS "-DMBED_CONF_PLATFORM_CTHUNK_COUNT_MAX=10 -DMBED_CONF_DATAFLASH_SPI_FREQ=1 -DMBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS=0 -DMBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE=0 -DMBED_CONF_QSPIF_QSPI_FREQ=1 -DMBED_CONF_QSPIF_QSPI_MIN_READ_SIZE=1 -DMBED_CONF_QSPIF_QSPI_MIN_PROG_SIZE=1 -DMBED_LFS_READ_SIZE=64 -DMBED_LFS_PROG_SIZE=64 -DMBED_LFS_BLOCK_SIZE=512 -DMBED_LFS_LOOKAHEAD=512 -DFLASHIAP_APP_ROM_END_ADDR=0x80000 -DMBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE=1024 -DMBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS=0x80000 -DMBED_CONF_STORAGE_STORAGE_TYPE=default")
53+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DEVICE_FLAGS} ${CONF_FLAGS}")
54+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DEVICE_FLAGS} ${CONF_FLAGS}")

components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include "DataFlashBlockDevice.h"
1818
#include "mbed_atomic.h"
19-
19+
#include "rtos/ThisThread.h"
2020
#include <inttypes.h>
2121

2222
using namespace mbed;

components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
#ifndef MBED_DATAFLASH_BLOCK_DEVICE_H
1818
#define MBED_DATAFLASH_BLOCK_DEVICE_H
1919

20-
#include <mbed.h>
21-
#include "BlockDevice.h"
20+
#include "platform/PlatformMutex.h"
21+
#include "PinNames.h"
22+
#include "features/storage/blockdevice/BlockDevice.h"
23+
#include "drivers/SPI.h"
24+
#include "drivers/DigitalOut.h"
2225

2326

2427
/** BlockDevice for DataFlash flash devices

components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#if DEVICE_FLASH
2121

2222
#include "FlashIAP.h"
23-
#include "BlockDevice.h"
23+
#include "features/storage/blockdevice/BlockDevice.h"
2424
#include "platform/mbed_toolchain.h"
2525

2626
/** BlockDevice using the FlashIAP API

components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#ifndef MBED_I2CEEPROM_BLOCK_DEVICE_H
1717
#define MBED_I2CEEPROM_BLOCK_DEVICE_H
1818

19-
#include "BlockDevice.h"
20-
#include "I2C.h"
19+
#include "features/storage/blockdevice/BlockDevice.h"
20+
#include "drivers/I2C.h"
2121

2222
/** BlockDevice for I2C based flash device such as
2323
* Microchip's 24LC or ATMEL's AT24C ranges

components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#ifndef MBED_QSPIF_BLOCK_DEVICE_H
1717
#define MBED_QSPIF_BLOCK_DEVICE_H
1818

19-
#include "QSPI.h"
20-
#include "BlockDevice.h"
19+
#include "drivers/QSPI.h"
20+
#include "features/storage/blockdevice/BlockDevice.h"
2121

2222
/** Enum qspif standard error codes
2323
*

components/storage/blockdevice/COMPONENT_RSPIF/SPIFReducedBlockDevice.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#ifndef MBED_RSPIF_BLOCK_DEVICE_H
1717
#define MBED_RSPIF_BLOCK_DEVICE_H
1818

19-
#include "SPI.h"
20-
#include "DigitalOut.h"
21-
#include "BlockDevice.h"
19+
#include "drivers/SPI.h"
20+
#include "drivers/DigitalOut.h"
21+
#include "features/storage/blockdevice/BlockDevice.h"
2222

2323
/** Reduced BlockDevice for SPI based flash devices
2424
* *Should only be used by Boot Loader*

components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/* If the target has no SPI support, then SD Card is not supported. */
2121
#if DEVICE_SPI
2222

23-
#include "BlockDevice.h"
23+
#include "features/storage/blockdevice/BlockDevice.h"
2424
#include "drivers/SPI.h"
2525
#include "drivers/Timer.h"
2626
#include "drivers/MbedCRC.h"

components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <inttypes.h>
2323

2424
#include "mbed_trace.h"
25-
#include "mbed_debug.h"
2625
#define TRACE_GROUP "SPIF"
2726
using namespace mbed;
2827

@@ -158,7 +157,7 @@ int SPIFBlockDevice::init()
158157
status = SPIF_BD_ERROR_DEVICE_ERROR;
159158
goto exit_point;
160159
} else {
161-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: Initialize flash memory OK\n");
160+
tr_debug("Initialize flash memory OK\n");
162161
}
163162

164163
/* Read Manufacturer ID (1byte), and Device ID (2bytes)*/
@@ -207,7 +206,7 @@ int SPIFBlockDevice::init()
207206
_region_high_boundary[0] = _device_size_bytes - 1;
208207

209208
if ((sector_map_table_addr != 0) && (0 != sector_map_table_size)) {
210-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: init - Parsing Sector Map Table - addr: 0x%" PRIx32 "h, Size: %d", sector_map_table_addr,
209+
tr_debug("init - Parsing Sector Map Table - addr: 0x%" PRIx32 "h, Size: %d", sector_map_table_addr,
211210
sector_map_table_size);
212211
if (0 != _sfdp_parse_sector_map_table(sector_map_table_addr, sector_map_table_size)) {
213212
tr_error("init - Parse Sector Map Table Failed");
@@ -272,7 +271,7 @@ int SPIFBlockDevice::read(void *buffer, bd_addr_t addr, bd_size_t size)
272271
}
273272

274273
int status = SPIF_BD_ERROR_OK;
275-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG Read - Inst: 0x%xh", _read_instruction);
274+
tr_debug("Read - Inst: 0x%xh", _read_instruction);
276275
_mutex->lock();
277276

278277
// Set Dummy Cycles for Specific Read Command Mode
@@ -298,7 +297,7 @@ int SPIFBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t size)
298297
uint32_t offset = 0;
299298
uint32_t chunk = 0;
300299

301-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: program - Buff: 0x%" PRIx32 "h, addr: %llu, size: %llu", (uint32_t)buffer, addr, size);
300+
tr_debug("program - Buff: 0x%" PRIx32 "h, addr: %llu, size: %llu", (uint32_t)buffer, addr, size);
302301

303302
while (size > 0) {
304303

@@ -361,7 +360,7 @@ int SPIFBlockDevice::erase(bd_addr_t addr, bd_size_t in_size)
361360
// Erase Types of selected region
362361
uint8_t bitfield = _region_erase_types_bitfield[region];
363362

364-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: erase - addr: %llu, in_size: %llu", addr, in_size);
363+
tr_debug("erase - addr: %llu, in_size: %llu", addr, in_size);
365364

366365
if ((addr + in_size) > _device_size_bytes) {
367366
tr_error("erase exceeds flash device size");
@@ -383,9 +382,9 @@ int SPIFBlockDevice::erase(bd_addr_t addr, bd_size_t in_size)
383382
offset = addr % _erase_type_size_arr[type];
384383
chunk = ((offset + size) < _erase_type_size_arr[type]) ? size : (_erase_type_size_arr[type] - offset);
385384

386-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: erase - addr: %llu, size:%d, Inst: 0x%xh, chunk: %" PRIu32 " , ",
385+
tr_debug("erase - addr: %llu, size:%d, Inst: 0x%xh, chunk: %" PRIu32 " , ",
387386
addr, size, cur_erase_inst, chunk);
388-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: erase - Region: %d, Type:%d",
387+
tr_debug("erase - Region: %d, Type:%d",
389388
region, type);
390389

391390
_mutex->lock();
@@ -571,7 +570,7 @@ spif_bd_error SPIFBlockDevice::_spi_send_program_command(int prog_inst, const vo
571570

572571
spif_bd_error SPIFBlockDevice::_spi_send_erase_command(int erase_inst, bd_addr_t addr, bd_size_t size)
573572
{
574-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: Erase Inst: 0x%xh, addr: %llu, size: %llu", erase_inst, addr, size);
573+
tr_debug("Erase Inst: 0x%xh, addr: %llu, size: %llu", erase_inst, addr, size);
575574
addr = (((int)addr) & 0xFFFFF000);
576575
_spi_send_general_command(erase_inst, addr, NULL, 0, NULL, 0);
577576
return SPIF_BD_ERROR_OK;
@@ -745,12 +744,12 @@ int SPIFBlockDevice::_sfdp_parse_sfdp_headers(uint32_t &basic_table_addr, size_t
745744
tr_error("init - _verify SFDP signature and version Failed");
746745
return -1;
747746
} else {
748-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: init - verified SFDP Signature and version Successfully");
747+
tr_debug("init - verified SFDP Signature and version Successfully");
749748
}
750749

751750
// Discover Number of Parameter Headers
752751
int number_of_param_headers = (int)(sfdp_header[6]) + 1;
753-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: number of Param Headers: %d", number_of_param_headers);
752+
tr_debug("number of Param Headers: %d", number_of_param_headers);
754753

755754
addr += SPIF_SFDP_HEADER_SIZE;
756755
data_length = SPIF_PARAM_HEADER_SIZE;
@@ -773,14 +772,14 @@ int SPIFBlockDevice::_sfdp_parse_sfdp_headers(uint32_t &basic_table_addr, size_t
773772

774773
if ((param_header[0] == 0) && (param_header[7] == 0xFF)) {
775774
// Found Basic Params Table: LSB=0x00, MSB=0xFF
776-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: Found Basic Param Table at Table: %d", i_ind + 1);
775+
tr_debug("Found Basic Param Table at Table: %d", i_ind + 1);
777776
basic_table_addr = ((param_header[6] << 16) | (param_header[5] << 8) | (param_header[4]));
778777
// Supporting up to 64 Bytes Table (16 DWORDS)
779778
basic_table_size = ((param_header[3] * 4) < SFDP_DEFAULT_BASIC_PARAMS_TABLE_SIZE_BYTES) ? (param_header[3] * 4) : 64;
780779

781780
} else if ((param_header[0] == 81) && (param_header[7] == 0xFF)) {
782781
// Found Sector Map Table: LSB=0x81, MSB=0xFF
783-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: Found Sector Map Table at Table: %d", i_ind + 1);
782+
tr_debug("Found Sector Map Table at Table: %d", i_ind + 1);
784783
sector_map_table_addr = ((param_header[6] << 16) | (param_header[5] << 8) | (param_header[4]));
785784
sector_map_table_size = param_header[3] * 4;
786785

@@ -799,9 +798,9 @@ unsigned int SPIFBlockDevice::_sfdp_detect_page_size(uint8_t *basic_param_table_
799798
// Page Size is specified by 4 Bits (N), calculated by 2^N
800799
int page_to_power_size = ((int)basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_PAGE_SIZE_BYTE]) >> 4;
801800
page_size = local_math_power(2, page_to_power_size);
802-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: Detected Page Size: %d", page_size);
801+
tr_debug("Detected Page Size: %d", page_size);
803802
} else {
804-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: Using Default Page Size: %d", page_size);
803+
tr_debug("Using Default Page Size: %d", page_size);
805804
}
806805
return page_size;
807806
}
@@ -823,7 +822,7 @@ int SPIFBlockDevice::_sfdp_detect_erase_types_inst_and_size(uint8_t *basic_param
823822
erase_type_inst_arr[i_ind] = 0xff; //0xFF default for unsupported type
824823
erase_type_size_arr[i_ind] = local_math_power(2,
825824
basic_param_table_ptr[SPIF_BASIC_PARAM_ERASE_TYPE_1_SIZE_BYTE + 2 * i_ind]); // Size given as 2^N
826-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: Erase Type(A) %d - Inst: 0x%xh, Size: %d", (i_ind + 1), erase_type_inst_arr[i_ind],
825+
tr_debug("Erase Type(A) %d - Inst: 0x%xh, Size: %d", (i_ind + 1), erase_type_inst_arr[i_ind],
827826
erase_type_size_arr[i_ind]);
828827
if (erase_type_size_arr[i_ind] > 1) {
829828
// if size==1 type is not supported
@@ -846,7 +845,7 @@ int SPIFBlockDevice::_sfdp_detect_erase_types_inst_and_size(uint8_t *basic_param
846845
}
847846
_region_erase_types_bitfield[0] |= bitfield; // If there's no region map, set region "0" types bitfield as defualt;
848847
}
849-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "INFO: Erase Type %d - Inst: 0x%xh, Size: %d", (i_ind + 1),
848+
tr_info("Erase Type %d - Inst: 0x%xh, Size: %d", (i_ind + 1),
850849
erase_type_inst_arr[i_ind], erase_type_size_arr[i_ind]);
851850
bitfield = bitfield << 1;
852851
}
@@ -874,7 +873,7 @@ int SPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table_
874873
read_inst = basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_222_READ_INST_BYTE];
875874
_read_dummy_and_mode_cycles = (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_222_READ_INST_BYTE - 1] >> 5)
876875
+ (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_222_READ_INST_BYTE - 1] & 0x1F);
877-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "\nDEBUG: Read Bus Mode set to 2-2-2, Instruction: 0x%xh", read_inst);
876+
tr_debug("\nRead Bus Mode set to 2-2-2, Instruction: 0x%xh", read_inst);
878877
break;
879878
}
880879
}
@@ -884,20 +883,20 @@ int SPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table_
884883
read_inst = basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_122_READ_INST_BYTE];
885884
_read_dummy_and_mode_cycles = (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_122_READ_INST_BYTE - 1] >> 5)
886885
+ (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_122_READ_INST_BYTE - 1] & 0x1F);
887-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "\nDEBUG: Read Bus Mode set to 1-2-2, Instruction: 0x%xh", read_inst);
886+
tr_debug("\nRead Bus Mode set to 1-2-2, Instruction: 0x%xh", read_inst);
888887
break;
889888
}
890889
if (examined_byte & 0x01) {
891890
// Fast Read 1-1-2 Supported
892891
read_inst = basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_112_READ_INST_BYTE];
893892
_read_dummy_and_mode_cycles = (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_112_READ_INST_BYTE - 1] >> 5)
894893
+ (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_112_READ_INST_BYTE - 1] & 0x1F);
895-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "\nDEBUG: Read Bus Mode set to 1-1-2, Instruction: 0x%xh", _read_instruction);
894+
tr_debug("\nRead Bus Mode set to 1-1-2, Instruction: 0x%xh", _read_instruction);
896895
break;
897896
}
898897
*/
899898
_read_dummy_and_mode_cycles = 0;
900-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "\nDEBUG: Read Bus Mode set to 1-1-1, Instruction: 0x%xh", read_inst);
899+
tr_debug("Read Bus Mode set to 1-1-1, Instruction: 0x%xh", read_inst);
901900
} while (false);
902901

903902
return 0;
@@ -908,21 +907,21 @@ int SPIFBlockDevice::_reset_flash_mem()
908907
// Perform Soft Reset of the Device prior to initialization
909908
int status = 0;
910909
char status_value[2] = {0};
911-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "INFO: _reset_flash_mem:\n");
910+
tr_info("_reset_flash_mem:\n");
912911
//Read the Status Register from device
913912
if (SPIF_BD_ERROR_OK == _spi_send_general_command(SPIF_RDSR, SPI_NO_ADDRESS_COMMAND, NULL, 0, status_value, 1)) {
914913
// store received values in status_value
915-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: Reading Status Register Success: value = 0x%x\n", (int)status_value[0]);
914+
tr_debug("Reading Status Register Success: value = 0x%x\n", (int)status_value[0]);
916915
} else {
917-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "ERROR: Reading Status Register failed\n");
916+
tr_error("Reading Status Register failed\n");
918917
status = -1;
919918
}
920919

921920
if (0 == status) {
922921
//Send Reset Enable
923922
if (SPIF_BD_ERROR_OK == _spi_send_general_command(SPIF_RSTEN, SPI_NO_ADDRESS_COMMAND, NULL, 0, NULL, 0)) {
924923
// store received values in status_value
925-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: Sending RSTEN Success\n");
924+
tr_debug("Sending RSTEN Success\n");
926925
} else {
927926
tr_error("Sending RSTEN failed");
928927
status = -1;
@@ -932,7 +931,7 @@ int SPIFBlockDevice::_reset_flash_mem()
932931
//Send Reset
933932
if (SPIF_BD_ERROR_OK == _spi_send_general_command(SPIF_RST, SPI_NO_ADDRESS_COMMAND, NULL, 0, NULL, 0)) {
934933
// store received values in status_value
935-
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "DEBUG: Sending RST Success\n");
934+
tr_debug("Sending RST Success\n");
936935
} else {
937936
tr_error("Sending RST failed");
938937
status = -1;

components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
#define MBED_SPIF_BLOCK_DEVICE_H
1818

1919
#include "platform/SingletonPtr.h"
20-
#include "SPI.h"
21-
#include "DigitalOut.h"
22-
#include "BlockDevice.h"
20+
#include "drivers/SPI.h"
21+
#include "drivers/DigitalOut.h"
22+
#include "features/storage/blockdevice/BlockDevice.h"
2323

2424
/** Enum spif standard error codes
2525
*

features/storage/filesystem/Dir.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef DIR_H
1818
#define DIR_H
1919

20-
#include "filesystem/FileSystem.h"
20+
#include "features/storage/filesystem/FileSystem.h"
2121
#include "platform/DirHandle.h"
2222

2323
namespace mbed {

features/storage/filesystem/File.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef FILE_H
1818
#define FILE_H
1919

20-
#include "filesystem/FileSystem.h"
20+
#include "features/storage/filesystem/FileSystem.h"
2121
#include "platform/FileHandle.h"
2222

2323
namespace mbed {

features/storage/filesystem/FileSystem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "filesystem/Dir.h"
18-
#include "filesystem/File.h"
19-
#include "filesystem/FileSystem.h"
17+
#include "features/storage/filesystem/Dir.h"
18+
#include "features/storage/filesystem/File.h"
19+
#include "features/storage/filesystem/FileSystem.h"
2020
#include <errno.h>
2121

2222
namespace mbed {

features/storage/filesystem/fat/FATFileSystem.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
* SOFTWARE.
2121
*/
22-
#include "diskio.h"
23-
#include "ffconf.h"
22+
#include "features/storage/filesystem/fat/ChaN/diskio.h"
23+
#include "features/storage/filesystem/fat/ChaN/ffconf.h"
24+
#include "features/storage/filesystem/fat/ChaN/ff.h"
2425
#include "platform/mbed_debug.h"
2526
#include "platform/mbed_critical.h"
26-
#include "filesystem/mbed_filesystem.h"
27+
#include "features/storage/filesystem/mbed_filesystem.h"
2728
#include "FATFileSystem.h"
2829

2930
#include <errno.h>

0 commit comments

Comments
 (0)