Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/basic_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
mkdir -p SCANCODE
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
| ( grep '.\(c\|cpp\|h\|hpp\|py\)$' || true )
| ( grep '\.\(c\|cpp\|h\|hpp\|py\)$' || true )
echo $?
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
| ( grep '.\(c\|cpp\|h\|hpp\|py\)$' || true ) \
| ( grep '\.\(c\|cpp\|h\|hpp\|py\)$' || true ) \
| while read file; do cp --parents "${file}" SCANCODE; done
ls SCANCODE
scancode -l --json-pp scancode.json SCANCODE
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/greentea_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ jobs:
# Raspberry Pi MCUs
- target: RASPBERRY_PI_PICO
profile: full
- target: RASPBERRY_PI_PICO_2
profile: full

steps:
- name: Checkout
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@
[submodule "features/frameworks/rtt/RTT"]
path = features/frameworks/rtt/RTT
url = https://github.com/SEGGERMicro/RTT.git
[submodule "targets/TARGET_RASPBERRYPI/tinyalloc"]
path = targets/TARGET_RASPBERRYPI/tinyalloc
url = https://github.com/dzyong/tinyalloc.git
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ A message that notes the main changes in the update.
- Fixed issue where reading from an I2C master in slave mode could hang forever if the master ends the transaction early
- Fixed issue where writing to an I2C master in slave mode would always return success regardless of success/failure
- Fixed assert failure when calling SPI::write() with a zero-length Tx or Rx buffer
- Implemented missing USB endpoint abort function, so `USBDevice::endpoint_abort()` is no longer a no-op
- Implemented memory manager for USB DPRAM and proper deallocation of endpoint buffers, so USB will no longer die once a certain number of endpoints are created and destroyed over the life of the application.
- RP2040:
- Fixed RTC not counting until the time was first set (just calling `RealTimeClock::init()` was not enough)
- Fixed issue where if the same setting was overridden in multiple different `target_override` blocks in mbed_app.json, only one of the overrides would be processed
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,17 @@ Folders containing files under different permissive license than Apache 2.0 are

To start a new project that uses Mbed CE, see the setup guide [here](https://github.com/mbed-ce/mbed-os/wiki/New-Project-Setup-Guide).

We have a [developer website](https://os.mbed.com) for asking questions, engaging with others, finding information on boards and components, using an online IDE and compiler, reading the documentation and learning about what's new and what's coming next in Mbed OS.

Additionally, the [discussions page](https://github.com/mbed-ce/mbed-os/discussions) on this repo can be used for proposing and discussing specific code changes.
If you'd like to talk to the Mbed CE devs, the [discussions page](https://github.com/mbed-ce/mbed-os/discussions) on this repo can be used to ask for help or to propose and discuss code changes.

## Documentation

### Mbed CE Docs
For the Mbed CE code-level documentation (Doxygen), see [here](https://mbed-ce.github.io/mbed-os/group__mbed-os-public.html). For an auto-generated listing of target boards supported by Mbed, and the drivers & features each target supports, see the [targets index here](https://mbed-ce.github.io/mbed-ce-test-tools/targets/) and the [drivers index here](https://mbed-ce.github.io/mbed-ce-test-tools/drivers/).
Our website has several [how-to-use guides](https://mbed-ce.dev/how-to-use/io-basics/) that will get you started using core Mbed OS concepts, and we are working on more over time. For the Mbed CE code-level documentation (Doxygen), see [here](https://mbed-ce.github.io/mbed-os/group__mbed-os-public.html). For an auto-generated listing of target boards supported by Mbed, and the drivers & features each target supports, see the [targets index here](https://mbed-ce.github.io/mbed-ce-test-tools/targets/) and the [drivers index here](https://mbed-ce.github.io/mbed-ce-test-tools/drivers/).
Comment thread
JohnK1987 marked this conversation as resolved.

Mbed CE is still working on more complete documentation infrastructure. Eventually, we hope to migrate all of the docs and examples as well. However, for now, see below to access those on the original Mbed OS docs site.

### Original ARM Mbed OS Docs
For more information about Mbed OS, please see [the published Mbed OS documentation](https://os.mbed.com/docs/latest). It includes general overview information, step-by-step tutorials, porting information and background reference materials about our architecture and tools.
For more information about Mbed OS, please see [the archived Mbed OS documentation](https://web.archive.org/web/20250622054924/https://os.mbed.com/docs/mbed-os/v6.16/introduction/index.html). It includes general overview information, step-by-step tutorials, porting information and background reference materials about our architecture and tools.



24 changes: 19 additions & 5 deletions drivers/usb/source/USBDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "USBDescriptor.h"
#include "usb_phy_api.h"
#include "mbed_assert.h"
#include "mbed_interface.h"
#include "platform/mbed_error.h"

//#define DEBUG
Expand Down Expand Up @@ -1007,7 +1008,17 @@ void USBDevice::in(usb_ep_t endpoint)

endpoint_info_t *info = &_endpoint_info[EP_TO_INDEX(endpoint)];

MBED_ASSERT(info->pending >= 1);
if (info->pending == 0) {
MBED_ERROR1(
MBED_MAKE_ERROR(
MBED_MODULE_DRIVER_USB,
MBED_ERROR_CODE_INVALID_OPERATION
),
"IN transfer started to endpoint with no preceding write_start() call.",
endpoint
);
}

info->pending -= 1;
if (info->callback) {
info->callback();
Expand Down Expand Up @@ -1434,12 +1445,13 @@ bool USBDevice::read_start(usb_ep_t endpoint, uint8_t *buffer, uint32_t max_size

if (!EP_INDEXABLE(endpoint)) {
#if MBED_TRAP_ERRORS_ENABLED
MBED_ERROR(
MBED_ERROR1(
MBED_MAKE_ERROR(
MBED_MODULE_DRIVER_USB,
MBED_ERROR_CODE_INVALID_INDEX
),
"The endpoint is not indexable."
"The endpoint is not indexable.",
endpoint
);
#else
unlock();
Expand All @@ -1449,8 +1461,10 @@ bool USBDevice::read_start(usb_ep_t endpoint, uint8_t *buffer, uint32_t max_size

endpoint_info_t *info = &_endpoint_info[EP_TO_INDEX(endpoint)];
if (!(info->flags & ENDPOINT_ENABLED)) {
// Assert that only valid endpoints are used when in the configured state
MBED_ASSERT(!configured());
// Only valid endpoints may be used when in the configured state
if (configured()) {
MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_DRIVER_USB, MBED_ERROR_CODE_INVALID_OPERATION), "Endpoint read before being enabled!", endpoint);
}
unlock();
return false;
}
Expand Down
Loading
Loading