Commit Graph

54 Commits (99cf33c20205a03fa7582325daa2008b051fe40c)

Author SHA1 Message Date
Lingkai Dong 6b5e467f96 HeapBlockDevice::erase(): free up heap memory
`HeapBlockDevice::erase()` previously performed a range and alignment
check only. This commit adds freeing of heap memory.
2021-04-14 17:00:17 +01:00
Lingkai Dong 7ef9e6175f HeapBlockDevice: allocate with std::nothrow
Mbed OS does not enable C++ exceptions, so we should call `new` with
`std::nothrow` which returns a C-style NULL pointer when allocation
fails to allow error handling.

For consistency of style within the same file, this commit also
replaces `malloc()` and `free()` to `new (std::nothrow)` and `delete`.
2021-04-14 17:00:17 +01:00
George Psimenos 885cdef5f7 Add standard pin-names validation script & tests 2021-03-18 17:01:53 +00:00
jeromecoutant eca714c93f [STD-PIN] update tests and components 2021-03-18 17:01:50 +00:00
Martin Kojtal e6565a4486
Merge pull request #14031 from arduino/blockdevices_namespaces
BlockDevices: specify mbed namespace where needed
2021-02-04 20:08:07 +00:00
Rajkumar Kanagaraj 6824b14e48 CMake: rename greentea test macro 2021-02-02 07:43:40 -08:00
Martino Facchin 8ca0e9f161 BlockDevices: specify mbed namespace where needed 2021-02-02 12:49:09 +01:00
Martin Kojtal 025be19d3d
Merge pull request #14090 from hugueskamba/hk_cmake_greentea_blockdevice
CMake: Add support for Blockdevice Greentea tests
2021-01-12 08:22:55 +00:00
Hugues Kamba d42e9287de CMake: Add support for Blockdevice Greentea tests
The Blockdevice Greentea tests can now be built with CMake
2020-12-24 15:48:02 +00:00
Hugues Kamba b99822628b CMake: Add support for OSPIF blockdevice 2020-12-21 13:04:12 +00:00
Hugues Kamba dca2ec7e7a Correct OSPIF include directory
The include directory was incorrectly named QSPIF.
2020-12-21 12:56:45 +00:00
Martin Kojtal 9e5e245abc
Merge pull request #14036 from ahmetalincak/maxim-max32630fthr-SD-configuration
Add SD component and Update SD card SPI interface for Maxim's MAX32630FTHR
2020-12-18 15:11:09 +00:00
Harrison Mutai 9a5ed511fe Add SPDX identifier 2020-12-15 15:01:25 +00:00
Ahmet Alincak b04e7a18c7 Add SD component and Update SD card SPI interface
To support MAX32630FTHR SD card interface implicitly,
target and SD component configurations updated.
2020-12-11 23:51:09 +03:00
Lingkai Dong 562b31ccd3 Move SFDP unit tests 2020-12-07 12:05:07 +00:00
Lingkai Dong 23702ff2b3 Update include paths to SFDP.h 2020-11-26 17:31:31 +00:00
Lingkai Dong 5d2fbdc11e Move SFDP into blockdevice where it belongs to 2020-11-26 17:31:31 +00:00
Martin Kojtal aea691a67a
Merge pull request #13960 from harmut01/2260_erase_size_const
Add const keyword to get_erase_size declaration
2020-11-26 15:54:07 +00:00
Martin Kojtal 61e4b55a22
Merge pull request #13947 from LDong-Arm/erase_algorithm_fix
Fix erase type determination for [Q/O/]BlockDevice::erase()
2020-11-26 15:53:03 +00:00
Lingkai Dong c41f7cb864 Fix integer type warnings in SFDP and *SPIFBlockDevice 2020-11-26 10:28:58 +00:00
Harrison Mutai 9857a4d63b Add const keyword to get_erase_size declaration
Add const to function declaration. Const objects cannot access const
safe functions, a compiler error is thrown if one tries to do so. This
helps ensure that the object calling the method will not be modified.
This is espescially desirable in functions where all we need to do is
query existing data and not make any alterations.
2020-11-25 13:09:06 +00:00
Martin Kojtal 2f709cc13f
Merge pull request #13896 from jeromecoutant/PR_OSPI
STM32 OSPI support
2020-11-24 13:53:30 +00:00
Martin Kojtal 57bbb4739b
Merge pull request #13085 from pea-pod/remove-deprecated-mbed-assert
Change MBED_STATIC_ASSERTs version for built-in
2020-11-24 13:38:07 +00:00
Lingkai Dong 7525134532 [Q/O/]SPIFBlockDevice: remove logic for unaligned erase, as alignment is checked
[Q/O/SPIFBlockDevice::erase() begin with an alignment check,
after which unaligned erases should not happen or be allowed.

If the erase address is not aligned to the value returned by
sfdp_iterate_next_largest_erase_type(), it indicates an
internal error in erase table parsing which should not be
hidden.
2020-11-23 15:55:24 +00:00
Lingkai Dong 76cf78d654 general_block_device: optimize test_contiguous_erase_write_read() buffer size for large-sector flashes 2020-11-12 14:36:55 +00:00
Lingkai Dong 4a47709cb0 Fix OSPIFBlockDevice program size
From the datasheet of the only OctaSPI flash we currently support
(http://www.mt-system.ru/sites/default/files/docs/Macronix/mx25lm51245g_3v_512mb_v0.01.pdf):

After program/erase command is issued, auto program/erase
algorithms which program/erase and verify the specified page
or sector/block locations will be executed. Program command is
executed on byte basis, or page (256 bytes) basis, or word basis.
Erase command is executed on sector (4K-byte), or block (64K-byte),
or whole chip basis.

So the minimum write size is one byte.
2020-11-12 14:36:55 +00:00
Lingkai Dong 9f3ada3131 Fix printing of contiguous_erase_size 2020-11-12 14:36:55 +00:00
Lingkai Dong c61445a787 QSPIFBlockDevice: fix misconception in minimum program size
Prior to this PR, the minimum program size (QSPI_MIN_PROG_SIZE) of
QSPIFBlockDevice was 256 by default and 512 for some targets.
Those values were in fact page sizes, not program sizes.

Here's an explanation:
* Most QSPI flashes can be programmed to a granularity of a
  single byte or a few bytes - no need to be a whole page.
  This should be the value of QSPI_MIN_PROG_SIZE. Applications
  need to align buffer sizes to this granularity when
  programming QSPI flashes.
* Each sending of the underlying QSPI program signal requires
  destination bytes to be located within the same page.
  If a QSPIFBlockDevice::program() call crosses page boundaries,
  this function breaks down the operation into multiple chunks,
  so it's not a concern for the application.

So this PR changes the default program size to 1 (byte), and
for targets with a 4-byte (1-word) read size it overrides the
program size.

Note: No config is needed for the page size, as it comes from
the SFDP table parsed during initialisation.
2020-11-12 14:36:55 +00:00
Martin Kojtal 65097e1c07
Merge pull request #13878 from evedon/blockdevice-library
Add missing blockdevice mbed_lib.json
2020-11-12 08:44:48 +00:00
jeromecoutant 4cf3a7f0f2 OSPIF: dummy cycles update 2020-11-10 18:38:21 +01:00
Hugues Kamba bf84a5b329 CMake: Rename CMake targets
* mbed-os renamed mbed-core
* mbed-os-<COMPONENT> renamed mbed-<COMPONENT>
2020-11-06 17:25:22 +00:00
Hugues Kamba fa98689639 CMake: Componentize Mbed OS into multiple CMake targets (#13732)
Aside from the core mbed-os CMake target, a number of targets have been created so they can optionally be included by application executables that require them using `target_link_libraries()`.

Co-authored-by: Martin Kojtal <martin.kojtal@arm.com>
Co-authored-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@arm.com>
2020-11-06 17:25:21 +00:00
Martin Kojtal 5a1d64aae5 CMake: Fix blockdevice components source and include paths
This file paths were updated on master and this was broken after
rebasing.
2020-11-06 17:25:19 +00:00
Martin Kojtal 14c6af1558 cmake: fix sd component recent dir structure 2020-11-06 17:25:19 +00:00
Hugues Kamba f12f9adbed CMake: Fix failures due to device_key and storage dirs move 2020-11-06 17:25:19 +00:00
Hugues Kamba a08be8c8a0 CMake: Add support for storage dir 2020-11-06 17:25:15 +00:00
Martin Kojtal 77638f9b72
Merge pull request #13698 from boraozgen/bugfix/spif-read-dummy-bytes
Fix SPIF read dummy cycles not being reset
2020-11-05 15:44:00 +00:00
Evelyne Donnaes f4b7f44d93 Added missing blockdevice mbed_lib.json 2020-11-02 16:35:26 +00:00
pea-pod 507181d262 Change MBED_STATIC_ASSERTs version for built-in 2020-10-27 08:30:40 -05:00
Harrison Mutai 4fad1112e5 Add SPDX license identifier to Arm files
Add license identifier to files which Arm owns the copyright to,
and contain either BSD-3 or Apache-2.0 licenses. This is to address
license errors raised by scancode analysis.
2020-10-15 10:47:27 +01:00
Bora Özgen ad9385ce2b Fix SFDP read dummy cycles not being reset 2020-10-02 15:02:00 +02:00
rogeryou 48524f25ae add opsi driver 2020-09-16 11:27:23 +08:00
Jaeden Amero 39e69d328d Use boot stack size from config system
To allow overriding of the boot stack size from the Mbed configuration
system, consistently use MBED_CONF_TARGET_BOOT_STACK_SIZE rather than
MBED_BOOT_STACK_SIZE.

Fixes #10319
2020-09-10 10:08:38 +01:00
Lingkai Dong 3b9335055b general_block_device test: allocate buffers enough for the largest sector
Previously we get the common erase size of the whole flash, which
may or may not exists if there are multiple regions. In this case
the size returned is zero and the test fails.

Fix this by allocating read and write buffers that are large enough
for all sectors. The test itself already supports non-uniform
erase sizes, and the erase size at any address can be smaller
than our buffers.
2020-09-04 16:05:10 +01:00
Lingkai Dong feb1023849 test_program_read_small_data_sizes: get erase size specific to the sector we use
The test case only uses one specific sector, but the erase size
is obtained for the whole block device instead. This doesn't work
if different regions of the flash don't have a common erase size.

Fix the issue by getting the erase size at the address we use.
2020-09-04 16:02:53 +01:00
Lingkai Dong 61fd872cc3 QSPIF: options to preset reset sequence for legacy SFDP
The first revision (1.0) of SFDP (ref: JESD216) does not include
fields for software reset support. It's only been added in the
second revision (1.5) (ref: JESD216A).

Some Mbed OS targets such as DISCO_F746NG include flashes with
legacy SFDP, thus we add an option to preset the reset mode.
2020-08-21 11:37:47 +01:00
Rajkumar Kanagaraj ef18003588 Rename to more readable include header directory component name 2020-08-18 13:10:50 +01:00
Rajkumar Kanagaraj bf58572c4d Refactor storage COMPONENT_xx directory 2020-08-17 16:44:05 +01:00
Rajkumar Kanagaraj 8a0ba8f0c2 Refactor storage/system_storage directory 2020-07-23 08:30:49 -07:00
Rajkumar Kanagaraj d47689be8e Move storgae unittests 2020-07-17 03:10:58 -07:00