ARMmbed / qspif-blockdevice

DEPRECATED: This repository is deprecated, please use mbed-os-example-blockdevice
5 stars 2 forks source link

[OOB 5.10] example snippet - call to constructor fails #11

Closed maclobdell closed 6 years ago

maclobdell commented 6 years ago

The example code in the readme makes the call to the constructor with a 0 value for the polarity.

QSPIFBlockDevice block_device(MBED_CONF_QSPIF_QSPI_IO0,MBED_CONF_QSPIF_QSPI_IO1,MBED_CONF_QSPIF_QSPI_IO2,MBED_CONF_QSPIF_QSPI_IO3,MBED_CONF_QSPIF_QSPI_CLK,MBED_CONF_QSPIF_QSPI_CS,0,MBED_CONF_QSPIF_QSPI_FREQ);

This results in the error

Error] main.cpp@5,0:  #289: no instance of constructor "mbed::QSPIFBlockDevice::QSPIFBlockDevice"  matches the argument list
[ERROR] "./qspif-blockdevice/QSPIFBlockDevice.h", line 129: Warning:  #1300-D: ~QSPIFBlockDevice inherits implicit virtual
"./qspif-blockdevice/QSPIFBlockDevice.h", line 91: Warning:  #611-D: overloaded virtual function "BlockDevice::get_erase_size"  is only partially overridden in class "mbed::QSPIFBlockDevice"
".\main.cpp", line 5: Error:  #289: no instance of constructor "mbed::QSPIFBlockDevice::QSPIFBlockDevice"  matches the argument list
            argument types are: (PinName, PinName, PinName, PinName, PinName, PinName, int, int)
.\main.cpp: 2 warnings, 1 error

WORKAROUND - If the 0 is changed to QSPIF_POLARITY_MODE_0, then it works.

QSPIFBlockDevice block_device(MBED_CONF_QSPIF_QSPI_IO0,MBED_CONF_QSPIF_QSPI_IO1,MBED_CONF_QSPIF_QSPI_IO2,MBED_CONF_QSPIF_QSPI_IO3,MBED_CONF_QSPIF_QSPI_CLK,MBED_CONF_QSPIF_QSPI_CS,QSPIF_POLARITY_MODE_0,MBED_CONF_QSPIF_QSPI_FREQ);

The best solution would be to get the integer 0 or 1 to be successful when passed to the constructor.

MarceloSalazar commented 6 years ago

FYI @offirko

ciarmcom commented 6 years ago

ARM Internal Ref: IOTSTOR-652

MarceloSalazar commented 6 years ago

@maclobdell can you please verify the fix?

maclobdell commented 6 years ago

Works now. Thanks. Closing this issue.