Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
15 changes: 15 additions & 0 deletions cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/rtx_mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,11 @@ const char *osMutexGetName (osMutexId_t mutex_id) {
osStatus_t osMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) {
osStatus_t status;

// a null mutex handle is always invalid
if(mutex_id == 0) {
return osErrorParameter;
}

EvrRtxMutexAcquire(mutex_id, timeout);
if (IsException() || IsIrqMasked()) {
EvrRtxMutexError(mutex_id, (int32_t)osErrorISR);
Expand All @@ -534,6 +539,11 @@ osStatus_t osMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) {
osStatus_t osMutexRelease (osMutexId_t mutex_id) {
osStatus_t status;

// a null mutex handle is always invalid
if(mutex_id == 0) {
return osErrorParameter;
}

EvrRtxMutexRelease(mutex_id);
if (IsException() || IsIrqMasked()) {
EvrRtxMutexError(mutex_id, (int32_t)osErrorISR);
Expand Down Expand Up @@ -561,6 +571,11 @@ osThreadId_t osMutexGetOwner (osMutexId_t mutex_id) {
osStatus_t osMutexDelete (osMutexId_t mutex_id) {
osStatus_t status;

// a null mutex handle is always invalid
if(mutex_id == 0) {
return osErrorParameter;
}

EvrRtxMutexDelete(mutex_id);
if (IsException() || IsIrqMasked()) {
EvrRtxMutexError(mutex_id, (int32_t)osErrorISR);
Expand Down
7 changes: 7 additions & 0 deletions cmsis/device/rtos/source/mbed_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ void mbed_init(void)
SCnSCB->ACTLR |= SCnSCB_ACTLR_DISDEFWBUF_Msk;
#endif
#endif

// If present, set the bits to enable memory / usage / bus faults.
// Otherwise these will all get escalated to hard faults.
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk | SCB_SHCSR_USGFAULTENA_Msk | SCB_SHCSR_BUSFAULTENA_Msk;
#endif

mbed_mpu_manager_init();
mbed_cpy_nvic();
mbed_sdk_init();
Expand Down
11 changes: 2 additions & 9 deletions connectivity/drivers/emac/include/GenericEthDMA.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,22 +244,15 @@ namespace mbed {
// Step 2: Copy packet if needed
if(needToCopy)
{
auto * newBuf = memory_manager->alloc_heap(memory_manager->get_total_len(buf), 0);
if(newBuf == nullptr)
buf = memory_manager->realloc_as_contiguous(buf, 0);
if(buf == nullptr)
{
// No free memory, drop packet
return CompositeEMAC::ErrCode::OUT_OF_MEMORY;
}

// We should have gotten just one contiguous buffer
MBED_ASSERT(memory_manager->get_next(newBuf) == nullptr);
packetDescsUsed = 1;
neededFreeDescs = packetDescsUsed + extraTxDescsToLeave;

// Copy data over
memory_manager->copy_from_buf(static_cast<uint8_t *>(memory_manager->get_ptr(newBuf)), memory_manager->get_len(newBuf), buf);
memory_manager->free(buf);
buf = newBuf;
}

tr_debug("Transmitting packet of length %lu in %zu buffers and %zu descs\n",
Expand Down
2 changes: 1 addition & 1 deletion connectivity/drivers/wifi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if("STM" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM EXCLUDE_FROM_ALL)
endif()

if("WHD" IN_LIST MBED_TARGET_LABELS)
if("COMPONENT_WHD=1" IN_LIST MBED_TARGET_DEFINITIONS)
create_mbed_wifi_target()
add_subdirectory(COMPONENT_WHD EXCLUDE_FROM_ALL)
endif()
Expand Down
6 changes: 0 additions & 6 deletions connectivity/drivers/wifi/COMPONENT_WHD/mbed_lib.json

This file was deleted.

10 changes: 10 additions & 0 deletions connectivity/drivers/wifi/COMPONENT_WHD/mbed_lib.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "cy_psoc6_whd",
"config": {
"present": 1,
"tx-buffer-header-space": {
"help": "Header space in bytes that needs to be present in buffers passed from the Mbed EMAC to the WHD driver.",
"value": 64
}
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@ target_include_directories(mbed-wifi

target_sources(mbed-wifi
PRIVATE
cy_network_buffer.c
cybsp_wifi.c
)

target_link_libraries(mbed-wifi
PUBLIC
mbed-lwipstack
mbed-core-flags
)

if("DEVICE_EMAC=1" IN_LIST MBED_TARGET_DEFINITIONS)
target_link_libraries(mbed-wifi
PUBLIC
Expand Down

This file was deleted.

Loading
Loading