Skip to content

Commit e0cd416

Browse files
Remove dataflash component, it isn't supported in hardware :(
1 parent ffe2f29 commit e0cd416

File tree

5 files changed

+18
-37
lines changed

5 files changed

+18
-37
lines changed

storage/blockdevice/COMPONENT_DATAFLASH/mbed_lib.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,5 @@
1414
"help": "Configure device to use DataFlash address space.",
1515
"value": "0"
1616
}
17-
},
18-
"target_overrides": {
19-
"FF_LPC546XX": {
20-
"SPI_MOSI": "P0_8",
21-
"SPI_MISO": "P0_9",
22-
"SPI_CLK": "P0_6",
23-
"SPI_CS": "P0_7"
24-
}
2517
}
2618
}

storage/blockdevice/COMPONENT_DATAFLASH/source/DataFlashBlockDevice.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ using namespace mbed;
2626
#define DATAFLASH_READ_SIZE 1
2727
#define DATAFLASH_PROG_SIZE 1
2828
#define DATAFLASH_TIMEOUT 10000
29-
#define DATAFLASH_ID_MATCH 0x1F20
29+
#define DATAFLASH_ID_MASK 0xFFE0 // Matches Manufacturer ID and Family Code
30+
#define DATAFLASH_ID_MATCH 0x1F20 // Matches Adesto/Renesas AT45Dxxx family
3031
#define DATAFLASH_ID_DENSITY_MASK 0x001F
3132
#define DATAFLASH_PAGE_SIZE_256 0x0100
3233
#define DATAFLASH_PAGE_SIZE_264 0x0108
@@ -41,7 +42,7 @@ using namespace mbed;
4142

4243
/* enable debug */
4344
#ifndef DATAFLASH_DEBUG
44-
#define DATAFLASH_DEBUG 0
45+
#define DATAFLASH_DEBUG 1
4546
#endif /* DATAFLASH_DEBUG */
4647

4748
#if DATAFLASH_DEBUG
@@ -186,13 +187,13 @@ int DataFlashBlockDevice::init()
186187
/* read ID register to validate model and set dimensions */
187188
uint16_t id = _get_register(DATAFLASH_OP_ID);
188189

189-
DEBUG_PRINTF("id: %04X\r\n", id & DATAFLASH_ID_MATCH);
190+
DEBUG_PRINTF("id: %04X\r\n", id);
190191

191192
/* get status register to verify the page size mode */
192193
uint16_t status = _get_register(DATAFLASH_OP_STATUS);
193194

194195
/* manufacture ID match */
195-
if ((id & DATAFLASH_ID_MATCH) == DATAFLASH_ID_MATCH) {
196+
if ((id & DATAFLASH_ID_MASK) == DATAFLASH_ID_MATCH) {
196197

197198
/* calculate density */
198199
_device_size = 0x8000 << (id & DATAFLASH_ID_DENSITY_MASK);

storage/blockdevice/tests/TESTS/blockdevice/general_block_device/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ void test_deinit_bd()
855855

856856
void test_write_deinit_init()
857857
{
858-
TEST_SKIP_UNLESS_MESSAGE(block_device != NULL, "no block device found.");
858+
//TEST_SKIP_UNLESS_MESSAGE(block_device != NULL, "no block device found.");
859859
// Determine start_address & stop_address
860860
bd_addr_t addr = sectors_addr[rand() % num_of_sectors];
861861
bd_size_t erase_size = block_device->get_erase_size(addr);

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/PinNames.h

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,6 @@ typedef enum {
184184
P4_15 = (4 << PORT_SHIFT | 15),
185185
P4_16 = (4 << PORT_SHIFT | 16),
186186

187-
188-
189-
// mbed original LED naming
190-
LED1 = P1_3,
191-
LED2 = P1_27,
192-
LED3 = P1_26,
193-
LED4 = P1_28,
194-
195-
196187
// USB Pins
197188
CONSOLE_TX = P0_30,
198189
CONSOLE_RX = P0_29,
@@ -233,24 +224,21 @@ typedef enum {
233224
p29 = P0_0,
234225
p30 = P0_1,
235226

236-
237-
I2C_SCL2 = P0_27,
238-
I2C_SDA2 = P0_26,
239-
I2C_SCL7 = P1_30,
240-
I2C_SDA7 = P1_29,
241-
I2C_SCL = I2C_SCL2,
242-
I2C_SDA = I2C_SDA2,
243-
244-
245227
// Not connected
246228
NC = (int)0xFFFFFFFF
247229
} PinName;
248230

249231
#define LED1 P1_3
250-
#define LED2 P1_26
251-
#define LED3 P1_27
232+
#define LED2 P1_27
233+
#define LED3 P1_22
252234
#define LED4 P1_28
253235

236+
#define I2C_SCL0 P0_27
237+
#define I2C_SDA0 P0_26
238+
239+
#define I2C_SCL1 P1_30
240+
#define I2C_SDA1 P1_29
241+
254242
typedef enum {
255243
PullNone = 0,
256244
PullDown = 1,

targets/targets.json5

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5625,7 +5625,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
56255625
"PORTINOUT",
56265626
"PORTOUT",
56275627
"SERIAL",
5628-
//"SLEEP",
5628+
"SLEEP",
56295629
"SPI",
56305630
"SPISLAVE",
56315631
"FLASH",
@@ -5689,9 +5689,9 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
56895689
"release_versions": [
56905690
"5"
56915691
],
5692-
"components_add": [
5693-
"DATAFLASH"
5694-
],
5692+
// Note: this target has a DataFlash flash on the board, BUT they actually pinned it out wrong:
5693+
// SCLK is connected to SPI3, while MOSI and MISO are connected to SPI5. So, the flash is
5694+
// impossible to use, at least without bodge wires!
56955695
"device_name": "LPC54606J512BD100",
56965696
"image_url": "https://os.mbed.com/media/cache/platforms/t17_VBxJMp4.png.250x250_q85.png"
56975697
},

0 commit comments

Comments
 (0)