There are a few warnings thrown by GCC for this source file that I have attempted to correct. I would definitely appreciate feedback from others on these changes: * USBHost::usb_process() would attempt to write past the end of the deviceInited[] array in the following code snippet: if (i == MAX_DEVICE_CONNECTED) { USB_ERR("Too many device connected!!\r\n"); deviceInited[i] = false; The i variable is guaranteed to index 1 item past then end of this array since it only contains MAX_DEVICE_CONNECTED elements. I have removed the line which sets deviceInited[i] to false. Two questions result though: 1) What was the intent of this line of code and is it Ok that I just removed it or should it be replaced with something else? 2) I see no where else that elements in the deviceInited array are set to false except when all are set to false in the usbThread() method. Should there be code in DEVICE_DISCONNECTED_EVENT to do this as well? * USBHost::transferCompleted(volatile uint32_t addr) was comparing addr to NULL, which is of pointer type. GCC issues a warning on this since the types are different (void* being compared to uint32_t). I switched it to just compare with 0 instead. * There is a switch statement in USBHost::unqueueEndpoint() which is conditional on a ENDPOINT_TYPE enumeration but doesn't contain cases for all values in the enumeration. I just added a default case to simply break on other values to silence this GCC warning and allow the code to continue working as it did before. Is it Ok that this particular piece of code only handles these two particular cases? * USBHost::fillControlBuf() was generating a warning about possible alignment issues when accessing the setupPacket byte array as 16-bit half words instead. I changed the casting to silence the warnings and modified the declaration of the setupPacket field to make sure that it is at least 2-byte aligned for these 16-bit accesses. |
||
---|---|---|
libraries | ||
workspace_tools | ||
.gitattributes | ||
.gitignore | ||
LICENSE | ||
README.md |
README.md
mbed SDK
The mbed Software Development Kit (SDK) is a C/C++ microcontroller software platform relied upon by tens of thousands of developers to build projects fast.
The SDK is licensed under the permissive Apache 2.0 licence, so you can use it in both commercial and personal projects with confidence.
The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community.
Documentation
- Tools: how to setup and use the build system.
- mbed library internals
- Adding a new target microcontroller
Supported Microcontrollers
NXP:
- LPC1768 (Cortex-M3)
- LPC11U24 (Cortex-M0)
- LPC2368 (ARM7TDMI-S)
- LPC812 (Cortex-M0+)
- LPC4088 (Cortex-M4)
- LPC4330 (Cortex-M4 + Cortex-M0)
- LPC1347 (Cortex-M3)
- LPC1114 (Cortex-M0)
- LPC11C24 (Cortex-M0)
Freescale:
- KL25Z (Cortex-M0+)
- KL05Z (Cortex-M0+)
STMicroelectronics:
- STM32F407 (Cortex-M4)
Supported Toolchains and IDEs
- GCC ARM: GNU Tools for ARM Embedded Processors
- ARMCC (standard library and MicroLib): uVision
- IAR: IAR Embedded Workbench
- GCC code_red: Red Suite
- GCC CodeSourcery: Sourcery CodeBench
API Documentation
- RTOS API
- TCP/IP Socket API (Transports: Ethernet, WiFi, 3G)
- USB Device API
- USB Host API
- DSP API
- Flash File Systems: SD, USB MSD, semihosted
- Peripheral Drivers API
Community
For discussing the development of the mbed SDK itself (Addition/support of microcontrollers/toolchains, build and test system, Hardware Abstraction Layer API, etc) please join our mbed-devel mailing list.
For every topic regarding the use of the mbed SDK, rather than its development, please post on the mbed.org forum, or the mbed.org Q&A.
For reporting issues in the mbed libraries please open a ticket on the issue tracker of the relevant mbed official library.