@@ -117,7 +117,7 @@ SPIFBlockDevice::SPIFBlockDevice(
117
117
_region_erase_types_bitfield[0 ] = ERASE_BITMASK_NONE;
118
118
119
119
if (SPIF_BD_ERROR_OK != _spi_set_frequency (freq)) {
120
- tr_error (" ERROR: SPI Set Frequency Failed" );
120
+ tr_error (" SPI Set Frequency Failed" );
121
121
}
122
122
123
123
_cs = 1 ;
@@ -148,7 +148,7 @@ int SPIFBlockDevice::init()
148
148
149
149
// Soft Reset
150
150
if (-1 == _reset_flash_mem ()) {
151
- tr_error (" ERROR: init - Unable to initialize flash memory, tests failed\n " );
151
+ tr_error (" init - Unable to initialize flash memory, tests failed" );
152
152
status = SPIF_BD_ERROR_DEVICE_ERROR;
153
153
goto exit_point;
154
154
}
@@ -157,7 +157,7 @@ int SPIFBlockDevice::init()
157
157
spi_status = _spi_send_general_command (SPIF_RDID, SPI_NO_ADDRESS_COMMAND, NULL , 0 , (char *)vendor_device_ids,
158
158
data_length);
159
159
if (spi_status != SPIF_BD_ERROR_OK) {
160
- tr_error (" ERROR: init - Read Vendor ID Failed" );
160
+ tr_error (" init - Read Vendor ID Failed" );
161
161
status = SPIF_BD_ERROR_DEVICE_ERROR;
162
162
goto exit_point;
163
163
}
@@ -173,22 +173,22 @@ int SPIFBlockDevice::init()
173
173
174
174
// Synchronize Device
175
175
if (false == _is_mem_ready ()) {
176
- tr_error (" ERROR: init - _is_mem_ready Failed" );
176
+ tr_error (" init - _is_mem_ready Failed" );
177
177
status = SPIF_BD_ERROR_READY_FAILED;
178
178
goto exit_point;
179
179
}
180
180
181
181
/* *************************** Parse SFDP Header ***********************************/
182
182
if (0 != _sfdp_parse_sfdp_headers (basic_table_addr, basic_table_size, sector_map_table_addr, sector_map_table_size)) {
183
- tr_error (" ERROR: init - Parse SFDP Headers Failed" );
183
+ tr_error (" init - Parse SFDP Headers Failed" );
184
184
status = SPIF_BD_ERROR_PARSING_FAILED;
185
185
goto exit_point;
186
186
}
187
187
188
188
189
189
/* *************************** Parse Basic Parameters Table ***********************************/
190
190
if (0 != _sfdp_parse_basic_param_table (basic_table_addr, basic_table_size)) {
191
- tr_error (" ERROR: init - Parse Basic Param Table Failed" );
191
+ tr_error (" init - Parse Basic Param Table Failed" );
192
192
status = SPIF_BD_ERROR_PARSING_FAILED;
193
193
goto exit_point;
194
194
}
@@ -200,7 +200,7 @@ int SPIFBlockDevice::init()
200
200
201
201
if ((sector_map_table_addr != 0 ) && (0 != sector_map_table_size)) {
202
202
if (0 != _sfdp_parse_sector_map_table (sector_map_table_addr, sector_map_table_size)) {
203
- tr_error (" ERROR: init - Parse Sector Map Table Failed" );
203
+ tr_error (" init - Parse Sector Map Table Failed" );
204
204
status = SPIF_BD_ERROR_PARSING_FAILED;
205
205
goto exit_point;
206
206
}
@@ -238,7 +238,7 @@ int SPIFBlockDevice::deinit()
238
238
// Disable Device for Writing
239
239
status = _spi_send_general_command (SPIF_WRDI, SPI_NO_ADDRESS_COMMAND, NULL , 0 , NULL , 0 );
240
240
if (status != SPIF_BD_ERROR_OK) {
241
- tr_error (" ERROR: Write Disable failed" );
241
+ tr_error (" Write Disable failed" );
242
242
}
243
243
_is_initialized = false ;
244
244
@@ -290,7 +290,7 @@ int SPIFBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t size)
290
290
291
291
// Send WREN
292
292
if (_set_write_enable () != 0 ) {
293
- tr_error (" ERROR: Write Enabe failed\n " );
293
+ tr_error (" Write Enabe failed" );
294
294
program_failed = true ;
295
295
status = SPIF_BD_ERROR_WREN_FAILED;
296
296
goto exit_point;
@@ -303,7 +303,7 @@ int SPIFBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t size)
303
303
size -= chunk;
304
304
305
305
if (false == _is_mem_ready ()) {
306
- tr_error (" ERROR: Device not ready after write, failed\n " );
306
+ tr_error (" Device not ready after write, failed" );
307
307
program_failed = true ;
308
308
status = SPIF_BD_ERROR_READY_FAILED;
309
309
goto exit_point;
@@ -338,12 +338,12 @@ int SPIFBlockDevice::erase(bd_addr_t addr, bd_size_t in_size)
338
338
uint8_t bitfield = _region_erase_types_bitfield[region];
339
339
340
340
if ((addr + in_size) > _device_size_bytes) {
341
- tr_error (" ERROR: erase exceeds flash device size" );
341
+ tr_error (" erase exceeds flash device size" );
342
342
return SPIF_BD_ERROR_INVALID_ERASE_PARAMS;
343
343
}
344
344
345
345
if (((addr % get_erase_size (addr)) != 0 ) || (((addr + in_size) % get_erase_size (addr + in_size - 1 )) != 0 )) {
346
- tr_error (" ERROR: invalid erase - unaligned address and size" );
346
+ tr_error (" invalid erase - unaligned address and size" );
347
347
return SPIF_BD_ERROR_INVALID_ERASE_PARAMS;
348
348
}
349
349
@@ -360,7 +360,7 @@ int SPIFBlockDevice::erase(bd_addr_t addr, bd_size_t in_size)
360
360
_mutex->lock ();
361
361
362
362
if (_set_write_enable () != 0 ) {
363
- tr_error (" ERROR: SPI Erase Device not ready - failed" );
363
+ tr_error (" SPI Erase Device not ready - failed" );
364
364
erase_failed = true ;
365
365
status = SPIF_BD_ERROR_READY_FAILED;
366
366
goto exit_point;
@@ -378,7 +378,7 @@ int SPIFBlockDevice::erase(bd_addr_t addr, bd_size_t in_size)
378
378
}
379
379
380
380
if (false == _is_mem_ready ()) {
381
- tr_error (" ERROR: SPI After Erase Device not ready - failed\n " );
381
+ tr_error (" SPI After Erase Device not ready - failed" );
382
382
erase_failed = true ;
383
383
status = SPIF_BD_ERROR_READY_FAILED;
384
384
goto exit_point;
@@ -437,7 +437,7 @@ bd_size_t SPIFBlockDevice::get_erase_size(bd_addr_t addr)
437
437
}
438
438
439
439
if (i_ind == 4 ) {
440
- tr_error (" ERROR: no erase type was found for region addr" );
440
+ tr_error (" no erase type was found for region addr" );
441
441
}
442
442
}
443
443
@@ -596,19 +596,19 @@ int SPIFBlockDevice::_sfdp_parse_sector_map_table(uint32_t sector_map_table_addr
596
596
spif_bd_error status = _spi_send_read_command (SPIF_SFDP, sector_map_table, sector_map_table_addr /* address*/ ,
597
597
sector_map_table_size);
598
598
if (status != SPIF_BD_ERROR_OK) {
599
- tr_error (" ERROR: init - Read SFDP First Table Failed" );
599
+ tr_error (" init - Read SFDP First Table Failed" );
600
600
return -1 ;
601
601
}
602
602
603
603
// Currently we support only Single Map Descriptor
604
604
if (!((sector_map_table[0 ] & 0x3 ) == 0x03 ) && (sector_map_table[1 ] == 0x0 )) {
605
- tr_error (" ERROR: Sector Map - Supporting Only Single! Map Descriptor (not map commands)" );
605
+ tr_error (" Sector Map - Supporting Only Single! Map Descriptor (not map commands)" );
606
606
return -1 ;
607
607
}
608
608
609
609
_regions_count = sector_map_table[2 ] + 1 ;
610
610
if (_regions_count > SPIF_MAX_REGIONS) {
611
- tr_error (" ERROR: Supporting up to %d regions, current setup to %d regions - fail" ,
611
+ tr_error (" Supporting up to %d regions, current setup to %d regions - fail" ,
612
612
SPIF_MAX_REGIONS, _regions_count);
613
613
return -1 ;
614
614
}
@@ -650,13 +650,13 @@ int SPIFBlockDevice::_sfdp_parse_basic_param_table(uint32_t basic_table_addr, si
650
650
spif_bd_error status = _spi_send_read_command (SPIF_SFDP, param_table, basic_table_addr /* address*/ ,
651
651
basic_table_size);
652
652
if (status != SPIF_BD_ERROR_OK) {
653
- tr_error (" ERROR: init - Read SFDP First Table Failed" );
653
+ tr_error (" init - Read SFDP First Table Failed" );
654
654
return -1 ;
655
655
}
656
656
657
657
// Check address size, currently only supports 3byte addresses
658
658
if ((param_table[2 ] & 0x4 ) != 0 || (param_table[7 ] & 0x80 ) != 0 ) {
659
- tr_error (" ERROR: init - verify 3byte addressing Failed" );
659
+ tr_error (" init - verify 3byte addressing Failed" );
660
660
return -1 ;
661
661
}
662
662
@@ -702,14 +702,14 @@ int SPIFBlockDevice::_sfdp_parse_sfdp_headers(uint32_t &basic_table_addr, size_t
702
702
703
703
spif_bd_error status = _spi_send_read_command (SPIF_SFDP, sfdp_header, addr /* address*/ , data_length);
704
704
if (status != SPIF_BD_ERROR_OK) {
705
- tr_error (" ERROR: init - Read SFDP Failed" );
705
+ tr_error (" init - Read SFDP Failed" );
706
706
return -1 ;
707
707
}
708
708
709
709
// Verify SFDP signature for sanity
710
710
// Also check that major/minor version is acceptable
711
711
if (!(memcmp (&sfdp_header[0 ], " SFDP" , 4 ) == 0 && sfdp_header[5 ] == 1 )) {
712
- tr_error (" ERROR: init - _verify SFDP signature and version Failed" );
712
+ tr_error (" init - _verify SFDP signature and version Failed" );
713
713
return -1 ;
714
714
}
715
715
@@ -724,14 +724,14 @@ int SPIFBlockDevice::_sfdp_parse_sfdp_headers(uint32_t &basic_table_addr, size_t
724
724
725
725
status = _spi_send_read_command (SPIF_SFDP, param_header, addr, data_length);
726
726
if (status != SPIF_BD_ERROR_OK) {
727
- tr_error (" ERROR: init - Read Param Table %d Failed" , i_ind + 1 );
727
+ tr_error (" init - Read Param Table %d Failed" , i_ind + 1 );
728
728
return -1 ;
729
729
}
730
730
731
731
// The SFDP spec indicates the standard table is always at offset 0
732
732
// in the parameter headers, we check just to be safe
733
733
if (param_header[2 ] != 1 ) {
734
- tr_error (" ERROR: Param Table %d - Major Version should be 1!" , i_ind + 1 );
734
+ tr_error (" Param Table %d - Major Version should be 1!" , i_ind + 1 );
735
735
return -1 ;
736
736
}
737
737
@@ -797,7 +797,7 @@ int SPIFBlockDevice::_sfdp_detect_erase_types_inst_and_size(uint8_t *basic_param
797
797
if (erase4k_inst != erase_type_inst_arr[i_ind]) {
798
798
// Verify 4KErase Type is identical to Legacy 4K erase type specified in Byte 1 of Param Table
799
799
erase4k_inst = erase_type_inst_arr[i_ind];
800
- tr_warning (" WARNING: _detectEraseTypesInstAndSize - Default 4K erase Inst is different than erase type Inst for 4K" );
800
+ tr_warning (" _detectEraseTypesInstAndSize - Default 4K erase Inst is different than erase type Inst for 4K" );
801
801
802
802
}
803
803
}
@@ -809,7 +809,7 @@ int SPIFBlockDevice::_sfdp_detect_erase_types_inst_and_size(uint8_t *basic_param
809
809
}
810
810
811
811
if (false == found_4Kerase_type) {
812
- tr_warning (" WARNING: Couldn't find Erase Type for 4KB size" );
812
+ tr_warning (" Couldn't find Erase Type for 4KB size" );
813
813
}
814
814
return 0 ;
815
815
}
@@ -872,7 +872,7 @@ int SPIFBlockDevice::_reset_flash_mem()
872
872
if (SPIF_BD_ERROR_OK == _spi_send_general_command (SPIF_RSTEN, SPI_NO_ADDRESS_COMMAND, NULL , 0 , NULL , 0 )) {
873
873
// store received values in status_value
874
874
} else {
875
- tr_error (" ERROR: Sending RSTEN failed\n " );
875
+ tr_error (" Sending RSTEN failed" );
876
876
status = -1 ;
877
877
}
878
878
@@ -881,7 +881,7 @@ int SPIFBlockDevice::_reset_flash_mem()
881
881
if (SPIF_BD_ERROR_OK == _spi_send_general_command (SPIF_RST, SPI_NO_ADDRESS_COMMAND, NULL , 0 , NULL , 0 )) {
882
882
// store received values in status_value
883
883
} else {
884
- tr_error (" ERROR: Sending RST failed\n " );
884
+ tr_error (" Sending RST failed" );
885
885
status = -1 ;
886
886
}
887
887
_is_mem_ready ();
@@ -904,12 +904,12 @@ bool SPIFBlockDevice::_is_mem_ready()
904
904
// Read the Status Register from device
905
905
if (SPIF_BD_ERROR_OK != _spi_send_general_command (SPIF_RDSR, SPI_NO_ADDRESS_COMMAND, NULL , 0 , status_value,
906
906
1 )) { // store received values in status_value
907
- tr_error (" ERROR: Reading Status Register failed\n " );
907
+ tr_error (" Reading Status Register failed" );
908
908
}
909
909
} while ((status_value[0 ] & SPIF_STATUS_BIT_WIP) != 0 && retries < IS_MEM_READY_MAX_RETRIES);
910
910
911
911
if ((status_value[0 ] & SPIF_STATUS_BIT_WIP) != 0 ) {
912
- tr_error (" ERROR: _is_mem_ready FALSE\n " );
912
+ tr_error (" _is_mem_ready FALSE" );
913
913
mem_ready = false ;
914
914
}
915
915
return mem_ready;
@@ -923,24 +923,24 @@ int SPIFBlockDevice::_set_write_enable()
923
923
924
924
do {
925
925
if (SPIF_BD_ERROR_OK != _spi_send_general_command (SPIF_WREN, SPI_NO_ADDRESS_COMMAND, NULL , 0 , NULL , 0 )) {
926
- tr_error (" ERROR: Sending WREN command FAILED\n " );
926
+ tr_error (" Sending WREN command FAILED" );
927
927
break ;
928
928
}
929
929
930
930
if (false == _is_mem_ready ()) {
931
- tr_error (" ERROR: Device not ready, write failed" );
931
+ tr_error (" Device not ready, write failed" );
932
932
break ;
933
933
}
934
934
935
935
memset (status_value, 0 , 2 );
936
936
if (SPIF_BD_ERROR_OK != _spi_send_general_command (SPIF_RDSR, SPI_NO_ADDRESS_COMMAND, NULL , 0 , status_value,
937
937
1 )) { // store received values in status_value
938
- tr_error (" ERROR: Reading Status Register failed\n " );
938
+ tr_error (" Reading Status Register failed" );
939
939
break ;
940
940
}
941
941
942
942
if ((status_value[0 ] & SPIF_STATUS_BIT_WEL) == 0 ) {
943
- tr_error (" ERROR: _set_write_enable failed\n " );
943
+ tr_error (" _set_write_enable failed" );
944
944
break ;
945
945
}
946
946
status = 0 ;
@@ -993,7 +993,7 @@ int SPIFBlockDevice::_utils_iterate_next_largest_erase_type(uint8_t &bitfield, i
993
993
}
994
994
995
995
if (i_ind == 4 ) {
996
- tr_error (" ERROR: no erase type was found for current region addr" );
996
+ tr_error (" no erase type was found for current region addr" );
997
997
}
998
998
return largest_erase_type;
999
999
0 commit comments